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

Unified Diff: chrome/browser/signin/easy_unlock_service.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.h
diff --git a/chrome/browser/signin/easy_unlock_service.h b/chrome/browser/signin/easy_unlock_service.h
index e57590f2912dab78d2816ab223fdab0afe72d969..6910d99194c48272a089796a91ba3d86cec10896 100644
--- a/chrome/browser/signin/easy_unlock_service.h
+++ b/chrome/browser/signin/easy_unlock_service.h
@@ -25,6 +25,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 AccountId GetAccountId() const = 0;
// 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,
@@ -297,9 +299,9 @@ class EasyUnlockService : public KeyedService {
EasyUnlockAuthEvent GetPasswordAuthEvent() const;
// Called by subclasses when remote devices allowed to unlock the screen
- // are loaded for |user_id|.
+ // are loaded for |account_id|.
void SetProximityAuthDevices(
- const std::string& user_id,
+ const AccountId& account_id,
const proximity_auth::RemoteDeviceList& remote_devices);
private:
@@ -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);
« no previous file with comments | « chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc ('k') | chrome/browser/signin/easy_unlock_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698