1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- // Copyright 2022 The Chromium Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- #ifndef COMPONENTS_ARC_TEST_FAKE_INTENT_HELPER_HOST_H_
- #define COMPONENTS_ARC_TEST_FAKE_INTENT_HELPER_HOST_H_
- #include "ash/components/arc/mojom/intent_helper.mojom.h"
- #include "ash/components/arc/session/connection_holder.h"
- namespace arc {
- // For tests in arc/ that cannot use the real IntentHelperHost implementation
- // in //components/arc.
- class FakeIntentHelperHost : public mojom::IntentHelperHost {
- public:
- explicit FakeIntentHelperHost(
- ConnectionHolder<arc::mojom::IntentHelperInstance,
- arc::mojom::IntentHelperHost>* app_connection_holder);
- FakeIntentHelperHost(const FakeIntentHelperHost&) = delete;
- FakeIntentHelperHost& operator=(const FakeIntentHelperHost&) = delete;
- ~FakeIntentHelperHost() override;
- // mojom::IntentHelperHost overrides.
- void OnIconInvalidated(const std::string& package_name) override;
- void OnIntentFiltersUpdated(
- std::vector<IntentFilter> intent_filters) override;
- void OnOpenDownloads() override;
- void OnOpenUrl(const std::string& url) override;
- void OnOpenCustomTab(const std::string& url,
- int32_t task_id,
- OnOpenCustomTabCallback callback) override;
- void OnOpenChromePage(mojom::ChromePage page) override;
- void FactoryResetArc() override;
- void OpenWallpaperPicker() override;
- void OpenVolumeControl() override;
- void OnOpenWebApp(const std::string& url) override;
- void RecordShareFilesMetricsDeprecated(mojom::ShareFiles flag) override;
- void LaunchCameraApp(uint32_t intent_id,
- arc::mojom::CameraIntentMode mode,
- bool should_handle_result,
- bool should_down_scale,
- bool is_secure,
- int32_t task_id) override;
- void OnIntentFiltersUpdatedForPackage(
- const std::string& package_name,
- std::vector<IntentFilter> intent_filters) override;
- void CloseCameraApp() override;
- void IsChromeAppEnabled(arc::mojom::ChromeApp app,
- IsChromeAppEnabledCallback callback) override;
- void OnSupportedLinksChanged(
- std::vector<arc::mojom::SupportedLinksPtr> added_packages,
- std::vector<arc::mojom::SupportedLinksPtr> removed_packages,
- arc::mojom::SupportedLinkChangeSource source) override;
- void OnDownloadAdded(const std::string& relative_path,
- const std::string& owner_package_name) override;
- void OnOpenAppWithIntent(const GURL& start_url,
- arc::mojom::LaunchIntentPtr intent) override;
- void OnOpenGlobalActions() override;
- void OnCloseSystemDialogs() override;
- private:
- // The connection holder must outlive |this| object.
- ConnectionHolder<arc::mojom::IntentHelperInstance,
- arc::mojom::IntentHelperHost>* const
- intent_helper_connection_holder_;
- };
- } // namespace arc
- #endif // COMPONENTS_ARC_TEST_FAKE_INTENT_HELPER_HOST_H_
|