unlock_manager.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_UNLOCK_MANAGER_H_
  5. #define ASH_COMPONENTS_PROXIMITY_AUTH_UNLOCK_MANAGER_H_
  6. #include "ash/components/proximity_auth/screenlock_bridge.h"
  7. namespace proximity_auth {
  8. class RemoteDeviceLifeCycle;
  9. // Interface for manager, which controls the lock screen logic.
  10. class UnlockManager {
  11. public:
  12. virtual ~UnlockManager() {}
  13. // Whether proximity-based unlocking is currently allowed. True if any one of
  14. // the remote devices is authenticated and in range.
  15. virtual bool IsUnlockAllowed() = 0;
  16. // Sets the |life_cycle| of the rmeote device to which local events are
  17. // dispatched. A null |life_cycle| indicates that proximity-based
  18. // authentication is inactive.
  19. virtual void SetRemoteDeviceLifeCycle(RemoteDeviceLifeCycle* life_cycle) = 0;
  20. // Called when the user pod is clicked for an authentication attempt of type
  21. // |auth_type|.
  22. // Exposed for testing.
  23. virtual void OnAuthAttempted(mojom::AuthType auth_type) = 0;
  24. // Disable attempts to get RemoteStatus from host devices.
  25. virtual void CancelConnectionAttempt() = 0;
  26. // The last value emitted to the SmartLock.GetRemoteStatus.Unlock(.Failure)
  27. // metrics. Helps to understand whether/why not Smart Lock was an available
  28. // choice for unlock.
  29. virtual std::string GetLastRemoteStatusUnlockForLogging() = 0;
  30. };
  31. } // namespace proximity_auth
  32. #endif // ASH_COMPONENTS_PROXIMITY_AUTH_UNLOCK_MANAGER_H_