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

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

Issue 11475028: Add new instant extended specific pref. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed last OWNERS comments. Created 8 years 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/browser_instant_controller.cc
diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc
index b5a2820d930d37a29d34989febbc8fee8af23147..15ec0efa678a1b45dad23dd1d29a556d43671567 100644
--- a/chrome/browser/ui/browser_instant_controller.cc
+++ b/chrome/browser/ui/browser_instant_controller.cc
@@ -25,6 +25,12 @@
#include "ui/gfx/color_utils.h"
#include "ui/gfx/sys_color_change_listener.h"
+namespace {
+const char* GetInstantPrefName(Profile* profile) {
+ return chrome::search::IsInstantExtendedAPIEnabled(profile) ?
+ prefs::kInstantExtendedEnabled : prefs::kInstantEnabled;
+}
+}
namespace chrome {
@@ -40,7 +46,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 +66,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);
}
« no previous file with comments | « chrome/browser/resources/options/browser_options.js ('k') | chrome/browser/ui/webui/options/browser_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698