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_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ |
6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ | 6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 virtual void SetAutoPairingResult(bool success, const std::string& error) = 0; | 150 virtual void SetAutoPairingResult(bool success, const std::string& error) = 0; |
151 | 151 |
152 // Sets the service up and schedules service initialization. | 152 // Sets the service up and schedules service initialization. |
153 void Initialize(scoped_ptr<EasyUnlockAppManager> app_manager); | 153 void Initialize(scoped_ptr<EasyUnlockAppManager> app_manager); |
154 | 154 |
155 // Whether easy unlock is allowed to be used. If the controlling preference | 155 // Whether easy unlock is allowed to be used. If the controlling preference |
156 // is set (from policy), this returns the preference value. Otherwise, it is | 156 // is set (from policy), this returns the preference value. Otherwise, it is |
157 // permitted if the flag is enabled. Virtual to allow override for testing. | 157 // permitted if the flag is enabled. Virtual to allow override for testing. |
158 virtual bool IsAllowed() const; | 158 virtual bool IsAllowed() const; |
159 | 159 |
160 // Whether Easy Unlock is currently enabled for this user. | 160 // Whether Easy Unlock is currently enabled for this user. Virtual to allow |
161 bool IsEnabled() const; | 161 // override for testing. |
| 162 virtual bool IsEnabled() const; |
162 | 163 |
163 // Sets the hardlock state for the associated user. | 164 // Sets the hardlock state for the associated user. |
164 void SetHardlockState(EasyUnlockScreenlockStateHandler::HardlockState state); | 165 void SetHardlockState(EasyUnlockScreenlockStateHandler::HardlockState state); |
165 | 166 |
166 // Returns the hardlock state for the associated user. | 167 // Returns the hardlock state for the associated user. |
167 EasyUnlockScreenlockStateHandler::HardlockState GetHardlockState() const; | 168 EasyUnlockScreenlockStateHandler::HardlockState GetHardlockState() const; |
168 | 169 |
169 // Gets the persisted hardlock state. Return true if there is persisted | 170 // Gets the persisted hardlock state. Return true if there is persisted |
170 // hardlock state and the value would be set to |state|. Otherwise, | 171 // hardlock state and the value would be set to |state|. Otherwise, |
171 // returns false and |state| is unchanged. | 172 // returns false and |state| is unchanged. |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 bool tpm_key_checked_; | 375 bool tpm_key_checked_; |
375 | 376 |
376 base::ObserverList<EasyUnlockServiceObserver> observers_; | 377 base::ObserverList<EasyUnlockServiceObserver> observers_; |
377 | 378 |
378 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; | 379 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; |
379 | 380 |
380 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); | 381 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); |
381 }; | 382 }; |
382 | 383 |
383 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ | 384 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ |
OLD | NEW |