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

Side by Side Diff: chrome/browser/policy/profile_policy_connector.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/policy/profile_policy_connector.h" 5 #include "chrome/browser/policy/profile_policy_connector.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 if (!user) { 103 if (!user) {
104 DCHECK(schema_registry); 104 DCHECK(schema_registry);
105 // This case occurs for the signin profile. 105 // This case occurs for the signin profile.
106 special_user_policy_provider_.reset( 106 special_user_policy_provider_.reset(
107 new LoginProfilePolicyProvider(connector->GetPolicyService())); 107 new LoginProfilePolicyProvider(connector->GetPolicyService()));
108 } else { 108 } else {
109 // |user| should never be NULL except for the signin profile. 109 // |user| should never be NULL except for the signin profile.
110 is_primary_user_ = 110 is_primary_user_ =
111 user == user_manager::UserManager::Get()->GetPrimaryUser(); 111 user == user_manager::UserManager::Get()->GetPrimaryUser();
112 special_user_policy_provider_ = DeviceLocalAccountPolicyProvider::Create( 112 special_user_policy_provider_ = DeviceLocalAccountPolicyProvider::Create(
113 user->email(), 113 user->GetUserID(),
114 connector->GetDeviceLocalAccountPolicyService()); 114 connector->GetDeviceLocalAccountPolicyService());
115 } 115 }
116 if (special_user_policy_provider_) { 116 if (special_user_policy_provider_) {
117 special_user_policy_provider_->Init(schema_registry); 117 special_user_policy_provider_->Init(schema_registry);
118 providers.push_back(special_user_policy_provider_.get()); 118 providers.push_back(special_user_policy_provider_.get());
119 } 119 }
120 #endif 120 #endif
121 121
122 policy_service_.reset(new PolicyServiceImpl(providers)); 122 policy_service_.reset(new PolicyServiceImpl(providers));
123 123
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 BrowserPolicyConnectorChromeOS* connector = 176 BrowserPolicyConnectorChromeOS* connector =
177 g_browser_process->platform_part()->browser_policy_connector_chromeos(); 177 g_browser_process->platform_part()->browser_policy_connector_chromeos();
178 if (HasChromePolicy(connector->GetDeviceCloudPolicyManager(), name)) 178 if (HasChromePolicy(connector->GetDeviceCloudPolicyManager(), name))
179 return false; 179 return false;
180 #endif 180 #endif
181 181
182 return true; 182 return true;
183 } 183 }
184 184
185 } // namespace policy 185 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698