| 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/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 16 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
| 17 #include "chrome/browser/autocomplete/autocomplete_controller.h" | 17 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
| 18 #include "chrome/browser/autocomplete/autocomplete_match.h" | 18 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 19 #include "chrome/browser/autocomplete/autocomplete_provider.h" | 19 #include "chrome/browser/autocomplete/autocomplete_provider.h" |
| 20 #include "chrome/browser/history/history_service.h" | 20 #include "chrome/browser/history/history_service.h" |
| 21 #include "chrome/browser/history/history_service_factory.h" | 21 #include "chrome/browser/history/history_service_factory.h" |
| 22 #include "chrome/browser/history/url_database.h" | |
| 23 #include "chrome/browser/search/search.h" | 22 #include "chrome/browser/search/search.h" |
| 23 #include "components/history/core/browser/url_database.h" |
| 24 #include "components/metrics/proto/omnibox_event.pb.h" | 24 #include "components/metrics/proto/omnibox_event.pb.h" |
| 25 #include "components/search_engines/template_url.h" | 25 #include "components/search_engines/template_url.h" |
| 26 #include "content/public/browser/web_ui.h" | 26 #include "content/public/browser/web_ui.h" |
| 27 #include "mojo/common/common_type_converters.h" | 27 #include "mojo/common/common_type_converters.h" |
| 28 | 28 |
| 29 namespace mojo { | 29 namespace mojo { |
| 30 | 30 |
| 31 template <> | 31 template <> |
| 32 class TypeConverter<mojo::Array<AutocompleteAdditionalInfoPtr>, | 32 class TypeConverter<mojo::Array<AutocompleteAdditionalInfoPtr>, |
| 33 AutocompleteMatch::AdditionalInfo> { | 33 AutocompleteMatch::AdditionalInfo> { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 static_cast<metrics::OmniboxEventProto::PageClassification>( | 174 static_cast<metrics::OmniboxEventProto::PageClassification>( |
| 175 page_classification), | 175 page_classification), |
| 176 prevent_inline_autocomplete, prefer_keyword, true, true, profile_); | 176 prevent_inline_autocomplete, prefer_keyword, true, true, profile_); |
| 177 controller_->Start(input_); | 177 controller_->Start(input_); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void OmniboxUIHandler::ResetController() { | 180 void OmniboxUIHandler::ResetController() { |
| 181 controller_.reset(new AutocompleteController(profile_, this, | 181 controller_.reset(new AutocompleteController(profile_, this, |
| 182 AutocompleteClassifier::kDefaultOmniboxProviders)); | 182 AutocompleteClassifier::kDefaultOmniboxProviders)); |
| 183 } | 183 } |
| OLD | NEW |