diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-10 21:44:11 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-10 21:44:11 +0000 |
commit | df6ab6b6eba3534d972426df1d4e1c1de7fdb98a (patch) | |
tree | e32af3d47800e701e9be2590d3c732a88aaa4856 /chrome/browser/autocomplete/autocomplete_classifier.h | |
parent | 5a3f62856d89817d4117de189e855a6dad16c2ee (diff) | |
download | chromium_src-df6ab6b6eba3534d972426df1d4e1c1de7fdb98a.zip chromium_src-df6ab6b6eba3534d972426df1d4e1c1de7fdb98a.tar.gz chromium_src-df6ab6b6eba3534d972426df1d4e1c1de7fdb98a.tar.bz2 |
Don't allow exact keyword matches for most uses of the autocomplete classifier. Patch by Naoki Takano (see http://codereview.chromium.org/4142006 ), r=me.
BUG=60059
TEST=Change a search engine keyword to "a", highlight text beginning with "a" in a webpage (e.g. "a movie"), right-click and select "Search Google for a movie". The result should be a Google search page, not a result page for whatever search engine has the keyword "a".
Review URL: http://codereview.chromium.org/4717001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65706 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_classifier.h')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_classifier.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_classifier.h b/chrome/browser/autocomplete/autocomplete_classifier.h index facdd34..ed59306 100644 --- a/chrome/browser/autocomplete/autocomplete_classifier.h +++ b/chrome/browser/autocomplete/autocomplete_classifier.h @@ -23,15 +23,19 @@ class AutocompleteClassifier { // Given some string |text| that the user wants to use for navigation, // determines how it should be interpreted. |desired_tld| is the user's - // desired TLD, if any; see AutocompleteInput::desired_tld(). |match| should - // be a non-NULL outparam that will be set to the default match for this - // input, if any (for invalid input, there will be no default match, and - // |match| will be left unchanged). |alternate_nav_url| is a possibly-NULL - // outparam that, if non-NULL, will be set to the navigational URL (if any) in - // case of an accidental search; see comments on + // desired TLD, if any; see AutocompleteInput::desired_tld(). + // |allow_exact_keyword_match| should be true when treating the string as a + // potential keyword search is valid; see + // AutocompleteInput::allow_exact_keyword_match(). |match| should be a + // non-NULL outparam that will be set to the default match for this input, if + // any (for invalid input, there will be no default match, and |match| will be + // left unchanged). |alternate_nav_url| is a possibly-NULL outparam that, if + // non-NULL, will be set to the navigational URL (if any) in case of an + // accidental search; see comments on // AutocompleteResult::alternate_nav_url_ in autocomplete.h. void Classify(const std::wstring& text, const std::wstring& desired_tld, + bool allow_exact_keyword_match, AutocompleteMatch* match, GURL* alternate_nav_url); |