OLD | NEW |
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/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // variable (or something else) and some providers will short-circuit | 165 // variable (or something else) and some providers will short-circuit |
166 // important logic and return stale results. In short, we want the | 166 // important logic and return stale results. In short, we want the |
167 // actual results to not depend on the state of the previous request. | 167 // actual results to not depend on the state of the previous request. |
168 ResetController(); | 168 ResetController(); |
169 time_omnibox_started_ = base::Time::Now(); | 169 time_omnibox_started_ = base::Time::Now(); |
170 input_ = AutocompleteInput( | 170 input_ = AutocompleteInput( |
171 input_string.To<base::string16>(), | 171 input_string.To<base::string16>(), |
172 cursor_position, | 172 cursor_position, |
173 base::string16(), // user's desired tld (top-level domain) | 173 base::string16(), // user's desired tld (top-level domain) |
174 GURL(), | 174 GURL(), |
175 static_cast<AutocompleteInput::PageClassification>( | 175 static_cast<metrics::OmniboxEventProto::PageClassification>( |
176 page_classification), | 176 page_classification), |
177 prevent_inline_autocomplete, | 177 prevent_inline_autocomplete, |
178 prefer_keyword, | 178 prefer_keyword, |
179 true, // allow exact keyword matches | 179 true, // allow exact keyword matches |
180 true); | 180 true); |
181 controller_->Start(input_); // want all matches | 181 controller_->Start(input_); // want all matches |
182 } | 182 } |
183 | 183 |
184 void OmniboxUIHandler::ResetController() { | 184 void OmniboxUIHandler::ResetController() { |
185 controller_.reset(new AutocompleteController(profile_, this, | 185 controller_.reset(new AutocompleteController(profile_, this, |
186 AutocompleteClassifier::kDefaultOmniboxProviders)); | 186 AutocompleteClassifier::kDefaultOmniboxProviders)); |
187 } | 187 } |
OLD | NEW |