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_REGULAR_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_ |
6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_ | 6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 | 26 |
27 namespace cryptauth { | 27 namespace cryptauth { |
28 class ToggleEasyUnlockResponse; | 28 class ToggleEasyUnlockResponse; |
29 } | 29 } |
30 | 30 |
31 namespace proximity_auth { | 31 namespace proximity_auth { |
32 class CryptAuthClient; | 32 class CryptAuthClient; |
33 } | 33 } |
34 | 34 |
| 35 namespace user_manager { |
| 36 class UserID; |
| 37 } |
| 38 |
35 class EasyUnlockAppManager; | 39 class EasyUnlockAppManager; |
36 class EasyUnlockToggleFlow; | 40 class EasyUnlockToggleFlow; |
37 class Profile; | 41 class Profile; |
38 | 42 |
39 // EasyUnlockService instance that should be used for regular, non-signin | 43 // EasyUnlockService instance that should be used for regular, non-signin |
40 // profiles. | 44 // profiles. |
41 class EasyUnlockServiceRegular | 45 class EasyUnlockServiceRegular |
42 : public EasyUnlockService, | 46 : public EasyUnlockService, |
43 public proximity_auth::ScreenlockBridge::Observer { | 47 public proximity_auth::ScreenlockBridge::Observer { |
44 public: | 48 public: |
45 explicit EasyUnlockServiceRegular(Profile* profile); | 49 explicit EasyUnlockServiceRegular(Profile* profile); |
46 ~EasyUnlockServiceRegular() override; | 50 ~EasyUnlockServiceRegular() override; |
47 | 51 |
48 private: | 52 private: |
49 // EasyUnlockService implementation: | 53 // EasyUnlockService implementation: |
50 EasyUnlockService::Type GetType() const override; | 54 EasyUnlockService::Type GetType() const override; |
51 std::string GetUserEmail() const override; | 55 user_manager::UserID GetUserID() const override; |
52 void LaunchSetup() override; | 56 void LaunchSetup() override; |
53 const base::DictionaryValue* GetPermitAccess() const override; | 57 const base::DictionaryValue* GetPermitAccess() const override; |
54 void SetPermitAccess(const base::DictionaryValue& permit) override; | 58 void SetPermitAccess(const base::DictionaryValue& permit) override; |
55 void ClearPermitAccess() override; | 59 void ClearPermitAccess() override; |
56 const base::ListValue* GetRemoteDevices() const override; | 60 const base::ListValue* GetRemoteDevices() const override; |
57 void SetRemoteDevices(const base::ListValue& devices) override; | 61 void SetRemoteDevices(const base::ListValue& devices) override; |
58 void RunTurnOffFlow() override; | 62 void RunTurnOffFlow() override; |
59 void ResetTurnOffFlow() override; | 63 void ResetTurnOffFlow() override; |
60 TurnOffFlowStatus GetTurnOffFlowStatus() const override; | 64 TurnOffFlowStatus GetTurnOffFlowStatus() const override; |
61 std::string GetChallenge() const override; | 65 std::string GetChallenge() const override; |
62 std::string GetWrappedSecret() const override; | 66 std::string GetWrappedSecret() const override; |
63 void RecordEasySignInOutcome(const std::string& user_id, | 67 void RecordEasySignInOutcome(const user_manager::UserID& user_id, |
64 bool success) const override; | 68 bool success) const override; |
65 void RecordPasswordLoginEvent(const std::string& user_id) const override; | 69 void RecordPasswordLoginEvent(const user_manager::UserID& user_id) const overr
ide; |
66 void StartAutoPairing(const AutoPairingResultCallback& callback) override; | 70 void StartAutoPairing(const AutoPairingResultCallback& callback) override; |
67 void SetAutoPairingResult(bool success, const std::string& error) override; | 71 void SetAutoPairingResult(bool success, const std::string& error) override; |
68 void InitializeInternal() override; | 72 void InitializeInternal() override; |
69 void ShutdownInternal() override; | 73 void ShutdownInternal() override; |
70 bool IsAllowedInternal() const override; | 74 bool IsAllowedInternal() const override; |
71 void OnWillFinalizeUnlock(bool success) override; | 75 void OnWillFinalizeUnlock(bool success) override; |
72 void OnSuspendDone() override; | 76 void OnSuspendDone() override; |
73 | 77 |
74 // proximity_auth::ScreenlockBridge::Observer implementation: | 78 // proximity_auth::ScreenlockBridge::Observer implementation: |
75 void OnScreenDidLock(proximity_auth::ScreenlockBridge::LockHandler::ScreenType | 79 void OnScreenDidLock(proximity_auth::ScreenlockBridge::LockHandler::ScreenType |
76 screen_type) override; | 80 screen_type) override; |
77 void OnScreenDidUnlock( | 81 void OnScreenDidUnlock( |
78 proximity_auth::ScreenlockBridge::LockHandler::ScreenType screen_type) | 82 proximity_auth::ScreenlockBridge::LockHandler::ScreenType screen_type) |
79 override; | 83 override; |
80 void OnFocusedUserChanged(const std::string& user_id) override; | 84 void OnFocusedUserChanged(const user_manager::UserID& user_id) override; |
81 | 85 |
| 86 // Returns email of the user currently associated with the service. |
| 87 std::string GetUserEmail() const; |
82 | 88 |
83 // Callback when the controlling pref changes. | 89 // Callback when the controlling pref changes. |
84 void OnPrefsChanged(); | 90 void OnPrefsChanged(); |
85 | 91 |
86 // Sets the new turn-off flow status. | 92 // Sets the new turn-off flow status. |
87 void SetTurnOffFlowStatus(TurnOffFlowStatus status); | 93 void SetTurnOffFlowStatus(TurnOffFlowStatus status); |
88 | 94 |
89 // Callback for ToggleEasyUnlock CryptAuth API. | 95 // Callback for ToggleEasyUnlock CryptAuth API. |
90 void OnToggleEasyUnlockApiComplete( | 96 void OnToggleEasyUnlockApiComplete( |
91 const cryptauth::ToggleEasyUnlockResponse& response); | 97 const cryptauth::ToggleEasyUnlockResponse& response); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // sleep -- e.g. by opening the lid -- but can also be shown if the screen is | 132 // sleep -- e.g. by opening the lid -- but can also be shown if the screen is |
127 // locked but the computer does not go to sleep. | 133 // locked but the computer does not go to sleep. |
128 base::TimeTicks lock_screen_last_shown_timestamp_; | 134 base::TimeTicks lock_screen_last_shown_timestamp_; |
129 | 135 |
130 base::WeakPtrFactory<EasyUnlockServiceRegular> weak_ptr_factory_; | 136 base::WeakPtrFactory<EasyUnlockServiceRegular> weak_ptr_factory_; |
131 | 137 |
132 DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceRegular); | 138 DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceRegular); |
133 }; | 139 }; |
134 | 140 |
135 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_ | 141 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_REGULAR_H_ |
OLD | NEW |