Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3380)

Unified Diff: chrome/browser/signin/easy_unlock_service_signin_chromeos.h

Issue 1494153002: This CL replaces e-mail with AccountId in easy signin code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bugfix in original easy unlock code' Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/signin/easy_unlock_service_signin_chromeos.h
diff --git a/chrome/browser/signin/easy_unlock_service_signin_chromeos.h b/chrome/browser/signin/easy_unlock_service_signin_chromeos.h
index 8dd90f36e7c38f0079fad5ce3db37ead568b173d..9496f893d39619008659a33c777626d4d0d09caf 100644
--- a/chrome/browser/signin/easy_unlock_service_signin_chromeos.h
+++ b/chrome/browser/signin/easy_unlock_service_signin_chromeos.h
@@ -31,17 +31,18 @@ class EasyUnlockServiceSignin
explicit EasyUnlockServiceSignin(Profile* profile);
~EasyUnlockServiceSignin() override;
- // Sets |user_id| as the current user of the service. Note this does
+ // Sets |account_id| as the current user of the service. Note this does
// not change the focused user on the login screen.
- void SetCurrentUser(const std::string& user_id);
+ void SetCurrentUser(const AccountId& account_id);
- // Wraps the challenge for the remote device identified by |user_id| and the
+ // Wraps the challenge for the remote device identified by |account_id| and
+ // the
// |device_public_key|. The |channel_binding_data| is signed by the TPM
// included in the wrapped challenge.
// |callback| will be invoked when wrapping is complete. If the user data is
// not loaded yet, then |callback| will be invoked with an empty string.
void WrapChallengeForUserAndDevice(
- const std::string& user_id,
+ const AccountId& account_id,
const std::string& device_public_key,
const std::string& channel_binding_data,
base::Callback<void(const std::string& wraped_challenge)> callback);
@@ -78,7 +79,7 @@ class EasyUnlockServiceSignin
// EasyUnlockService implementation:
EasyUnlockService::Type GetType() const override;
- std::string GetUserEmail() const override;
+ AccountId GetAccountId() const override;
void LaunchSetup() override;
const base::DictionaryValue* GetPermitAccess() const override;
void SetPermitAccess(const base::DictionaryValue& permit) override;
@@ -91,9 +92,9 @@ class EasyUnlockServiceSignin
TurnOffFlowStatus GetTurnOffFlowStatus() const override;
std::string GetChallenge() const override;
std::string GetWrappedSecret() const override;
- void RecordEasySignInOutcome(const std::string& user_id,
+ void RecordEasySignInOutcome(const AccountId& account_id,
bool success) const override;
- void RecordPasswordLoginEvent(const std::string& user_id) const override;
+ void RecordPasswordLoginEvent(const AccountId& account_id) const override;
void StartAutoPairing(const AutoPairingResultCallback& callback) override;
void SetAutoPairingResult(bool success, const std::string& error) override;
void InitializeInternal() override;
@@ -108,7 +109,7 @@ class EasyUnlockServiceSignin
void OnScreenDidUnlock(
proximity_auth::ScreenlockBridge::LockHandler::ScreenType screen_type)
override;
- void OnFocusedUserChanged(const std::string& user_id) override;
+ void OnFocusedUserChanged(const AccountId& account_id) override;
// chromeos::LoginState::Observer implementation:
void LoggedInStateChanged() override;
@@ -118,30 +119,29 @@ class EasyUnlockServiceSignin
void LoadCurrentUserDataIfNeeded();
// Callback invoked when the user's device data is loaded from cryptohome.
- void OnUserDataLoaded(
- const std::string& user_id,
- bool success,
- const chromeos::EasyUnlockDeviceKeyDataList& data);
+ void OnUserDataLoaded(const AccountId& account_id,
+ bool success,
+ const chromeos::EasyUnlockDeviceKeyDataList& data);
// If the device data has been loaded for the current user, returns it.
// Otherwise, returns NULL.
const UserData* FindLoadedDataForCurrentUser() const;
// User id of the user currently associated with the service.
- std::string user_id_;
+ AccountId account_id_;
- // Maps user ids to their fetched cryptohome key data.
- std::map<std::string, UserData*> user_data_;
+ // Maps account ids to their fetched cryptohome key data.
+ std::map<AccountId, UserData*> user_data_;
// Whether failed attempts to load user data should be retried.
// This is to handle case where cryptohome daemon is not started in time the
// service attempts to load some data. Retries will be allowed only until the
// first data load finishes (even if it fails).
- bool allow_cryptohome_backoff_;
+ bool allow_cryptohome_backoff_ = true;
// Whether the service has been successfully initialized, and has not been
// shut down.
- bool service_active_;
+ bool service_active_ = false;
// The timestamp for the most recent time when a user pod was focused.
base::TimeTicks user_pod_last_focused_timestamp_;
« no previous file with comments | « chrome/browser/signin/easy_unlock_service_regular.cc ('k') | chrome/browser/signin/easy_unlock_service_signin_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698