Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: chrome/browser/search_engines/template_url_service_factory.cc

Issue 1477783004: Add a preference to control Windows desktop search redirection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile error. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/ui/startup/startup_browser_creator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/search_engines/template_url_service_factory.h" 5 #include "chrome/browser/search_engines/template_url_service_factory.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/google/google_url_tracker_factory.h" 12 #include "chrome/browser/google/google_url_tracker_factory.h"
13 #include "chrome/browser/history/history_service_factory.h" 13 #include "chrome/browser/history/history_service_factory.h"
14 #include "chrome/browser/profiles/incognito_helpers.h" 14 #include "chrome/browser/profiles/incognito_helpers.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/search_engines/chrome_template_url_service_client.h" 16 #include "chrome/browser/search_engines/chrome_template_url_service_client.h"
17 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" 17 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
18 #include "chrome/browser/web_data_service_factory.h" 18 #include "chrome/browser/web_data_service_factory.h"
19 #include "components/keyed_service/content/browser_context_dependency_manager.h" 19 #include "components/keyed_service/content/browser_context_dependency_manager.h"
20 #include "components/pref_registry/pref_registry_syncable.h" 20 #include "components/pref_registry/pref_registry_syncable.h"
21 #include "components/search_engines/default_search_manager.h" 21 #include "components/search_engines/default_search_manager.h"
22 #include "components/search_engines/search_engines_pref_names.h" 22 #include "components/search_engines/search_engines_pref_names.h"
23 #include "components/search_engines/template_url_service.h" 23 #include "components/search_engines/template_url_service.h"
24 24
25 #if defined(OS_WIN)
26 #include "components/search_engines/desktop_search_win.h"
27 #endif // defined(OS_WIN)
28
25 #if defined(ENABLE_RLZ) 29 #if defined(ENABLE_RLZ)
26 #include "components/rlz/rlz_tracker.h" 30 #include "components/rlz/rlz_tracker.h"
27 #endif 31 #endif
28 32
29 // static 33 // static
30 TemplateURLService* TemplateURLServiceFactory::GetForProfile(Profile* profile) { 34 TemplateURLService* TemplateURLServiceFactory::GetForProfile(Profile* profile) {
31 return static_cast<TemplateURLService*>( 35 return static_cast<TemplateURLService*>(
32 GetInstance()->GetServiceForBrowserContext(profile, true)); 36 GetInstance()->GetServiceForBrowserContext(profile, true));
33 } 37 }
34 38
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 76
73 KeyedService* TemplateURLServiceFactory::BuildServiceInstanceFor( 77 KeyedService* TemplateURLServiceFactory::BuildServiceInstanceFor(
74 content::BrowserContext* profile) const { 78 content::BrowserContext* profile) const {
75 return BuildInstanceFor(static_cast<Profile*>(profile)).release(); 79 return BuildInstanceFor(static_cast<Profile*>(profile)).release();
76 } 80 }
77 81
78 void TemplateURLServiceFactory::RegisterProfilePrefs( 82 void TemplateURLServiceFactory::RegisterProfilePrefs(
79 user_prefs::PrefRegistrySyncable* registry) { 83 user_prefs::PrefRegistrySyncable* registry) {
80 DefaultSearchManager::RegisterProfilePrefs(registry); 84 DefaultSearchManager::RegisterProfilePrefs(registry);
81 TemplateURLService::RegisterProfilePrefs(registry); 85 TemplateURLService::RegisterProfilePrefs(registry);
86 #if defined(OS_WIN)
87 RegisterWindowsDesktopSearchRedirectionPref(registry);
88 #endif
82 } 89 }
83 90
84 content::BrowserContext* TemplateURLServiceFactory::GetBrowserContextToUse( 91 content::BrowserContext* TemplateURLServiceFactory::GetBrowserContextToUse(
85 content::BrowserContext* context) const { 92 content::BrowserContext* context) const {
86 return chrome::GetBrowserContextRedirectedInIncognito(context); 93 return chrome::GetBrowserContextRedirectedInIncognito(context);
87 } 94 }
88 95
89 bool TemplateURLServiceFactory::ServiceIsNULLWhileTesting() const { 96 bool TemplateURLServiceFactory::ServiceIsNULLWhileTesting() const {
90 return true; 97 return true;
91 } 98 }
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/ui/startup/startup_browser_creator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698