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" |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "chrome/browser/sync/profile_sync_service_factory.h" | 26 #include "chrome/browser/sync/profile_sync_service_factory.h" |
27 #include "chrome/common/chrome_features.h" | 27 #include "chrome/common/chrome_features.h" |
28 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
29 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
30 #include "components/browser_sync/profile_sync_service.h" | 30 #include "components/browser_sync/profile_sync_service.h" |
31 #include "components/history/core/browser/history_service.h" | 31 #include "components/history/core/browser/history_service.h" |
32 #include "components/omnibox/browser/autocomplete_classifier.h" | 32 #include "components/omnibox/browser/autocomplete_classifier.h" |
33 #include "components/prefs/pref_service.h" | 33 #include "components/prefs/pref_service.h" |
34 #include "components/sync/driver/sync_service_utils.h" | 34 #include "components/sync/driver/sync_service_utils.h" |
35 #include "content/public/browser/notification_service.h" | 35 #include "content/public/browser/notification_service.h" |
| 36 #include "content/public/common/url_constants.h" |
36 #include "extensions/features/features.h" | 37 #include "extensions/features/features.h" |
37 #include "net/traffic_annotation/network_traffic_annotation.h" | 38 #include "net/traffic_annotation/network_traffic_annotation.h" |
38 | 39 |
39 #if BUILDFLAG(ENABLE_EXTENSIONS) | 40 #if BUILDFLAG(ENABLE_EXTENSIONS) |
40 #include "chrome/browser/autocomplete/keyword_extensions_delegate_impl.h" | 41 #include "chrome/browser/autocomplete/keyword_extensions_delegate_impl.h" |
41 #endif | 42 #endif |
42 | 43 |
43 #if !defined(OS_ANDROID) | 44 #if !defined(OS_ANDROID) |
44 namespace { | 45 namespace { |
45 | 46 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 chrome::kChromeHostURLs + chrome::kNumberOfChromeHostURLs); | 175 chrome::kChromeHostURLs + chrome::kNumberOfChromeHostURLs); |
175 std::sort(chrome_builtins.begin(), chrome_builtins.end()); | 176 std::sort(chrome_builtins.begin(), chrome_builtins.end()); |
176 | 177 |
177 std::vector<base::string16> builtins; | 178 std::vector<base::string16> builtins; |
178 | 179 |
179 for (std::vector<std::string>::iterator i(chrome_builtins.begin()); | 180 for (std::vector<std::string>::iterator i(chrome_builtins.begin()); |
180 i != chrome_builtins.end(); ++i) | 181 i != chrome_builtins.end(); ++i) |
181 builtins.push_back(base::ASCIIToUTF16(*i)); | 182 builtins.push_back(base::ASCIIToUTF16(*i)); |
182 | 183 |
183 #if !defined(OS_ANDROID) | 184 #if !defined(OS_ANDROID) |
184 base::string16 settings(base::ASCIIToUTF16(chrome::kChromeUISettingsHost) + | 185 base::string16 settings(base::ASCIIToUTF16(content::kChromeUISettingsHost) + |
185 base::ASCIIToUTF16("/")); | 186 base::ASCIIToUTF16("/")); |
186 for (size_t i = 0; i < arraysize(kChromeSettingsSubPages); i++) { | 187 for (size_t i = 0; i < arraysize(kChromeSettingsSubPages); i++) { |
187 builtins.push_back(settings + | 188 builtins.push_back(settings + |
188 base::ASCIIToUTF16(kChromeSettingsSubPages[i])); | 189 base::ASCIIToUTF16(kChromeSettingsSubPages[i])); |
189 } | 190 } |
190 | 191 |
191 if (!base::FeatureList::IsEnabled(features::kMaterialDesignSettings)) { | 192 if (!base::FeatureList::IsEnabled(features::kMaterialDesignSettings)) { |
192 builtins.push_back( | 193 builtins.push_back( |
193 settings + | 194 settings + |
194 base::ASCIIToUTF16( | 195 base::ASCIIToUTF16( |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 image_service->Prefetch(url, traffic_annotation); | 294 image_service->Prefetch(url, traffic_annotation); |
294 } | 295 } |
295 | 296 |
296 void ChromeAutocompleteProviderClient::OnAutocompleteControllerResultReady( | 297 void ChromeAutocompleteProviderClient::OnAutocompleteControllerResultReady( |
297 AutocompleteController* controller) { | 298 AutocompleteController* controller) { |
298 content::NotificationService::current()->Notify( | 299 content::NotificationService::current()->Notify( |
299 chrome::NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY, | 300 chrome::NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY, |
300 content::Source<AutocompleteController>(controller), | 301 content::Source<AutocompleteController>(controller), |
301 content::NotificationService::NoDetails()); | 302 content::NotificationService::NoDetails()); |
302 } | 303 } |
OLD | NEW |