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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 UpdateStartupPages(); | 220 UpdateStartupPages(); |
221 } | 221 } |
222 | 222 |
223 void StartupPagesHandler::RequestAutocompleteSuggestions( | 223 void StartupPagesHandler::RequestAutocompleteSuggestions( |
224 const ListValue* args) { | 224 const ListValue* args) { |
225 string16 input; | 225 string16 input; |
226 CHECK_EQ(args->GetSize(), 1U); | 226 CHECK_EQ(args->GetSize(), 1U); |
227 CHECK(args->GetString(0, &input)); | 227 CHECK(args->GetString(0, &input)); |
228 | 228 |
229 autocomplete_controller_->Start(AutocompleteInput( | 229 autocomplete_controller_->Start(AutocompleteInput( |
230 input, string16::npos, string16(), true, | 230 input, string16::npos, string16(), GURL(), true, |
231 false, false, AutocompleteInput::ALL_MATCHES)); | 231 false, false, AutocompleteInput::ALL_MATCHES)); |
232 } | 232 } |
233 | 233 |
234 void StartupPagesHandler::OnResultChanged(bool default_match_changed) { | 234 void StartupPagesHandler::OnResultChanged(bool default_match_changed) { |
235 const AutocompleteResult& result = autocomplete_controller_->result(); | 235 const AutocompleteResult& result = autocomplete_controller_->result(); |
236 ListValue suggestions; | 236 ListValue suggestions; |
237 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions); | 237 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions); |
238 web_ui()->CallJavascriptFunction( | 238 web_ui()->CallJavascriptFunction( |
239 "StartupOverlay.updateAutocompleteSuggestions", suggestions); | 239 "StartupOverlay.updateAutocompleteSuggestions", suggestions); |
240 } | 240 } |
241 | 241 |
242 } // namespace options | 242 } // namespace options |
OLD | NEW |