Chromium Code Reviews| Index: chrome/browser/signin/easy_unlock_service.h |
| diff --git a/chrome/browser/signin/easy_unlock_service.h b/chrome/browser/signin/easy_unlock_service.h |
| index 240a5f887df9ea1e5b4e710be1d8fa4f939eb9bf..a4822e8f6c640ac66f3544b8a5f4c08f6f4b7ca5 100644 |
| --- a/chrome/browser/signin/easy_unlock_service.h |
| +++ b/chrome/browser/signin/easy_unlock_service.h |
| @@ -24,6 +24,8 @@ |
| #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_types.h" |
| #endif |
| +class AccountId; |
| + |
| namespace base { |
| class DictionaryValue; |
| class ListValue; |
| @@ -85,10 +87,10 @@ class EasyUnlockService : public KeyedService { |
| static void RegisterPrefs(PrefRegistrySimple* registry); |
| // Removes the hardlock state for the given user. |
| - static void ResetLocalStateForUser(const std::string& user_id); |
| + static void ResetLocalStateForUser(const AccountId& account_id); |
| // Returns the user's preferences. |
| - static UserSettings GetUserSettings(const std::string& user_id); |
| + static UserSettings GetUserSettings(const AccountId& account_id); |
| // Returns the identifier for the device. |
| static std::string GetDeviceId(); |
| @@ -97,7 +99,7 @@ class EasyUnlockService : public KeyedService { |
| virtual Type GetType() const = 0; |
| // Returns the user currently associated with the service. |
| - virtual std::string GetUserEmail() const = 0; |
| + virtual const AccountId GetAccountId() const = 0; |
|
achuithb
2015/12/04 10:12:53
AccountId? Don't think const makes sense unless it
Alexander Alekseev
2015/12/04 12:44:06
Done.
It should be a constant reference, but it i
|
| // Launches Easy Unlock setup app. |
| virtual void LaunchSetup() = 0; |
| @@ -132,11 +134,11 @@ class EasyUnlockService : public KeyedService { |
| virtual std::string GetWrappedSecret() const = 0; |
| // Records metrics for Easy sign-in outcome for the given user. |
| - virtual void RecordEasySignInOutcome(const std::string& user_id, |
| + virtual void RecordEasySignInOutcome(const AccountId& account_id, |
| bool success) const = 0; |
| // Records metrics for password based flow for the given user. |
| - virtual void RecordPasswordLoginEvent(const std::string& user_id) const = 0; |
| + virtual void RecordPasswordLoginEvent(const AccountId& account_id) const = 0; |
| // Starts auto pairing. |
| typedef base::Callback<void(bool success, const std::string& error)> |
| @@ -183,12 +185,12 @@ class EasyUnlockService : public KeyedService { |
| // Starts an auth attempt for the user associated with the service. The |
| // attempt type (unlock vs. signin) will depend on the service type. |
| - void AttemptAuth(const std::string& user_id); |
| + void AttemptAuth(const AccountId& account_id); |
| // Similar to above but a callback is invoked after the auth attempt is |
| // finalized instead of default unlock/sign-in. |
| typedef EasyUnlockAuthAttempt::FinalizedCallback AttemptAuthCallback; |
| - void AttemptAuth(const std::string& user_id, |
| + void AttemptAuth(const AccountId& account_id, |
| const AttemptAuthCallback& callback); |
| // Finalizes the previously started auth attempt for easy unlock. If called on |
| @@ -202,7 +204,7 @@ class EasyUnlockService : public KeyedService { |
| void FinalizeSignin(const std::string& secret); |
| // Handles Easy Unlock auth failure for the user. |
| - void HandleAuthFailure(const std::string& user_id); |
| + void HandleAuthFailure(const AccountId& account_id); |
| // Checks the consistency between pairing data and cryptohome keys. Set |
| // hardlock state if the two do not match. |
| @@ -289,7 +291,7 @@ class EasyUnlockService : public KeyedService { |
| // Saves hardlock state for the given user. Update UI if the currently |
| // associated user is the same. |
| void SetHardlockStateForUser( |
| - const std::string& user_id, |
| + const AccountId& account_id, |
| EasyUnlockScreenlockStateHandler::HardlockState state); |
| // Returns the authentication event for a recent password sign-in or unlock, |
| @@ -321,7 +323,7 @@ class EasyUnlockService : public KeyedService { |
| #if defined(OS_CHROMEOS) |
| // Callback for get key operation from CheckCryptohomeKeysAndMaybeHardlock. |
| void OnCryptohomeKeysFetchedForChecking( |
| - const std::string& user_id, |
| + const AccountId& account_id, |
| const std::set<std::string> paired_devices, |
| bool success, |
| const chromeos::EasyUnlockDeviceKeyDataList& key_data_list); |