| Index: trunk/src/chrome/browser/policy/profile_policy_connector.cc
|
| ===================================================================
|
| --- trunk/src/chrome/browser/policy/profile_policy_connector.cc (revision 207797)
|
| +++ trunk/src/chrome/browser/policy/profile_policy_connector.cc (working copy)
|
| @@ -22,12 +22,10 @@
|
| #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"
|
| @@ -64,11 +62,7 @@
|
|
|
| bool is_managed = false;
|
| std::string username;
|
| - if (chromeos::ProfileHelper::IsSigninProfile(profile_)) {
|
| - special_user_policy_provider_.reset(new LoginProfilePolicyProvider(
|
| - connector->GetPolicyService()));
|
| - special_user_policy_provider_->Init();
|
| - } else {
|
| + if (!chromeos::ProfileHelper::IsSigninProfile(profile_)) {
|
| // |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.
|
| @@ -83,10 +77,9 @@
|
| 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_);
|
| @@ -105,10 +98,12 @@
|
|
|
| #if defined(OS_CHROMEOS)
|
| if (is_primary_user_) {
|
| - if (cloud_policy_manager)
|
| + if (cloud_policy_manager) {
|
| connector->SetUserPolicyDelegate(cloud_policy_manager);
|
| - else if (special_user_policy_provider_)
|
| - connector->SetUserPolicyDelegate(special_user_policy_provider_.get());
|
| + } else if (device_local_account_policy_provider_) {
|
| + connector->SetUserPolicyDelegate(
|
| + device_local_account_policy_provider_.get());
|
| + }
|
|
|
| chromeos::CryptohomeClient* cryptohome_client =
|
| chromeos::DBusThreadManager::Get()->GetCryptohomeClient();
|
| @@ -136,8 +131,8 @@
|
| connector->GetNetworkConfigurationUpdater();
|
| network_updater->UnsetUserPolicyService();
|
| }
|
| - if (special_user_policy_provider_)
|
| - special_user_policy_provider_->Shutdown();
|
| + if (device_local_account_policy_provider_)
|
| + device_local_account_policy_provider_->Shutdown();
|
| #endif
|
|
|
| #if defined(ENABLE_MANAGED_USERS)
|
| @@ -163,9 +158,10 @@
|
| connector->GetDeviceLocalAccountPolicyService();
|
| if (!device_local_account_policy_service)
|
| return;
|
| - special_user_policy_provider_.reset(new DeviceLocalAccountPolicyProvider(
|
| - username, device_local_account_policy_service));
|
| - special_user_policy_provider_->Init();
|
| + device_local_account_policy_provider_.reset(
|
| + new DeviceLocalAccountPolicyProvider(
|
| + username, device_local_account_policy_service));
|
| + device_local_account_policy_provider_->Init();
|
| }
|
|
|
| void ProfilePolicyConnector::InitializeNetworkConfigurationUpdater(
|
|
|