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/home_page_overlay_handler.h" | 5 #include "chrome/browser/ui/webui/options/home_page_overlay_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/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 autocomplete_controller_->Start(AutocompleteInput( | 57 autocomplete_controller_->Start(AutocompleteInput( |
58 input, base::string16::npos, std::string(), GURL(), | 58 input, base::string16::npos, std::string(), GURL(), |
59 metrics::OmniboxEventProto::INVALID_SPEC, true, false, false, true, false, | 59 metrics::OmniboxEventProto::INVALID_SPEC, true, false, false, true, false, |
60 ChromeAutocompleteSchemeClassifier(Profile::FromWebUI(web_ui())))); | 60 ChromeAutocompleteSchemeClassifier(Profile::FromWebUI(web_ui())))); |
61 } | 61 } |
62 | 62 |
63 void HomePageOverlayHandler::OnResultChanged(bool default_match_changed) { | 63 void HomePageOverlayHandler::OnResultChanged(bool default_match_changed) { |
64 const AutocompleteResult& result = autocomplete_controller_->result(); | 64 const AutocompleteResult& result = autocomplete_controller_->result(); |
65 base::ListValue suggestions; | 65 base::ListValue suggestions; |
66 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions); | 66 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions); |
67 web_ui()->CallJavascriptFunction( | 67 web_ui()->CallJavascriptFunctionUnsafe( |
68 "HomePageOverlay.updateAutocompleteSuggestions", suggestions); | 68 "HomePageOverlay.updateAutocompleteSuggestions", suggestions); |
69 } | 69 } |
70 | 70 |
71 } // namespace options | 71 } // namespace options |
OLD | NEW |