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; |