fake_intent_helper_host.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Copyright 2022 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_ARC_TEST_FAKE_INTENT_HELPER_HOST_H_
  5. #define COMPONENTS_ARC_TEST_FAKE_INTENT_HELPER_HOST_H_
  6. #include "ash/components/arc/mojom/intent_helper.mojom.h"
  7. #include "ash/components/arc/session/connection_holder.h"
  8. namespace arc {
  9. // For tests in arc/ that cannot use the real IntentHelperHost implementation
  10. // in //components/arc.
  11. class FakeIntentHelperHost : public mojom::IntentHelperHost {
  12. public:
  13. explicit FakeIntentHelperHost(
  14. ConnectionHolder<arc::mojom::IntentHelperInstance,
  15. arc::mojom::IntentHelperHost>* app_connection_holder);
  16. FakeIntentHelperHost(const FakeIntentHelperHost&) = delete;
  17. FakeIntentHelperHost& operator=(const FakeIntentHelperHost&) = delete;
  18. ~FakeIntentHelperHost() override;
  19. // mojom::IntentHelperHost overrides.
  20. void OnIconInvalidated(const std::string& package_name) override;
  21. void OnIntentFiltersUpdated(
  22. std::vector<IntentFilter> intent_filters) override;
  23. void OnOpenDownloads() override;
  24. void OnOpenUrl(const std::string& url) override;
  25. void OnOpenCustomTab(const std::string& url,
  26. int32_t task_id,
  27. OnOpenCustomTabCallback callback) override;
  28. void OnOpenChromePage(mojom::ChromePage page) override;
  29. void FactoryResetArc() override;
  30. void OpenWallpaperPicker() override;
  31. void OpenVolumeControl() override;
  32. void OnOpenWebApp(const std::string& url) override;
  33. void RecordShareFilesMetricsDeprecated(mojom::ShareFiles flag) override;
  34. void LaunchCameraApp(uint32_t intent_id,
  35. arc::mojom::CameraIntentMode mode,
  36. bool should_handle_result,
  37. bool should_down_scale,
  38. bool is_secure,
  39. int32_t task_id) override;
  40. void OnIntentFiltersUpdatedForPackage(
  41. const std::string& package_name,
  42. std::vector<IntentFilter> intent_filters) override;
  43. void CloseCameraApp() override;
  44. void IsChromeAppEnabled(arc::mojom::ChromeApp app,
  45. IsChromeAppEnabledCallback callback) override;
  46. void OnSupportedLinksChanged(
  47. std::vector<arc::mojom::SupportedLinksPtr> added_packages,
  48. std::vector<arc::mojom::SupportedLinksPtr> removed_packages,
  49. arc::mojom::SupportedLinkChangeSource source) override;
  50. void OnDownloadAdded(const std::string& relative_path,
  51. const std::string& owner_package_name) override;
  52. void OnOpenAppWithIntent(const GURL& start_url,
  53. arc::mojom::LaunchIntentPtr intent) override;
  54. void OnOpenGlobalActions() override;
  55. void OnCloseSystemDialogs() override;
  56. private:
  57. // The connection holder must outlive |this| object.
  58. ConnectionHolder<arc::mojom::IntentHelperInstance,
  59. arc::mojom::IntentHelperHost>* const
  60. intent_helper_connection_holder_;
  61. };
  62. } // namespace arc
  63. #endif // COMPONENTS_ARC_TEST_FAKE_INTENT_HELPER_HOST_H_