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/options/startup_pages_handler.h" | 5 #include "chrome/browser/ui/webui/options/startup_pages_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 10 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 } | 229 } |
230 | 230 |
231 void StartupPagesHandler::RequestAutocompleteSuggestions( | 231 void StartupPagesHandler::RequestAutocompleteSuggestions( |
232 const base::ListValue* args) { | 232 const base::ListValue* args) { |
233 base::string16 input; | 233 base::string16 input; |
234 CHECK_EQ(args->GetSize(), 1U); | 234 CHECK_EQ(args->GetSize(), 1U); |
235 CHECK(args->GetString(0, &input)); | 235 CHECK(args->GetString(0, &input)); |
236 | 236 |
237 autocomplete_controller_->Start(AutocompleteInput( | 237 autocomplete_controller_->Start(AutocompleteInput( |
238 input, base::string16::npos, base::string16(), GURL(), | 238 input, base::string16::npos, base::string16(), GURL(), |
239 AutocompleteInput::INVALID_SPEC, true, false, false, true)); | 239 metrics::OmniboxEventProto::INVALID_SPEC, true, false, false, true)); |
240 } | 240 } |
241 | 241 |
242 void StartupPagesHandler::OnResultChanged(bool default_match_changed) { | 242 void StartupPagesHandler::OnResultChanged(bool default_match_changed) { |
243 const AutocompleteResult& result = autocomplete_controller_->result(); | 243 const AutocompleteResult& result = autocomplete_controller_->result(); |
244 base::ListValue suggestions; | 244 base::ListValue suggestions; |
245 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions); | 245 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions); |
246 web_ui()->CallJavascriptFunction( | 246 web_ui()->CallJavascriptFunction( |
247 "StartupOverlay.updateAutocompleteSuggestions", suggestions); | 247 "StartupOverlay.updateAutocompleteSuggestions", suggestions); |
248 } | 248 } |
249 | 249 |
250 } // namespace options | 250 } // namespace options |
OLD | NEW |