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

Unified Diff: chrome/browser/ui/cocoa/options/preferences_window_controller.mm

Issue 6292017: Extended: Add "system" URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Next iteration Created 9 years, 10 months 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/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_));

Powered by Google App Engine
This is Rietveld 408576698