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

Unified Diff: chrome/browser/autocomplete/autocomplete_popup_model.cc

Issue 7754008: Omnibox enters keyword search mode incorrectly (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 3 months 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
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_popup_model.cc
diff --git a/chrome/browser/autocomplete/autocomplete_popup_model.cc b/chrome/browser/autocomplete/autocomplete_popup_model.cc
index 041e1f06f49b3cddc488d90894daab8dbe30a2c5..aedfacdf7f0c3f422a92391981da706d43408943 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_model.cc
+++ b/chrome/browser/autocomplete/autocomplete_popup_model.cc
@@ -142,8 +142,11 @@ bool AutocompletePopupModel::GetKeywordForMatch(const AutocompleteMatch& match,
// the keyword and it isn't SEARCH_WHAT_YOU_TYPED.
const TemplateURL* default_url = url_service->GetDefaultSearchProvider();
if (default_url && (default_url->id() == match.template_url->id())) {
- if (StartsWith(autocomplete_controller()->input().text(),
- default_url->keyword(), false) &&
+ const string16& input_text = autocomplete_controller()->input().text();
sky 2011/09/08 14:21:50 This shouldn't be necessary. According to the bug
+ const string16& default_url_keyword = default_url->keyword();
+ if (StartsWith(input_text, default_url_keyword, false) &&
+ AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(
+ input_text[default_url_keyword.length()]) &&
(match.type != AutocompleteMatch::SEARCH_WHAT_YOU_TYPED)) {
keyword->assign(match.template_url->keyword());
return false;
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698