diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-29 21:39:57 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-29 21:39:57 +0000 |
commit | bfc031f0f5f833f293b489bf1a2d1c873341fdda (patch) | |
tree | 60f07d7d4e901a5f06035daf251576366ab176fe /chrome/browser/instant/instant_controller.h | |
parent | 0c74a1a853187ee05d5adfdfcee8cfd313b016cd (diff) | |
download | chromium_src-bfc031f0f5f833f293b489bf1a2d1c873341fdda.zip chromium_src-bfc031f0f5f833f293b489bf1a2d1c873341fdda.tar.gz chromium_src-bfc031f0f5f833f293b489bf1a2d1c873341fdda.tar.bz2 |
Adds another instant type that doesn't turn suggest text into
autocomplete text.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/5281012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67593 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/instant/instant_controller.h')
-rw-r--r-- | chrome/browser/instant/instant_controller.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/chrome/browser/instant/instant_controller.h b/chrome/browser/instant/instant_controller.h index 5e268a9..eeebb07 100644 --- a/chrome/browser/instant/instant_controller.h +++ b/chrome/browser/instant/instant_controller.h @@ -7,6 +7,7 @@ #pragma once #include <set> +#include <string> #include "base/basictypes.h" #include "base/scoped_ptr.h" @@ -40,9 +41,12 @@ class TemplateURL; class InstantController : public InstantLoaderDelegate { public: // Variations of instant support. + // TODO(sky): nuke these when we decide the default behavior. enum Type { // NOTE: these values are persisted to prefs. Don't change them! + FIRST_TYPE = 0, + // Search results are shown for the best guess of what we think the user was // planning on typing. PREDICTIVE_TYPE = 0, @@ -50,7 +54,10 @@ class InstantController : public InstantLoaderDelegate { // Search results are shown for exactly what was typed. VERBATIM_TYPE, - LAST_TYPE = VERBATIM_TYPE, + // Variant of predictive that does not auto-complete after a delay. + PREDICTIVE_NO_AUTO_COMPLETE_TYPE, + + LAST_TYPE = PREDICTIVE_NO_AUTO_COMPLETE_TYPE }; InstantController(Profile* profile, InstantDelegate* delegate); @@ -196,6 +203,14 @@ class InstantController : public InstantLoaderDelegate { // if non TemplateURL should be used. const TemplateURL* GetTemplateURL(const AutocompleteMatch& match); + // If instant is enabled for the specified profile the type of instant is set + // in |type| and true is returned. Otherwise returns false. + static bool GetType(Profile* profile, Type* type); + + // Returns a string description for the currently enabled type. This is used + // for histograms. + static std::string GetTypeString(Profile* profile); + InstantDelegate* delegate_; // The TabContents last passed to |Update|. @@ -227,7 +242,7 @@ class InstantController : public InstantLoaderDelegate { // URL last pased to ScheduleUpdate. GURL scheduled_url_; - const Type type_; + Type type_; DISALLOW_COPY_AND_ASSIGN(InstantController); }; |