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/easy_unlock_auth_attempt.h" | 16 #include "chrome/browser/signin/easy_unlock_auth_attempt.h" |
17 #include "chrome/browser/signin/easy_unlock_metrics.h" | 17 #include "chrome/browser/signin/easy_unlock_metrics.h" |
18 #include "chrome/browser/signin/easy_unlock_screenlock_state_handler.h" | 18 #include "chrome/browser/signin/easy_unlock_screenlock_state_handler.h" |
19 #include "components/keyed_service/core/keyed_service.h" | 19 #include "components/keyed_service/core/keyed_service.h" |
| 20 #include "components/proximity_auth/screenlock_state.h" |
20 | 21 |
21 #if defined(OS_CHROMEOS) | 22 #if defined(OS_CHROMEOS) |
22 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_types.h" | 23 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_types.h" |
23 #endif | 24 #endif |
24 | 25 |
25 namespace base { | 26 namespace base { |
26 class DictionaryValue; | 27 class DictionaryValue; |
27 class ListValue; | 28 class ListValue; |
28 } | 29 } |
29 | 30 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // returns false and |state| is unchanged. | 167 // returns false and |state| is unchanged. |
167 bool GetPersistedHardlockState( | 168 bool GetPersistedHardlockState( |
168 EasyUnlockScreenlockStateHandler::HardlockState* state) const; | 169 EasyUnlockScreenlockStateHandler::HardlockState* state) const; |
169 | 170 |
170 // Shows the hardlock or connecting state as initial UI before cryptohome | 171 // Shows the hardlock or connecting state as initial UI before cryptohome |
171 // keys checking and state update from the app. | 172 // keys checking and state update from the app. |
172 void ShowInitialUserState(); | 173 void ShowInitialUserState(); |
173 | 174 |
174 // Updates the user pod on the signin/lock screen for the user associated with | 175 // Updates the user pod on the signin/lock screen for the user associated with |
175 // the service to reflect the provided screenlock state. | 176 // the service to reflect the provided screenlock state. |
176 bool UpdateScreenlockState(EasyUnlockScreenlockStateHandler::State state); | 177 bool UpdateScreenlockState(proximity_auth::ScreenlockState state); |
177 | 178 |
178 // Returns the screenlock state if it is available. Otherwise STATE_INACTIVE | 179 // Returns the screenlock state if it is available. Otherwise STATE_INACTIVE |
179 // is returned. | 180 // is returned. |
180 EasyUnlockScreenlockStateHandler::State GetScreenlockState(); | 181 proximity_auth::ScreenlockState GetScreenlockState(); |
181 | 182 |
182 // Starts an auth attempt for the user associated with the service. The | 183 // Starts an auth attempt for the user associated with the service. The |
183 // attempt type (unlock vs. signin) will depend on the service type. | 184 // attempt type (unlock vs. signin) will depend on the service type. |
184 void AttemptAuth(const std::string& user_id); | 185 void AttemptAuth(const std::string& user_id); |
185 | 186 |
186 // Similar to above but a callback is invoked after the auth attempt is | 187 // Similar to above but a callback is invoked after the auth attempt is |
187 // finalized instead of default unlock/sign-in. | 188 // finalized instead of default unlock/sign-in. |
188 typedef EasyUnlockAuthAttempt::FinalizedCallback AttemptAuthCallback; | 189 typedef EasyUnlockAuthAttempt::FinalizedCallback AttemptAuthCallback; |
189 void AttemptAuth(const std::string& user_id, | 190 void AttemptAuth(const std::string& user_id, |
190 const AttemptAuthCallback& callback); | 191 const AttemptAuthCallback& callback); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 bool tpm_key_checked_; | 351 bool tpm_key_checked_; |
351 | 352 |
352 ObserverList<EasyUnlockServiceObserver> observers_; | 353 ObserverList<EasyUnlockServiceObserver> observers_; |
353 | 354 |
354 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; | 355 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; |
355 | 356 |
356 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); | 357 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); |
357 }; | 358 }; |
358 | 359 |
359 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ | 360 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ |
OLD | NEW |