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

Unified Diff: chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc

Issue 1693383003: ChromeOS cryptohome should be able to use gaia id as user identifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit tests. Created 4 years, 10 months 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/policy/user_cloud_policy_manager_factory_chromeos.cc
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc
index 7695acf10fe0e0746f95c5372417f2a38eb993e7..a9c854686731ff49bd91faa35d82a1291c80339d 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc
@@ -138,10 +138,9 @@ scoped_ptr<UserCloudPolicyManagerChromeOS>
// - For device-local accounts, policy is provided by
// |DeviceLocalAccountPolicyService|.
// All other user types do not have user policy.
- const std::string& username = user->email();
- if (!user->HasGaiaAccount() ||
- user->IsSupervised() ||
- BrowserPolicyConnector::IsNonEnterpriseUser(username)) {
+ const AccountId account_id = user->GetAccountId();
+ if (!user->HasGaiaAccount() || user->IsSupervised() ||
+ BrowserPolicyConnector::IsNonEnterpriseUser(account_id.GetUserEmail())) {
return scoped_ptr<UserCloudPolicyManagerChromeOS>();
}
@@ -195,8 +194,8 @@ scoped_ptr<UserCloudPolicyManagerChromeOS>
new UserCloudPolicyStoreChromeOS(
chromeos::DBusThreadManager::Get()->GetCryptohomeClient(),
chromeos::DBusThreadManager::Get()->GetSessionManagerClient(),
- background_task_runner,
- username, policy_key_dir, token_cache_file, policy_cache_file));
+ background_task_runner, account_id, policy_key_dir, token_cache_file,
+ policy_cache_file));
scoped_refptr<base::SequencedTaskRunner> backend_task_runner =
content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
@@ -226,9 +225,11 @@ scoped_ptr<UserCloudPolicyManagerChromeOS>
bool wildcard_match = false;
if (connector->IsEnterpriseManaged() &&
- chromeos::CrosSettings::IsWhitelisted(username, &wildcard_match) &&
- wildcard_match && !connector->IsNonEnterpriseUser(username)) {
- manager->EnableWildcardLoginCheck(username);
+ chromeos::CrosSettings::IsWhitelisted(account_id.GetUserEmail(),
+ &wildcard_match) &&
+ wildcard_match &&
+ !connector->IsNonEnterpriseUser(account_id.GetUserEmail())) {
+ manager->EnableWildcardLoginCheck(account_id.GetUserEmail());
}
manager->Init(

Powered by Google App Engine
This is Rietveld 408576698