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

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

Issue 6542013: Get rid of browser_prefs::RegisterAllPrefs() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix metrics_log_unittest.cc 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 49265765829c7ea8c800e6b55c13a17996ada46f..9c18e6472c124db2421a1b44ec5ad8029b389079 100644
--- a/chrome/browser/ui/cocoa/options/preferences_window_controller.mm
+++ b/chrome/browser/ui/cocoa/options/preferences_window_controller.mm
@@ -834,12 +834,7 @@ class ManagedPrefsBannerState : public policy::ManagedPrefsBannerBase {
- (void)registerPrefObservers {
if (!prefs_) return;
- // During unit tests, there is no local state object, so we fall back to
- // the prefs object (where we've explicitly registered this pref so we
- // know it's there).
PrefService* local = g_browser_process->local_state();
- if (!local)
- local = prefs_;
// Basics panel
registrar_.Init(prefs_);
@@ -2066,15 +2061,9 @@ const int kDisabledIndex = 1;
- (void)initBannerStateForPage:(OptionsPage)page {
page = [self normalizePage:page];
- // During unit tests, there is no local state object, so we fall back to
- // the prefs object (where we've explicitly registered this pref so we
- // know it's there).
- PrefService* local = g_browser_process->local_state();
- if (!local)
- local = prefs_;
bannerState_.reset(
new PreferencesWindowControllerInternal::ManagedPrefsBannerState(
- self, page, local, prefs_));
+ self, page, g_browser_process->local_state(), prefs_));
}
- (void)switchToPage:(OptionsPage)page animate:(BOOL)animate {

Powered by Google App Engine
This is Rietveld 408576698