| 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
| 12 #include "base/time.h" | 12 #include "base/time.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
| 14 #include "chrome/browser/autocomplete/autocomplete_controller.h" | 15 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
| 15 #include "chrome/browser/autocomplete/autocomplete_input.h" | 16 #include "chrome/browser/autocomplete/autocomplete_input.h" |
| 16 #include "chrome/browser/autocomplete/autocomplete_match.h" | 17 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 17 #include "chrome/browser/autocomplete/autocomplete_provider.h" | 18 #include "chrome/browser/autocomplete/autocomplete_provider.h" |
| 18 #include "chrome/browser/search_engines/template_url.h" | 19 #include "chrome/browser/search_engines/template_url.h" |
| 19 #include "content/public/browser/web_ui.h" | 20 #include "content/public/browser/web_ui.h" |
| 20 | 21 |
| 21 OmniboxUIHandler::OmniboxUIHandler(Profile* profile ) { | 22 OmniboxUIHandler::OmniboxUIHandler(Profile* profile ) { |
| 22 controller_.reset(new AutocompleteController(profile, this)); | 23 controller_.reset( |
| 24 new AutocompleteController( |
| 25 profile, |
| 26 this, |
| 27 AutocompleteClassifier::kDefaultOmniboxProviders)); |
| 23 } | 28 } |
| 24 | 29 |
| 25 OmniboxUIHandler::~OmniboxUIHandler() {} | 30 OmniboxUIHandler::~OmniboxUIHandler() {} |
| 26 | 31 |
| 27 void OmniboxUIHandler::RegisterMessages() { | 32 void OmniboxUIHandler::RegisterMessages() { |
| 28 web_ui()->RegisterMessageCallback("startOmniboxQuery", | 33 web_ui()->RegisterMessageCallback("startOmniboxQuery", |
| 29 base::Bind(&OmniboxUIHandler::StartOmniboxQuery, | 34 base::Bind(&OmniboxUIHandler::StartOmniboxQuery, |
| 30 base::Unretained(this))); | 35 base::Unretained(this))); |
| 31 } | 36 } |
| 32 | 37 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // query before it starts the new one. By the way, in this call to | 149 // query before it starts the new one. By the way, in this call to |
| 145 // Start(), we use the default/typical values for all parameters. | 150 // Start(), we use the default/typical values for all parameters. |
| 146 time_omnibox_started_ = base::Time::Now(); | 151 time_omnibox_started_ = base::Time::Now(); |
| 147 controller_->Start(input_string, | 152 controller_->Start(input_string, |
| 148 empty_string, // user's desired tld (top-level domain) | 153 empty_string, // user's desired tld (top-level domain) |
| 149 false, // don't prevent inline autocompletion | 154 false, // don't prevent inline autocompletion |
| 150 false, // no preferred keyword provider | 155 false, // no preferred keyword provider |
| 151 true, // allow exact keyword matches | 156 true, // allow exact keyword matches |
| 152 AutocompleteInput::ALL_MATCHES); // want all matches | 157 AutocompleteInput::ALL_MATCHES); // want all matches |
| 153 } | 158 } |
| OLD | NEW |