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

Side by Side Diff: chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc

Issue 10692075: Enhance chrome://omnibox Presentation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Sync to tree for final review. Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/omnibox/omnibox_ui_handler.h" 5 #include "chrome/browser/ui/webui/omnibox/omnibox_ui_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 it->is_history_what_you_typed_match); 118 it->is_history_what_you_typed_match);
119 output->SetString(item_prefix + ".type", 119 output->SetString(item_prefix + ".type",
120 AutocompleteMatch::TypeToString(it->type)); 120 AutocompleteMatch::TypeToString(it->type));
121 if (it->associated_keyword.get() != NULL) { 121 if (it->associated_keyword.get() != NULL) {
122 output->SetString(item_prefix + ".associated_keyword", 122 output->SetString(item_prefix + ".associated_keyword",
123 it->associated_keyword->keyword); 123 it->associated_keyword->keyword);
124 } 124 }
125 output->SetString(item_prefix + ".keyword", it->keyword); 125 output->SetString(item_prefix + ".keyword", it->keyword);
126 output->SetBoolean(item_prefix + ".starred", it->starred); 126 output->SetBoolean(item_prefix + ".starred", it->starred);
127 output->SetBoolean(item_prefix + ".from_previous", it->from_previous); 127 output->SetBoolean(item_prefix + ".from_previous", it->from_previous);
128 for (std::map<std::string, std::string>::const_iterator j =
129 it->diagnostics.begin(); j != it->diagnostics.end(); ++j)
Evan Stade 2012/07/26 03:56:21 curlies
Peter Kasting 2012/07/26 05:25:43 Not necessary (and I discourage them), since the b
Evan Stade 2012/07/27 00:04:42 I don't like that rule for loops, and the style gu
mrossetti 2012/07/27 17:55:36 Done.
130 output->SetString(item_prefix + ".diagnostics." + j->first, j->second);
128 } 131 }
129 output->SetInteger(prefix + ".num_items", i); 132 output->SetInteger(prefix + ".num_items", i);
130 } 133 }
131 134
132 void OmniboxUIHandler::StartOmniboxQuery( 135 void OmniboxUIHandler::StartOmniboxQuery(
133 const base::ListValue* one_element_input_string) { 136 const base::ListValue* one_element_input_string) {
134 string16 input_string = ExtractStringValue(one_element_input_string); 137 string16 input_string = ExtractStringValue(one_element_input_string);
135 string16 empty_string; 138 string16 empty_string;
136 // Tell the autocomplete controller to start working on the 139 // Tell the autocomplete controller to start working on the
137 // input. It's okay if the previous request hasn't yet finished; 140 // input. It's okay if the previous request hasn't yet finished;
138 // the autocomplete controller is smart enough to stop the previous 141 // the autocomplete controller is smart enough to stop the previous
139 // query before it starts the new one. By the way, in this call to 142 // query before it starts the new one. By the way, in this call to
140 // Start(), we use the default/typical values for all parameters. 143 // Start(), we use the default/typical values for all parameters.
141 time_omnibox_started_ = base::Time::Now(); 144 time_omnibox_started_ = base::Time::Now();
142 controller_->Start(input_string, 145 controller_->Start(input_string,
143 empty_string, // user's desired tld (top-level domain) 146 empty_string, // user's desired tld (top-level domain)
144 false, // don't prevent inline autocompletion 147 false, // don't prevent inline autocompletion
145 false, // no preferred keyword provider 148 false, // no preferred keyword provider
146 true, // allow exact keyword matches 149 true, // allow exact keyword matches
147 AutocompleteInput::ALL_MATCHES); // want all matches 150 AutocompleteInput::ALL_MATCHES); // want all matches
148 } 151 }
OLDNEW
« chrome/browser/resources/omnibox/omnibox.js ('K') | « chrome/browser/resources/omnibox/omnibox.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698