diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-17 03:23:25 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-17 03:23:25 +0000 |
commit | 73de26a684944782a92f8e6840e1b290c9a424cd (patch) | |
tree | ec40aeeb6615acf4d0c022d05637bb136da39b80 /chrome/browser/instant | |
parent | d7e1eb01337e621b6c23e8f3af0d7728a83d78d8 (diff) | |
download | chromium_src-73de26a684944782a92f8e6840e1b290c9a424cd.zip chromium_src-73de26a684944782a92f8e6840e1b290c9a424cd.tar.gz chromium_src-73de26a684944782a92f8e6840e1b290c9a424cd.tar.bz2 |
Revert 62881 - Moves instant back into flags.
I'm TBRing this since it's mostly a revert.
TBR=ben@chromium.org
BUG=59298
TEST=make sure instant isn't in preferences anymore.
Review URL: http://codereview.chromium.org/3809005
TBR=sky@chromium.org
Review URL: http://codereview.chromium.org/3777009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62883 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 40f9d71..24c70f8 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 e72f235..0430083 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 |