Chromium Code Reviews| 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 9b8204994fd1436220b588d895528755bbde7b95..f4b0e7b83cddb9971669a1868d3f24731c9d5fe5 100644 |
| --- a/chrome/browser/ui/browser_instant_controller.cc |
| +++ b/chrome/browser/ui/browser_instant_controller.cc |
| @@ -25,6 +25,14 @@ |
| #include "ui/gfx/color_utils.h" |
| #include "ui/gfx/sys_color_change_listener.h" |
| +namespace { |
| +const char* GetInstantPrefName(Profile* profile) { |
| + if (chrome::search::IsInstantExtendedAPIEnabled(profile)) |
|
sky
2012/12/07 23:31:31
Style guide says 'Don't use else after return', so
MAD
2012/12/08 15:53:11
Done.
|
| + return prefs::kInstantExtendedEnabled; |
| + else |
| + return prefs::kInstantEnabled; |
| +} |
| +} |
| namespace chrome { |
| @@ -40,7 +48,7 @@ BrowserInstantController::BrowserInstantController(Browser* browser) |
| theme_area_height_(0) { |
| profile_pref_registrar_.Init(browser_->profile()->GetPrefs()); |
| profile_pref_registrar_.Add( |
| - prefs::kInstantEnabled, |
| + GetInstantPrefName(browser_->profile()), |
| base::Bind(&BrowserInstantController::ResetInstant, |
| base::Unretained(this))); |
| ResetInstant(); |
| @@ -60,12 +68,14 @@ BrowserInstantController::~BrowserInstantController() { |
| bool BrowserInstantController::IsInstantEnabled(Profile* profile) { |
| return profile && !profile->IsOffTheRecord() && profile->GetPrefs() && |
| - profile->GetPrefs()->GetBoolean(prefs::kInstantEnabled); |
| + profile->GetPrefs()->GetBoolean(GetInstantPrefName(profile)); |
| } |
| void BrowserInstantController::RegisterUserPrefs(PrefService* prefs) { |
| prefs->RegisterBooleanPref(prefs::kInstantConfirmDialogShown, false, |
| PrefService::SYNCABLE_PREF); |
| + prefs->RegisterBooleanPref(prefs::kInstantExtendedEnabled, true, |
| + PrefService::SYNCABLE_PREF); |
| prefs->RegisterBooleanPref(prefs::kInstantEnabled, false, |
| PrefService::SYNCABLE_PREF); |
| } |