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

Side by Side Diff: chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc

Issue 2486813002: Add DeviceADPolicyManager to provide AD policy. (Closed)
Patch Set: Address Bernhard's comments Created 4 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chromeos/login/users/chrome_user_manager_impl.h" 5 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cstddef> 9 #include <cstddef>
10 #include <set> 10 #include <set>
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 weak_factory_.GetWeakPtr())); 212 weak_factory_.GetWeakPtr()));
213 } 213 }
214 214
215 local_accounts_subscription_ = cros_settings_->AddSettingsObserver( 215 local_accounts_subscription_ = cros_settings_->AddSettingsObserver(
216 kAccountsPrefDeviceLocalAccounts, 216 kAccountsPrefDeviceLocalAccounts,
217 base::Bind(&ChromeUserManagerImpl::RetrieveTrustedDevicePolicies, 217 base::Bind(&ChromeUserManagerImpl::RetrieveTrustedDevicePolicies,
218 weak_factory_.GetWeakPtr())); 218 weak_factory_.GetWeakPtr()));
219 multi_profile_user_controller_.reset( 219 multi_profile_user_controller_.reset(
220 new MultiProfileUserController(this, GetLocalState())); 220 new MultiProfileUserController(this, GetLocalState()));
221 221
222 policy::BrowserPolicyConnectorChromeOS* connector = 222 policy::DeviceLocalAccountPolicyService* device_local_account_policy_service =
223 g_browser_process->platform_part()->browser_policy_connector_chromeos(); 223 g_browser_process->platform_part()
224 avatar_policy_observer_.reset(new policy::CloudExternalDataPolicyObserver( 224 ->browser_policy_connector_chromeos()
225 cros_settings_, 225 ->GetDeviceLocalAccountPolicyService();
226 connector->GetDeviceLocalAccountPolicyService(), 226 if (!device_local_account_policy_service) {
227 policy::key::kUserAvatarImage, 227 return;
228 this)); 228 }
229
230 avatar_policy_observer_ =
231 base::MakeUnique<policy::CloudExternalDataPolicyObserver>(
232 cros_settings_, device_local_account_policy_service,
233 policy::key::kUserAvatarImage, this);
229 avatar_policy_observer_->Init(); 234 avatar_policy_observer_->Init();
230 235 wallpaper_policy_observer_ =
231 wallpaper_policy_observer_.reset(new policy::CloudExternalDataPolicyObserver( 236 base::MakeUnique<policy::CloudExternalDataPolicyObserver>(
232 cros_settings_, 237 cros_settings_, device_local_account_policy_service,
233 connector->GetDeviceLocalAccountPolicyService(), 238 policy::key::kWallpaperImage, this);
234 policy::key::kWallpaperImage,
235 this));
236 wallpaper_policy_observer_->Init(); 239 wallpaper_policy_observer_->Init();
237 } 240 }
238 241
239 ChromeUserManagerImpl::~ChromeUserManagerImpl() { 242 ChromeUserManagerImpl::~ChromeUserManagerImpl() {
240 } 243 }
241 244
242 void ChromeUserManagerImpl::Shutdown() { 245 void ChromeUserManagerImpl::Shutdown() {
243 DCHECK_CURRENTLY_ON(BrowserThread::UI); 246 DCHECK_CURRENTLY_ON(BrowserThread::UI);
244 ChromeUserManager::Shutdown(); 247 ChromeUserManager::Shutdown();
245 248
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 break; 1337 break;
1335 default: 1338 default:
1336 NOTREACHED(); 1339 NOTREACHED();
1337 break; 1340 break;
1338 } 1341 }
1339 1342
1340 return user; 1343 return user;
1341 } 1344 }
1342 1345
1343 } // namespace chromeos 1346 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698