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

Unified Diff: chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc

Issue 12081002: about:omnibox - add "in keyword mode" checkbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
Index: chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc
diff --git a/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc b/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc
index b530b17c4a5a0250b290ae35baf5b7c26f648748..faf1c0eb1253b5284b48fe26cfacde3032d6be35 100644
--- a/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc
+++ b/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc
@@ -140,19 +140,22 @@ void OmniboxUIHandler::AddResultToDictionary(const std::string& prefix,
}
void OmniboxUIHandler::StartOmniboxQuery(
- const base::ListValue* three_element_input_string) {
- DCHECK_EQ(3u, three_element_input_string->GetSize());
+ const base::ListValue* four_element_input_string) {
+ DCHECK_EQ(4u, four_element_input_string->GetSize());
string16 input_string;
- bool return_val = three_element_input_string->GetString(0, &input_string);
+ bool return_val = four_element_input_string->GetString(0, &input_string);
DCHECK(return_val);
+ int cursor_position_int;
+ return_val = four_element_input_string->GetInteger(1, &cursor_position_int);
+ DCHECK(return_val);
+ size_t cursor_position = cursor_position_int;
bool prevent_inline_autocomplete;
return_val =
- three_element_input_string->GetBoolean(1, &prevent_inline_autocomplete);
+ four_element_input_string->GetBoolean(2, &prevent_inline_autocomplete);
DCHECK(return_val);
- int cursor_position_int;
- return_val = three_element_input_string->GetInteger(2, &cursor_position_int);
+ bool prefer_keyword;
+ return_val = four_element_input_string->GetBoolean(3, &prefer_keyword);
DCHECK(return_val);
- size_t cursor_position = cursor_position_int;
string16 empty_string;
// Reset the controller. If we don't do this, then the
// AutocompleteController might inappropriately set its |minimal_changes|
@@ -166,7 +169,7 @@ void OmniboxUIHandler::StartOmniboxQuery(
cursor_position,
empty_string, // user's desired tld (top-level domain)
prevent_inline_autocomplete,
- false, // no preferred keyword provider
+ prefer_keyword,
true, // allow exact keyword matches
AutocompleteInput::ALL_MATCHES)); // want all matches
}

Powered by Google App Engine
This is Rietveld 408576698