proximity_auth_pref_manager.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Copyright 2015 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_COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_PREF_MANAGER_H_
  5. #define ASH_COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_PREF_MANAGER_H_
  6. #include <stdint.h>
  7. namespace proximity_auth {
  8. // Interface for setting and getting persistent user preferences. There is an
  9. // implementation for a logged in profile and the device local state when the
  10. // user is logged out.
  11. class ProximityAuthPrefManager {
  12. public:
  13. ProximityAuthPrefManager() {}
  14. ProximityAuthPrefManager(const ProximityAuthPrefManager&) = delete;
  15. ProximityAuthPrefManager& operator=(const ProximityAuthPrefManager&) = delete;
  16. virtual ~ProximityAuthPrefManager() {}
  17. // Returns true if EasyUnlock is allowed. Note: there is no corresponding
  18. // setter because this pref is pushed through an enterprise policy. Note that
  19. // this pref completely disables EasyUnlock, hiding even the UI. See
  20. // IsEasyUnlockEnabled() for comparison.
  21. virtual bool IsEasyUnlockAllowed() const = 0;
  22. // Returns true if EasyUnlock is enabled, i.e. the user has gone through the
  23. // setup flow and has at least one phone as an unlock key. Compare to
  24. // IsEasyUnlockAllowed(), which completely removes the feature from existence.
  25. virtual void SetIsEasyUnlockEnabled(bool is_easy_unlock_enabled) const = 0;
  26. virtual bool IsEasyUnlockEnabled() const = 0;
  27. // Returns true if EasyUnlock has ever been enabled, regardless of whether the
  28. // feature is currently enabled or disabled. Compare to IsEasyUnlockEnabled(),
  29. // which flags the latter case.
  30. virtual void SetEasyUnlockEnabledStateSet() const = 0;
  31. virtual bool IsEasyUnlockEnabledStateSet() const = 0;
  32. // Setter and getter for the timestamp of the last time the promotion was
  33. // shown to the user.
  34. virtual void SetLastPromotionCheckTimestampMs(int64_t timestamp_ms) = 0;
  35. virtual int64_t GetLastPromotionCheckTimestampMs() const = 0;
  36. // Setter and getter for the number of times the promotion was shown to the
  37. // user.
  38. virtual void SetPromotionShownCount(int count) = 0;
  39. virtual int GetPromotionShownCount() const = 0;
  40. // Getter for whether EasyUnlock is allowed for ChromeOS login (in addition to
  41. // screen lock).
  42. virtual bool IsChromeOSLoginAllowed() const = 0;
  43. // Setter and getter for whether EasyUnlock is enabled for ChromeOS login (in
  44. // addition to screen lock).
  45. virtual void SetIsChromeOSLoginEnabled(bool is_enabled) = 0;
  46. virtual bool IsChromeOSLoginEnabled() const = 0;
  47. // Setter and getter for whether the "Signin with Smart Lock is disabled"
  48. // message on the login screen has been shown.
  49. virtual void SetHasShownLoginDisabledMessage(bool has_shown) = 0;
  50. virtual bool HasShownLoginDisabledMessage() const = 0;
  51. };
  52. } // namespace proximity_auth
  53. #endif // ASH_COMPONENTS_PROXIMITY_AUTH_PROXIMITY_AUTH_PREF_MANAGER_H_