OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_SIGNIN_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_SIGNIN_CHROMEOS_H_ |
6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_SIGNIN_CHROMEOS_H_ | 6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_SIGNIN_CHROMEOS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_types.h" | 16 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_types.h" |
17 #include "chrome/browser/signin/easy_unlock_service.h" | 17 #include "chrome/browser/signin/easy_unlock_service.h" |
18 #include "chrome/browser/signin/screenlock_bridge.h" | |
19 #include "chromeos/login/login_state.h" | 18 #include "chromeos/login/login_state.h" |
| 19 #include "components/proximity_auth/screenlock_bridge.h" |
20 | 20 |
21 // EasyUnlockService instance that should be used for signin profile. | 21 // EasyUnlockService instance that should be used for signin profile. |
22 class EasyUnlockServiceSignin : public EasyUnlockService, | 22 class EasyUnlockServiceSignin |
23 public ScreenlockBridge::Observer, | 23 : public EasyUnlockService, |
24 public chromeos::LoginState::Observer { | 24 public proximity_auth::ScreenlockBridge::Observer, |
| 25 public chromeos::LoginState::Observer { |
25 public: | 26 public: |
26 explicit EasyUnlockServiceSignin(Profile* profile); | 27 explicit EasyUnlockServiceSignin(Profile* profile); |
27 ~EasyUnlockServiceSignin() override; | 28 ~EasyUnlockServiceSignin() override; |
28 | 29 |
29 // Sets |user_id| as the current user of the service. Note this does | 30 // Sets |user_id| as the current user of the service. Note this does |
30 // not change the focused user on the login screen. | 31 // not change the focused user on the login screen. |
31 void SetCurrentUser(const std::string& user_id); | 32 void SetCurrentUser(const std::string& user_id); |
32 | 33 |
33 private: | 34 private: |
34 // The load state of a user's cryptohome key data. | 35 // The load state of a user's cryptohome key data. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 bool success) const override; | 79 bool success) const override; |
79 void RecordPasswordLoginEvent(const std::string& user_id) const override; | 80 void RecordPasswordLoginEvent(const std::string& user_id) const override; |
80 void StartAutoPairing(const AutoPairingResultCallback& callback) override; | 81 void StartAutoPairing(const AutoPairingResultCallback& callback) override; |
81 void SetAutoPairingResult(bool success, const std::string& error) override; | 82 void SetAutoPairingResult(bool success, const std::string& error) override; |
82 void InitializeInternal() override; | 83 void InitializeInternal() override; |
83 void ShutdownInternal() override; | 84 void ShutdownInternal() override; |
84 bool IsAllowedInternal() const override; | 85 bool IsAllowedInternal() const override; |
85 void OnWillFinalizeUnlock(bool success) override; | 86 void OnWillFinalizeUnlock(bool success) override; |
86 void OnSuspendDone() override; | 87 void OnSuspendDone() override; |
87 | 88 |
88 // ScreenlockBridge::Observer implementation: | 89 // proximity_auth::ScreenlockBridge::Observer implementation: |
89 void OnScreenDidLock( | 90 void OnScreenDidLock(proximity_auth::ScreenlockBridge::LockHandler::ScreenType |
90 ScreenlockBridge::LockHandler::ScreenType screen_type) override; | 91 screen_type) override; |
91 void OnScreenDidUnlock( | 92 void OnScreenDidUnlock( |
92 ScreenlockBridge::LockHandler::ScreenType screen_type) override; | 93 proximity_auth::ScreenlockBridge::LockHandler::ScreenType screen_type) |
| 94 override; |
93 void OnFocusedUserChanged(const std::string& user_id) override; | 95 void OnFocusedUserChanged(const std::string& user_id) override; |
94 | 96 |
95 // chromeos::LoginState::Observer implementation: | 97 // chromeos::LoginState::Observer implementation: |
96 void LoggedInStateChanged() override; | 98 void LoggedInStateChanged() override; |
97 | 99 |
98 // Loads the device data associated with the user's Easy unlock keys from | 100 // Loads the device data associated with the user's Easy unlock keys from |
99 // crypthome. | 101 // crypthome. |
100 void LoadCurrentUserDataIfNeeded(); | 102 void LoadCurrentUserDataIfNeeded(); |
101 | 103 |
102 // Callback invoked when the user's device data is loaded from cryptohome. | 104 // Callback invoked when the user's device data is loaded from cryptohome. |
(...skipping 24 matching lines...) Expand all Loading... |
127 | 129 |
128 // The timestamp for the most recent time when a user pod was focused. | 130 // The timestamp for the most recent time when a user pod was focused. |
129 base::TimeTicks user_pod_last_focused_timestamp_; | 131 base::TimeTicks user_pod_last_focused_timestamp_; |
130 | 132 |
131 base::WeakPtrFactory<EasyUnlockServiceSignin> weak_ptr_factory_; | 133 base::WeakPtrFactory<EasyUnlockServiceSignin> weak_ptr_factory_; |
132 | 134 |
133 DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceSignin); | 135 DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceSignin); |
134 }; | 136 }; |
135 | 137 |
136 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_SIGNIN_CHROMEOS_H_ | 138 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_SIGNIN_CHROMEOS_H_ |
OLD | NEW |