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

Unified Diff: chrome/browser/ui/browser_instant_controller.cc

Issue 12328054: Fix prefs registration for BrowserInstantController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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
« no previous file with comments | « chrome/browser/ui/browser_instant_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_instant_controller.cc
diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc
index 582ae88a9009ee2429c033d94ebfc861278d625f..af34c19eee01a5356036294174ebdee92c299dec 100644
--- a/chrome/browser/ui/browser_instant_controller.cc
+++ b/chrome/browser/ui/browser_instant_controller.cc
@@ -46,7 +46,16 @@ BrowserInstantController::BrowserInstantController(Browser* browser)
chrome::search::IsInstantExtendedAPIEnabled(profile())),
instant_unload_handler_(browser),
initialized_theme_info_(false) {
- profile_pref_registrar_.Init(profile()->GetPrefs());
+ PrefService* prefs = profile()->GetPrefs();
+
+ // kInstantExtendedEnabled takes the value of kInstantEnabled in this case.
+ if (search::GetInstantExtendedDefaultSetting() ==
+ search::INSTANT_USE_EXISTING) {
+ prefs->SetBoolean(prefs::kInstantExtendedEnabled,
+ prefs->GetBoolean(prefs::kInstantEnabled));
Mattias Nissler (ping if slow) 2013/02/22 13:06:16 Note this is a change in semantics, not sure wheth
+ }
+
+ profile_pref_registrar_.Init(prefs);
profile_pref_registrar_.Add(
GetInstantPrefName(profile()),
base::Bind(&BrowserInstantController::ResetInstant,
@@ -76,9 +85,7 @@ bool BrowserInstantController::IsInstantEnabled(Profile* profile) {
}
void BrowserInstantController::RegisterUserPrefs(
- PrefService* prefs,
PrefRegistrySyncable* registry) {
- // TODO(joi): Get rid of the need for PrefService param above.
registry->RegisterBooleanPref(prefs::kInstantConfirmDialogShown, false,
PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kInstantEnabled, false,
@@ -89,9 +96,7 @@ void BrowserInstantController::RegisterUserPrefs(
case search::INSTANT_DEFAULT_ON:
instant_extended_default = true;
break;
- case search::INSTANT_USE_EXISTING:
- instant_extended_default = prefs->GetBoolean(prefs::kInstantEnabled);
- break;
+ case search::INSTANT_USE_EXISTING: // Initialized in constructor.
robertshield 2013/02/22 13:36:55 It took me a few minutes to convince myself that t
case search::INSTANT_DEFAULT_OFF:
instant_extended_default = false;
break;
« no previous file with comments | « chrome/browser/ui/browser_instant_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698