nearby_share_delegate.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright 2020 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 ASH_PUBLIC_CPP_NEARBY_SHARE_DELEGATE_H_
  5. #define ASH_PUBLIC_CPP_NEARBY_SHARE_DELEGATE_H_
  6. #include "ash/public/cpp/ash_public_export.h"
  7. #include "base/observer_list_types.h"
  8. namespace base {
  9. class TimeTicks;
  10. } // namespace base
  11. namespace ash {
  12. // This delegate is a singleton used by the
  13. // NearbyShareVisibilityFeaturePodButton in //ash to communicate with the
  14. // NearbySharingService KeyedService in //chrome.
  15. class ASH_PUBLIC_EXPORT NearbyShareDelegate {
  16. public:
  17. virtual ~NearbyShareDelegate() = default;
  18. // Used by the pod button to determine whether it should be visible.
  19. virtual bool IsPodButtonVisible() = 0;
  20. // Gets the current high visibility state from the NearbySharingService.
  21. virtual bool IsHighVisibilityOn() = 0;
  22. // Returns true if EnableHighVisibility() has been called but
  23. // NearbyShareDelegate has not yet been informed that the request has
  24. // concluded.
  25. virtual bool IsEnableHighVisibilityRequestActive() const = 0;
  26. // If high visibility is on, returns the time when the delegate
  27. // will turn it off. May return any value if high visibility is off.
  28. virtual base::TimeTicks HighVisibilityShutoffTime() const = 0;
  29. // Request high visibility be turned on. If Nearby Share is disabled in prefs,
  30. // this will instead redirect the user to onboarding.
  31. virtual void EnableHighVisibility() = 0;
  32. // Request high visibility be turned off.
  33. virtual void DisableHighVisibility() = 0;
  34. // Open the settings page for Nearby Share, Used when the user clicks on the
  35. // label under the pod button.
  36. virtual void ShowNearbyShareSettings() const = 0;
  37. };
  38. } // namespace ash
  39. #endif // ASH_PUBLIC_CPP_NEARBY_SHARE_DELEGATE_H_