| Index: chrome/browser/policy/profile_policy_connector.cc
|
| diff --git a/chrome/browser/policy/profile_policy_connector.cc b/chrome/browser/policy/profile_policy_connector.cc
|
| index f9f339a29c4e86e7051cdd9eaf222aaa65077af7..36e07dca753e6650796ef0217204f0be19a72fc4 100644
|
| --- a/chrome/browser/policy/profile_policy_connector.cc
|
| +++ b/chrome/browser/policy/profile_policy_connector.cc
|
| @@ -22,10 +22,12 @@
|
| #include "chrome/browser/chromeos/login/user.h"
|
| #include "chrome/browser/chromeos/login/user_manager.h"
|
| #include "chrome/browser/chromeos/policy/device_local_account_policy_provider.h"
|
| +#include "chrome/browser/chromeos/policy/login_profile_policy_provider.h"
|
| #include "chrome/browser/chromeos/policy/network_configuration_updater.h"
|
| #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
|
| #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h"
|
| #include "chrome/browser/chromeos/profiles/profile_helper.h"
|
| +#include "chrome/browser/policy/policy_service.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chromeos/dbus/cryptohome_client.h"
|
| #include "chromeos/dbus/dbus_thread_manager.h"
|
| @@ -62,7 +64,11 @@ void ProfilePolicyConnector::Init(
|
|
|
| bool is_managed = false;
|
| std::string username;
|
| - if (!chromeos::ProfileHelper::IsSigninProfile(profile_)) {
|
| + if (chromeos::ProfileHelper::IsSigninProfile(profile_)) {
|
| + special_user_policy_provider_.reset(new LoginProfilePolicyProvider(
|
| + connector->GetPolicyService()));
|
| + special_user_policy_provider_->Init();
|
| + } else {
|
| // |user| should never be NULL except for the signin profile.
|
| // TODO(joaodasilva): get the |user| that corresponds to the |profile_|
|
| // from the ProfileHelper, once that's ready.
|
| @@ -77,9 +83,10 @@ void ProfilePolicyConnector::Init(
|
| chromeos::UserManager::Get()->GetLoggedInUsers().size() == 1;
|
| if (user->GetType() == chromeos::User::USER_TYPE_PUBLIC_ACCOUNT)
|
| InitializeDeviceLocalAccountPolicyProvider(username);
|
| - if (device_local_account_policy_provider_)
|
| - providers.push_back(device_local_account_policy_provider_.get());
|
| }
|
| + if (special_user_policy_provider_)
|
| + providers.push_back(special_user_policy_provider_.get());
|
| +
|
| #else
|
| UserCloudPolicyManager* cloud_policy_manager =
|
| UserCloudPolicyManagerFactory::GetForProfile(profile_);
|
| @@ -98,12 +105,10 @@ void ProfilePolicyConnector::Init(
|
|
|
| #if defined(OS_CHROMEOS)
|
| if (is_primary_user_) {
|
| - if (cloud_policy_manager) {
|
| + if (cloud_policy_manager)
|
| connector->SetUserPolicyDelegate(cloud_policy_manager);
|
| - } else if (device_local_account_policy_provider_) {
|
| - connector->SetUserPolicyDelegate(
|
| - device_local_account_policy_provider_.get());
|
| - }
|
| + else if (special_user_policy_provider_)
|
| + connector->SetUserPolicyDelegate(special_user_policy_provider_.get());
|
|
|
| chromeos::CryptohomeClient* cryptohome_client =
|
| chromeos::DBusThreadManager::Get()->GetCryptohomeClient();
|
| @@ -131,8 +136,8 @@ void ProfilePolicyConnector::Shutdown() {
|
| connector->GetNetworkConfigurationUpdater();
|
| network_updater->UnsetUserPolicyService();
|
| }
|
| - if (device_local_account_policy_provider_)
|
| - device_local_account_policy_provider_->Shutdown();
|
| + if (special_user_policy_provider_)
|
| + special_user_policy_provider_->Shutdown();
|
| #endif
|
|
|
| #if defined(ENABLE_MANAGED_USERS)
|
| @@ -158,10 +163,9 @@ void ProfilePolicyConnector::InitializeDeviceLocalAccountPolicyProvider(
|
| connector->GetDeviceLocalAccountPolicyService();
|
| if (!device_local_account_policy_service)
|
| return;
|
| - device_local_account_policy_provider_.reset(
|
| - new DeviceLocalAccountPolicyProvider(
|
| - username, device_local_account_policy_service));
|
| - device_local_account_policy_provider_->Init();
|
| + special_user_policy_provider_.reset(new DeviceLocalAccountPolicyProvider(
|
| + username, device_local_account_policy_service));
|
| + special_user_policy_provider_->Init();
|
| }
|
|
|
| void ProfilePolicyConnector::InitializeNetworkConfigurationUpdater(
|
|
|