arc_intent_helper_observer.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2016 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_INTENT_HELPER_ARC_INTENT_HELPER_OBSERVER_H_
  5. #define COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_OBSERVER_H_
  6. #include <string>
  7. #include "ash/components/arc/mojom/intent_helper.mojom-forward.h"
  8. #include "third_party/abseil-cpp/absl/types/optional.h"
  9. namespace base {
  10. class FilePath;
  11. } // namespace base
  12. namespace arc {
  13. class ArcIntentHelperObserver {
  14. public:
  15. virtual ~ArcIntentHelperObserver() = default;
  16. // Called when a new entry has been added to the MediaStore.Downloads
  17. // collection of downloaded items in ARC with the specified metadata.
  18. // |relative_path| relative path of the download within the Download/
  19. // folder (e.g. "Download/foo/bar.pdf").
  20. // |owner_package_name| package name that contributed the download (e.g.
  21. // "com.bar.foo").
  22. virtual void OnArcDownloadAdded(const base::FilePath& relative_path,
  23. const std::string& owner_package_name) {}
  24. // Called when intent filters are added, removed or updated.
  25. // A absl::nullopt |package_name| indicates that intent filters were updated
  26. // for all packages. Otherwise, |package_name| contains the name of the
  27. // package whose filters were changed.
  28. virtual void OnIntentFiltersUpdated(
  29. const absl::optional<std::string>& package_name) {}
  30. // Called when the supported links setting ("Open Supported Links" under
  31. // "Open by default" in ARC Settings) is changed for one or more packages.
  32. // |added_packages| contains packages for which the setting was enabled,
  33. // |removed_packages| contains packages for which the setting was disabled.
  34. virtual void OnArcSupportedLinksChanged(
  35. const std::vector<arc::mojom::SupportedLinksPtr>& added_packages,
  36. const std::vector<arc::mojom::SupportedLinksPtr>& removed_packages,
  37. arc::mojom::SupportedLinkChangeSource source) {}
  38. virtual void OnIconInvalidated(const std::string& package_name) {}
  39. // Called when ArcIntentHelperBridge is shut down.
  40. virtual void OnArcIntentHelperBridgeShutdown() {}
  41. };
  42. } // namespace arc
  43. #endif // COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_OBSERVER_H_