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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
diff --git a/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc b/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
index 2edff5afe3d251c826d78dc795bcbbdfca6a8c74..923f5288fbbd698296715252a85249bb9c5d8866 100644
--- a/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
+++ b/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
@@ -219,20 +219,23 @@ ChromeUserManagerImpl::ChromeUserManagerImpl()
multi_profile_user_controller_.reset(
new MultiProfileUserController(this, GetLocalState()));
- policy::BrowserPolicyConnectorChromeOS* connector =
- g_browser_process->platform_part()->browser_policy_connector_chromeos();
- avatar_policy_observer_.reset(new policy::CloudExternalDataPolicyObserver(
- cros_settings_,
- connector->GetDeviceLocalAccountPolicyService(),
- policy::key::kUserAvatarImage,
- this));
- avatar_policy_observer_->Init();
+ policy::DeviceLocalAccountPolicyService* device_local_account_policy_service =
+ g_browser_process->platform_part()
+ ->browser_policy_connector_chromeos()
+ ->GetDeviceLocalAccountPolicyService();
+ if (!device_local_account_policy_service) {
+ return;
+ }
- wallpaper_policy_observer_.reset(new policy::CloudExternalDataPolicyObserver(
- cros_settings_,
- connector->GetDeviceLocalAccountPolicyService(),
- policy::key::kWallpaperImage,
- this));
+ avatar_policy_observer_ =
+ base::MakeUnique<policy::CloudExternalDataPolicyObserver>(
+ cros_settings_, device_local_account_policy_service,
+ policy::key::kUserAvatarImage, this);
+ avatar_policy_observer_->Init();
+ wallpaper_policy_observer_ =
+ base::MakeUnique<policy::CloudExternalDataPolicyObserver>(
+ cros_settings_, device_local_account_policy_service,
+ policy::key::kWallpaperImage, this);
wallpaper_policy_observer_->Init();
}

Powered by Google App Engine
This is Rietveld 408576698