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

Unified Diff: chrome/browser/chromeos/login/auth/chrome_login_performer.cc

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/chromeos/login/auth/chrome_login_performer.cc
diff --git a/chrome/browser/chromeos/login/auth/chrome_login_performer.cc b/chrome/browser/chromeos/login/auth/chrome_login_performer.cc
index e912445898288b10383a7b6267ed449bb75b9c89..47353c4606a71fc4ff3535b2813d45a572695d1b 100644
--- a/chrome/browser/chromeos/login/auth/chrome_login_performer.cc
+++ b/chrome/browser/chromeos/login/auth/chrome_login_performer.cc
@@ -84,13 +84,13 @@ void ChromeLoginPerformer::DidRunTrustedCheck(const base::Closure& callback) {
}
}
-bool ChromeLoginPerformer::IsUserWhitelisted(const std::string& user_id,
+bool ChromeLoginPerformer::IsUserWhitelisted(const AccountId& account_id,
bool* wildcard_match) {
- return CrosSettings::IsWhitelisted(user_id, wildcard_match);
+ return CrosSettings::IsWhitelisted(account_id.GetUserEmail(), wildcard_match);
}
void ChromeLoginPerformer::RunOnlineWhitelistCheck(
- const std::string& user_id,
+ const AccountId& account_id,
bool wildcard_match,
const std::string& refresh_token,
const base::Closure& success_callback,
@@ -99,7 +99,7 @@ void ChromeLoginPerformer::RunOnlineWhitelistCheck(
policy::BrowserPolicyConnectorChromeOS* connector =
g_browser_process->platform_part()->browser_policy_connector_chromeos();
if (connector->IsEnterpriseManaged() && wildcard_match &&
- !connector->IsNonEnterpriseUser(user_id)) {
+ !connector->IsNonEnterpriseUser(account_id.GetUserEmail())) {
wildcard_login_checker_.reset(new policy::WildcardLoginChecker());
if (refresh_token.empty()) {
wildcard_login_checker_->StartWithSigninContext(
@@ -143,27 +143,27 @@ UserContext ChromeLoginPerformer::TransformSupervisedKey(
return authentication->TransformKey(context);
}
-void ChromeLoginPerformer::SetupSupervisedUserFlow(const std::string& user_id) {
- SupervisedUserLoginFlow* new_flow = new SupervisedUserLoginFlow(user_id);
- new_flow->SetHost(ChromeUserManager::Get()
- ->GetUserFlow(AccountId::FromUserEmail(user_id))
- ->host());
- ChromeUserManager::Get()->SetUserFlow(AccountId::FromUserEmail(user_id),
- new_flow);
+void ChromeLoginPerformer::SetupSupervisedUserFlow(
+ const AccountId& account_id) {
+ SupervisedUserLoginFlow* new_flow = new SupervisedUserLoginFlow(account_id);
+ new_flow->SetHost(ChromeUserManager::Get()->GetUserFlow(account_id)->host());
+ ChromeUserManager::Get()->SetUserFlow(account_id, new_flow);
}
-void ChromeLoginPerformer::SetupEasyUnlockUserFlow(const std::string& user_id) {
- ChromeUserManager::Get()->SetUserFlow(AccountId::FromUserEmail(user_id),
- new EasyUnlockUserLoginFlow(user_id));
+void ChromeLoginPerformer::SetupEasyUnlockUserFlow(
+ const AccountId& account_id) {
+ ChromeUserManager::Get()->SetUserFlow(
+ account_id, new EasyUnlockUserLoginFlow(account_id));
}
-bool ChromeLoginPerformer::CheckPolicyForUser(const std::string& user_id) {
+bool ChromeLoginPerformer::CheckPolicyForUser(const AccountId& account_id) {
// Login is not allowed if policy could not be loaded for the account.
policy::BrowserPolicyConnectorChromeOS* connector =
g_browser_process->platform_part()->browser_policy_connector_chromeos();
policy::DeviceLocalAccountPolicyService* policy_service =
connector->GetDeviceLocalAccountPolicyService();
- return policy_service && policy_service->IsPolicyAvailableForUser(user_id);
+ return policy_service &&
+ policy_service->IsPolicyAvailableForUser(account_id.GetUserEmail());
}
////////////////////////////////////////////////////////////////////////////////
// ChromeLoginPerformer, private:

Powered by Google App Engine
This is Rietveld 408576698