diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-12 05:05:37 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-12 05:05:37 +0000 |
commit | 2031cf9d2ebb778b9a2f76aa089a3c96ae91db72 (patch) | |
tree | b1f7a90f01c76af8e8502f189925957d89734fe8 /chrome/browser/instant | |
parent | c976938f96f5f9296d25cbc41d8fcea5bce74627 (diff) | |
download | chromium_src-2031cf9d2ebb778b9a2f76aa089a3c96ae91db72.zip chromium_src-2031cf9d2ebb778b9a2f76aa089a3c96ae91db72.tar.gz chromium_src-2031cf9d2ebb778b9a2f76aa089a3c96ae91db72.tar.bz2 |
Moves instant out of labs and into prefs.
BUG=58772
TEST=make sure that there is an entry in prefs for instant. See that
it works.
Review URL: http://codereview.chromium.org/3726002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62250 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/instant')
-rw-r--r-- | chrome/browser/instant/instant_controller.cc | 6 | ||||
-rw-r--r-- | chrome/browser/instant/instant_controller.h | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc index 3c30c44..ac0cbfd 100644 --- a/chrome/browser/instant/instant_controller.cc +++ b/chrome/browser/instant/instant_controller.cc @@ -28,8 +28,7 @@ void InstantController::RegisterUserPrefs(PrefService* prefs) { } // static -bool InstantController::IsEnabled() { - // TODO: convert to kInstantEnabled once pref lands. +bool InstantController::IsEnabled(Profile* profile) { static bool enabled = false; static bool checked = false; if (!checked) { @@ -37,7 +36,8 @@ bool InstantController::IsEnabled() { enabled = CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableMatchPreview); } - return enabled; + PrefService* prefs = profile->GetPrefs(); + return (enabled || (prefs && prefs->GetBoolean(prefs::kInstantEnabled))); } InstantController::InstantController(InstantDelegate* delegate) diff --git a/chrome/browser/instant/instant_controller.h b/chrome/browser/instant/instant_controller.h index 84a15a2..dd4631a 100644 --- a/chrome/browser/instant/instant_controller.h +++ b/chrome/browser/instant/instant_controller.h @@ -23,6 +23,7 @@ struct AutocompleteMatch; class InstantDelegate; class InstantLoaderManager; class PrefService; +class Profile; class TabContents; class TemplateURL; @@ -43,7 +44,7 @@ class InstantController : public InstantLoaderDelegate { static void RegisterUserPrefs(PrefService* prefs); // Is InstantController enabled? - static bool IsEnabled(); + static bool IsEnabled(Profile* profile); // Invoked as the user types in the omnibox with the url to navigate to. If // the url is empty and there is a preview TabContents it is destroyed. If url |