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

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

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 79687410e34c61230cb660958c6dfd10d947eee2..56a6d03393bd531f3307092e4734f2c9cfd526e3 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
@@ -136,16 +136,16 @@ 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();
+ const user_manager::UserID& user_id = user->GetUserID();
if (!user->HasGaiaAccount() ||
user->IsSupervised() ||
- BrowserPolicyConnector::IsNonEnterpriseUser(username)) {
+ BrowserPolicyConnector::IsNonEnterpriseUser(user_id)) {
return scoped_ptr<UserCloudPolicyManagerChromeOS>();
}
policy::BrowserPolicyConnectorChromeOS* connector =
g_browser_process->platform_part()->browser_policy_connector_chromeos();
- UserAffiliation affiliation = connector->GetUserAffiliation(username);
+ UserAffiliation affiliation = connector->GetUserAffiliation(user_id);
const bool is_affiliated_user = affiliation == USER_AFFILIATION_MANAGED;
const bool is_browser_restart =
command_line->HasSwitch(chromeos::switches::kLoginUser);
@@ -180,7 +180,7 @@ scoped_ptr<UserCloudPolicyManagerChromeOS>
chromeos::DBusThreadManager::Get()->GetCryptohomeClient(),
chromeos::DBusThreadManager::Get()->GetSessionManagerClient(),
background_task_runner,
- username, policy_key_dir, token_cache_file, policy_cache_file));
+ user_id, policy_key_dir, token_cache_file, policy_cache_file));
scoped_refptr<base::SequencedTaskRunner> backend_task_runner =
content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
@@ -210,9 +210,9 @@ 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(user_id, &wildcard_match) &&
+ wildcard_match && !connector->IsNonEnterpriseUser(user_id)) {
+ manager->EnableWildcardLoginCheck(user_id);
}
manager->Init(

Powered by Google App Engine
This is Rietveld 408576698