| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 void ResetScreenlockState(); | 208 void ResetScreenlockState(); |
| 209 | 209 |
| 210 // Updates |screenlock_state_handler_|'s hardlocked state. | 210 // Updates |screenlock_state_handler_|'s hardlocked state. |
| 211 void SetScreenlockHardlockedState( | 211 void SetScreenlockHardlockedState( |
| 212 EasyUnlockScreenlockStateHandler::HardlockState state); | 212 EasyUnlockScreenlockStateHandler::HardlockState state); |
| 213 | 213 |
| 214 const EasyUnlockScreenlockStateHandler* screenlock_state_handler() const { | 214 const EasyUnlockScreenlockStateHandler* screenlock_state_handler() const { |
| 215 return screenlock_state_handler_.get(); | 215 return screenlock_state_handler_.get(); |
| 216 } | 216 } |
| 217 | 217 |
| 218 // Saves hardlock state for the given user. Update UI if the currently |
| 219 // associated user is the same. |
| 220 void SetHardlockStateForUser( |
| 221 const std::string& user_id, |
| 222 EasyUnlockScreenlockStateHandler::HardlockState state); |
| 223 |
| 218 private: | 224 private: |
| 219 // A class to detect whether a bluetooth adapter is present. | 225 // A class to detect whether a bluetooth adapter is present. |
| 220 class BluetoothDetector; | 226 class BluetoothDetector; |
| 221 | 227 |
| 222 // Initializes the service after ExtensionService is ready. | 228 // Initializes the service after ExtensionService is ready. |
| 223 void Initialize(); | 229 void Initialize(); |
| 224 | 230 |
| 225 // Gets |screenlock_state_handler_|. Returns NULL if Easy Unlock is not | 231 // Gets |screenlock_state_handler_|. Returns NULL if Easy Unlock is not |
| 226 // allowed. Otherwise, if |screenlock_state_handler_| is not set, an instance | 232 // allowed. Otherwise, if |screenlock_state_handler_| is not set, an instance |
| 227 // is created. Do not cache the returned value, as it may go away if Easy | 233 // is created. Do not cache the returned value, as it may go away if Easy |
| 228 // Unlock gets disabled. | 234 // Unlock gets disabled. |
| 229 EasyUnlockScreenlockStateHandler* GetScreenlockStateHandler(); | 235 EasyUnlockScreenlockStateHandler* GetScreenlockStateHandler(); |
| 230 | 236 |
| 231 // Callback when Bluetooth adapter present state changes. | 237 // Callback when Bluetooth adapter present state changes. |
| 232 void OnBluetoothAdapterPresentChanged(); | 238 void OnBluetoothAdapterPresentChanged(); |
| 233 | 239 |
| 234 // Saves hardlock state for the given user. Update UI if the currently | |
| 235 // associated user is the same. | |
| 236 void SetHardlockStateForUser( | |
| 237 const std::string& user_id, | |
| 238 EasyUnlockScreenlockStateHandler::HardlockState state); | |
| 239 | |
| 240 #if defined(OS_CHROMEOS) | 240 #if defined(OS_CHROMEOS) |
| 241 // Callback for get key operation from CheckCryptohomeKeysAndMaybeHardlock. | 241 // Callback for get key operation from CheckCryptohomeKeysAndMaybeHardlock. |
| 242 void OnCryptohomeKeysFetchedForChecking( | 242 void OnCryptohomeKeysFetchedForChecking( |
| 243 const std::string& user_id, | 243 const std::string& user_id, |
| 244 const std::set<std::string> paired_devices, | 244 const std::set<std::string> paired_devices, |
| 245 bool success, | 245 bool success, |
| 246 const chromeos::EasyUnlockDeviceKeyDataList& key_data_list); | 246 const chromeos::EasyUnlockDeviceKeyDataList& key_data_list); |
| 247 #endif | 247 #endif |
| 248 | 248 |
| 249 // Updates the service to state for handling system suspend. | 249 // Updates the service to state for handling system suspend. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 270 bool shut_down_; | 270 bool shut_down_; |
| 271 | 271 |
| 272 ObserverList<EasyUnlockServiceObserver> observers_; | 272 ObserverList<EasyUnlockServiceObserver> observers_; |
| 273 | 273 |
| 274 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; | 274 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; |
| 275 | 275 |
| 276 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); | 276 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); |
| 277 }; | 277 }; |
| 278 | 278 |
| 279 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ | 279 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ |
| OLD | NEW |