| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 UpdateStartupPages(); | 248 UpdateStartupPages(); |
| 249 } | 249 } |
| 250 | 250 |
| 251 void StartupPagesHandler::RequestAutocompleteSuggestions( | 251 void StartupPagesHandler::RequestAutocompleteSuggestions( |
| 252 const base::ListValue* args) { | 252 const base::ListValue* args) { |
| 253 base::string16 input; | 253 base::string16 input; |
| 254 CHECK_EQ(args->GetSize(), 1U); | 254 CHECK_EQ(args->GetSize(), 1U); |
| 255 CHECK(args->GetString(0, &input)); | 255 CHECK(args->GetString(0, &input)); |
| 256 | 256 |
| 257 autocomplete_controller_->Start(AutocompleteInput( | 257 autocomplete_controller_->Start(AutocompleteInput( |
| 258 input, base::string16::npos, std::string(), GURL(), | 258 input, base::string16::npos, std::string(), GURL(), base::string16(), |
| 259 metrics::OmniboxEventProto::INVALID_SPEC, true, false, false, true, false, | 259 metrics::OmniboxEventProto::INVALID_SPEC, true, false, false, true, false, |
| 260 ChromeAutocompleteSchemeClassifier(Profile::FromWebUI(web_ui())))); | 260 ChromeAutocompleteSchemeClassifier(Profile::FromWebUI(web_ui())))); |
| 261 } | 261 } |
| 262 | 262 |
| 263 void StartupPagesHandler::OnResultChanged(bool default_match_changed) { | 263 void StartupPagesHandler::OnResultChanged(bool default_match_changed) { |
| 264 const AutocompleteResult& result = autocomplete_controller_->result(); | 264 const AutocompleteResult& result = autocomplete_controller_->result(); |
| 265 base::ListValue suggestions; | 265 base::ListValue suggestions; |
| 266 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions); | 266 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions); |
| 267 web_ui()->CallJavascriptFunctionUnsafe( | 267 web_ui()->CallJavascriptFunctionUnsafe( |
| 268 "StartupOverlay.updateAutocompleteSuggestions", suggestions); | 268 "StartupOverlay.updateAutocompleteSuggestions", suggestions); |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // namespace options | 271 } // namespace options |
| OLD | NEW |