| Index: chrome/browser/ui/cocoa/options/preferences_window_controller.mm
|
| diff --git a/chrome/browser/ui/cocoa/options/preferences_window_controller.mm b/chrome/browser/ui/cocoa/options/preferences_window_controller.mm
|
| index 1de5adaf3b7ac1ea1ed93670e716c46c01a4c5c8..1d188c19c2238c5fb9c969a4696fa8d2dd1468b6 100644
|
| --- a/chrome/browser/ui/cocoa/options/preferences_window_controller.mm
|
| +++ b/chrome/browser/ui/cocoa/options/preferences_window_controller.mm
|
| @@ -486,6 +486,13 @@ class ManagedPrefsBannerState : public policy::ManagedPrefsBannerBase {
|
| @synthesize proxiesConfigureButtonEnabled = proxiesConfigureButtonEnabled_;
|
|
|
| - (id)initWithProfile:(Profile*)profile initialPage:(OptionsPage)initialPage {
|
| + return [self initWithProfile:profile
|
| + localState:NULL
|
| + initialPage:initialPage];
|
| + }
|
| +
|
| +- (id)initWithProfile:(Profile*)profile localState:(PrefService*)local_state
|
| + initialPage:(OptionsPage)initialPage {
|
| DCHECK(profile);
|
| // Use initWithWindowNibPath:: instead of initWithWindowNibName: so we
|
| // can override it in a unit test.
|
| @@ -497,6 +504,7 @@ class ManagedPrefsBannerState : public policy::ManagedPrefsBannerBase {
|
| initialPage_ = initialPage;
|
| prefs_ = profile->GetPrefs();
|
| DCHECK(prefs_);
|
| + local_state_ = local_state;
|
| observer_.reset(
|
| new PreferencesWindowControllerInternal::PrefObserverBridge(self));
|
|
|
| @@ -837,7 +845,7 @@ class ManagedPrefsBannerState : public policy::ManagedPrefsBannerBase {
|
| // know it's there).
|
| PrefService* local = g_browser_process->local_state();
|
| if (!local)
|
| - local = prefs_;
|
| + local = local_state_ ? local_state_ : prefs_;
|
|
|
| // Basics panel
|
| registrar_.Init(prefs_);
|
| @@ -2068,7 +2076,7 @@ const int kDisabledIndex = 1;
|
| // know it's there).
|
| PrefService* local = g_browser_process->local_state();
|
| if (!local)
|
| - local = prefs_;
|
| + local = local_state_ ? local_state_ : prefs_;
|
| bannerState_.reset(
|
| new PreferencesWindowControllerInternal::ManagedPrefsBannerState(
|
| self, page, local, prefs_));
|
|
|