fake_lock_handler.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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_FAKE_LOCK_HANDLER_H_
  5. #define ASH_COMPONENTS_PROXIMITY_AUTH_FAKE_LOCK_HANDLER_H_
  6. #include "ash/components/proximity_auth/screenlock_bridge.h"
  7. namespace proximity_auth {
  8. class FakeLockHandler : public ScreenlockBridge::LockHandler {
  9. public:
  10. FakeLockHandler();
  11. FakeLockHandler(const FakeLockHandler&) = delete;
  12. FakeLockHandler& operator=(const FakeLockHandler&) = delete;
  13. ~FakeLockHandler() override;
  14. // LockHandler:
  15. void ShowBannerMessage(const std::u16string& message,
  16. bool is_warning) override;
  17. void ShowUserPodCustomIcon(
  18. const AccountId& account_id,
  19. const ScreenlockBridge::UserPodCustomIconInfo& icon_info) override;
  20. void HideUserPodCustomIcon(const AccountId& account_id) override;
  21. void SetSmartLockState(const AccountId& account_id,
  22. ash::SmartLockState state) override;
  23. void NotifySmartLockAuthResult(const AccountId& account_id,
  24. bool successful) override;
  25. void EnableInput() override;
  26. void SetAuthType(const AccountId& account_id,
  27. mojom::AuthType auth_type,
  28. const std::u16string& auth_value) override;
  29. mojom::AuthType GetAuthType(const AccountId& account_id) const override;
  30. ScreenType GetScreenType() const override;
  31. void Unlock(const AccountId& account_id) override;
  32. void AttemptEasySignin(const AccountId& account_id,
  33. const std::string& secret,
  34. const std::string& key_label) override;
  35. absl::optional<ash::SmartLockState> smart_lock_state() const {
  36. return smart_lock_state_;
  37. }
  38. absl::optional<bool> smart_lock_auth_result() const {
  39. return smart_lock_auth_result_;
  40. }
  41. int unlock_called() const { return unlock_called_; }
  42. void ClearSmartLockState();
  43. void ClearSmartLockAuthResult();
  44. private:
  45. absl::optional<ash::SmartLockState> smart_lock_state_;
  46. absl::optional<bool> smart_lock_auth_result_;
  47. mojom::AuthType latest_set_auth_type_ = mojom::AuthType::USER_CLICK;
  48. int unlock_called_ = 0;
  49. };
  50. } // namespace proximity_auth
  51. #endif // ASH_COMPONENTS_PROXIMITY_AUTH_FAKE_LOCK_HANDLER_H_