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 |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "chrome/browser/signin/chrome_proximity_auth_client.h" |
16 #include "chrome/browser/signin/easy_unlock_auth_attempt.h" | 17 #include "chrome/browser/signin/easy_unlock_auth_attempt.h" |
17 #include "chrome/browser/signin/easy_unlock_metrics.h" | 18 #include "chrome/browser/signin/easy_unlock_metrics.h" |
18 #include "chrome/browser/signin/easy_unlock_screenlock_state_handler.h" | 19 #include "chrome/browser/signin/easy_unlock_screenlock_state_handler.h" |
19 #include "components/keyed_service/core/keyed_service.h" | 20 #include "components/keyed_service/core/keyed_service.h" |
20 #include "components/proximity_auth/screenlock_state.h" | 21 #include "components/proximity_auth/screenlock_state.h" |
21 #include "components/proximity_auth/webui/proximity_auth_ui_delegate.h" | 22 #include "components/proximity_auth/webui/proximity_auth_ui_delegate.h" |
22 | 23 |
23 #if defined(OS_CHROMEOS) | 24 #if defined(OS_CHROMEOS) |
24 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_types.h" | 25 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_types.h" |
25 #endif | 26 #endif |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 void RecordClickOnLockIcon(); | 219 void RecordClickOnLockIcon(); |
219 | 220 |
220 void AddObserver(EasyUnlockServiceObserver* observer); | 221 void AddObserver(EasyUnlockServiceObserver* observer); |
221 void RemoveObserver(EasyUnlockServiceObserver* observer); | 222 void RemoveObserver(EasyUnlockServiceObserver* observer); |
222 | 223 |
223 // ProximityAuthUIDelegate: | 224 // ProximityAuthUIDelegate: |
224 scoped_ptr<proximity_auth::CryptAuthClientFactory> | 225 scoped_ptr<proximity_auth::CryptAuthClientFactory> |
225 CreateCryptAuthClientFactory() override; | 226 CreateCryptAuthClientFactory() override; |
226 cryptauth::DeviceClassifier GetDeviceClassifier() override; | 227 cryptauth::DeviceClassifier GetDeviceClassifier() override; |
227 | 228 |
| 229 ChromeProximityAuthClient* proximity_auth_client() { |
| 230 return &proximity_auth_client_; |
| 231 } |
| 232 |
228 protected: | 233 protected: |
229 explicit EasyUnlockService(Profile* profile); | 234 explicit EasyUnlockService(Profile* profile); |
230 ~EasyUnlockService() override; | 235 ~EasyUnlockService() override; |
231 | 236 |
232 // Does a service type specific initialization. | 237 // Does a service type specific initialization. |
233 virtual void InitializeInternal() = 0; | 238 virtual void InitializeInternal() = 0; |
234 | 239 |
235 // Does a service type specific shutdown. Called from |Shutdown|. | 240 // Does a service type specific shutdown. Called from |Shutdown|. |
236 virtual void ShutdownInternal() = 0; | 241 virtual void ShutdownInternal() = 0; |
237 | 242 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 const std::set<std::string> paired_devices, | 326 const std::set<std::string> paired_devices, |
322 bool success, | 327 bool success, |
323 const chromeos::EasyUnlockDeviceKeyDataList& key_data_list); | 328 const chromeos::EasyUnlockDeviceKeyDataList& key_data_list); |
324 #endif | 329 #endif |
325 | 330 |
326 // Updates the service to state for handling system suspend. | 331 // Updates the service to state for handling system suspend. |
327 void PrepareForSuspend(); | 332 void PrepareForSuspend(); |
328 | 333 |
329 void EnsureTpmKeyPresentIfNeeded(); | 334 void EnsureTpmKeyPresentIfNeeded(); |
330 | 335 |
331 Profile* profile_; | 336 Profile* const profile_; |
| 337 |
| 338 ChromeProximityAuthClient proximity_auth_client_; |
332 | 339 |
333 scoped_ptr<EasyUnlockAppManager> app_manager_; | 340 scoped_ptr<EasyUnlockAppManager> app_manager_; |
334 | 341 |
335 // Created lazily in |GetScreenlockStateHandler|. | 342 // Created lazily in |GetScreenlockStateHandler|. |
336 scoped_ptr<EasyUnlockScreenlockStateHandler> screenlock_state_handler_; | 343 scoped_ptr<EasyUnlockScreenlockStateHandler> screenlock_state_handler_; |
337 | 344 |
338 // The handler for the current auth attempt. Set iff an auth attempt is in | 345 // The handler for the current auth attempt. Set iff an auth attempt is in |
339 // progress. | 346 // progress. |
340 scoped_ptr<EasyUnlockAuthAttempt> auth_attempt_; | 347 scoped_ptr<EasyUnlockAuthAttempt> auth_attempt_; |
341 | 348 |
(...skipping 16 matching lines...) Expand all Loading... |
358 bool tpm_key_checked_; | 365 bool tpm_key_checked_; |
359 | 366 |
360 base::ObserverList<EasyUnlockServiceObserver> observers_; | 367 base::ObserverList<EasyUnlockServiceObserver> observers_; |
361 | 368 |
362 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; | 369 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; |
363 | 370 |
364 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); | 371 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); |
365 }; | 372 }; |
366 | 373 |
367 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ | 374 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ |
OLD | NEW |