OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/autocomplete/chrome_autocomplete_provider_client.h" | 5 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/feature_list.h" | 9 #include "base/feature_list.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" | 14 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" |
15 #include "chrome/browser/autocomplete/in_memory_url_index_factory.h" | 15 #include "chrome/browser/autocomplete/in_memory_url_index_factory.h" |
16 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" | 16 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" |
17 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h" | 17 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h" |
18 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.h" | 18 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.h" |
19 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 19 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 20 #include "chrome/browser/browser_process.h" |
20 #include "chrome/browser/chrome_notification_types.h" | 21 #include "chrome/browser/chrome_notification_types.h" |
21 #include "chrome/browser/history/history_service_factory.h" | 22 #include "chrome/browser/history/history_service_factory.h" |
22 #include "chrome/browser/history/top_sites_factory.h" | 23 #include "chrome/browser/history/top_sites_factory.h" |
23 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
24 #include "chrome/browser/search_engines/template_url_service_factory.h" | 25 #include "chrome/browser/search_engines/template_url_service_factory.h" |
25 #include "chrome/browser/sync/profile_sync_service_factory.h" | 26 #include "chrome/browser/sync/profile_sync_service_factory.h" |
26 #include "chrome/common/chrome_features.h" | 27 #include "chrome/common/chrome_features.h" |
27 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
28 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
29 #include "components/browser_sync/profile_sync_service.h" | 30 #include "components/browser_sync/profile_sync_service.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 #if BUILDFLAG(ENABLE_EXTENSIONS) | 147 #if BUILDFLAG(ENABLE_EXTENSIONS) |
147 return base::MakeUnique<KeywordExtensionsDelegateImpl>(profile_, | 148 return base::MakeUnique<KeywordExtensionsDelegateImpl>(profile_, |
148 keyword_provider); | 149 keyword_provider); |
149 #else | 150 #else |
150 return nullptr; | 151 return nullptr; |
151 #endif | 152 #endif |
152 } | 153 } |
153 | 154 |
154 physical_web::PhysicalWebDataSource* | 155 physical_web::PhysicalWebDataSource* |
155 ChromeAutocompleteProviderClient::GetPhysicalWebDataSource() { | 156 ChromeAutocompleteProviderClient::GetPhysicalWebDataSource() { |
156 return nullptr; | 157 return g_browser_process->GetPhysicalWebDataSource(); |
157 } | 158 } |
158 | 159 |
159 std::string ChromeAutocompleteProviderClient::GetAcceptLanguages() const { | 160 std::string ChromeAutocompleteProviderClient::GetAcceptLanguages() const { |
160 return profile_->GetPrefs()->GetString(prefs::kAcceptLanguages); | 161 return profile_->GetPrefs()->GetString(prefs::kAcceptLanguages); |
161 } | 162 } |
162 | 163 |
163 std::string | 164 std::string |
164 ChromeAutocompleteProviderClient::GetEmbedderRepresentationOfAboutScheme() { | 165 ChromeAutocompleteProviderClient::GetEmbedderRepresentationOfAboutScheme() { |
165 return content::kChromeUIScheme; | 166 return content::kChromeUIScheme; |
166 } | 167 } |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 image_service->Prefetch(url); | 251 image_service->Prefetch(url); |
251 } | 252 } |
252 | 253 |
253 void ChromeAutocompleteProviderClient::OnAutocompleteControllerResultReady( | 254 void ChromeAutocompleteProviderClient::OnAutocompleteControllerResultReady( |
254 AutocompleteController* controller) { | 255 AutocompleteController* controller) { |
255 content::NotificationService::current()->Notify( | 256 content::NotificationService::current()->Notify( |
256 chrome::NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY, | 257 chrome::NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY, |
257 content::Source<AutocompleteController>(controller), | 258 content::Source<AutocompleteController>(controller), |
258 content::NotificationService::NoDetails()); | 259 content::NotificationService::NoDetails()); |
259 } | 260 } |
OLD | NEW |