| 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 f0281228d94617ca797faee41e6893a9c1822d5b..5059574bd34b5b2ec21125c74c5407ea05c4c5e0 100644
|
| --- a/chrome/browser/policy/profile_policy_connector.cc
|
| +++ b/chrome/browser/policy/profile_policy_connector.cc
|
| @@ -17,6 +17,7 @@
|
| #include "chrome/browser/prefs/pref_service.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/common/chrome_switches.h"
|
| +#include "chrome/common/pref_names.h"
|
|
|
| namespace {
|
|
|
| @@ -72,14 +73,24 @@ void ProfilePolicyConnector::ScheduleServiceInitialization(
|
| void ProfilePolicyConnector::Initialize() {
|
| if (identity_strategy_.get())
|
| identity_strategy_->LoadTokenCache();
|
| - if (cloud_policy_subsystem_.get())
|
| - cloud_policy_subsystem_->Initialize(profile_->GetPrefs(),
|
| + if (cloud_policy_subsystem_.get()) {
|
| + cloud_policy_subsystem_->Initialize(prefs::kUserPolicyRefreshRate,
|
| kServiceInitializationStartupDelay);
|
| + // Temporarily set the subsystem to listen to profile pref service, since
|
| + // we cannot yet serve user cloud policy to |local_state| and we don't want
|
| + // the profile reference in the subsystem.
|
| + profile_pref_registrar_.Init(profile_->GetPrefs());
|
| + profile_pref_registrar_.Add(prefs::kUserPolicyRefreshRate,
|
| + cloud_policy_subsystem_.get());
|
| + }
|
| }
|
|
|
| void ProfilePolicyConnector::Shutdown() {
|
| - if (cloud_policy_subsystem_.get())
|
| + if (cloud_policy_subsystem_.get()) {
|
| + // Remove the temporary profile observer.
|
| + profile_pref_registrar_.RemoveAll();
|
| cloud_policy_subsystem_->Shutdown();
|
| + }
|
| }
|
|
|
| ConfigurationPolicyProvider*
|
|
|