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/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" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 TemplateURLServiceFactory::~TemplateURLServiceFactory() {} | 70 TemplateURLServiceFactory::~TemplateURLServiceFactory() {} |
71 | 71 |
72 KeyedService* TemplateURLServiceFactory::BuildServiceInstanceFor( | 72 KeyedService* TemplateURLServiceFactory::BuildServiceInstanceFor( |
73 content::BrowserContext* profile) const { | 73 content::BrowserContext* profile) const { |
74 return BuildInstanceFor(static_cast<Profile*>(profile)).release(); | 74 return BuildInstanceFor(static_cast<Profile*>(profile)).release(); |
75 } | 75 } |
76 | 76 |
77 void TemplateURLServiceFactory::RegisterProfilePrefs( | 77 void TemplateURLServiceFactory::RegisterProfilePrefs( |
78 user_prefs::PrefRegistrySyncable* registry) { | 78 user_prefs::PrefRegistrySyncable* registry) { |
79 DefaultSearchManager::RegisterProfilePrefs(registry); | 79 DefaultSearchManager::RegisterProfilePrefs(registry); |
80 registry->RegisterStringPref(prefs::kSyncedDefaultSearchProviderGUID, | 80 TemplateURLService::RegisterProfilePrefs(registry); |
81 std::string(), | |
82 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
83 registry->RegisterBooleanPref(prefs::kDefaultSearchProviderEnabled, true); | |
84 registry->RegisterStringPref(prefs::kDefaultSearchProviderName, | |
85 std::string()); | |
86 registry->RegisterStringPref(prefs::kDefaultSearchProviderID, std::string()); | |
87 registry->RegisterStringPref(prefs::kDefaultSearchProviderPrepopulateID, | |
88 std::string()); | |
89 registry->RegisterStringPref(prefs::kDefaultSearchProviderSuggestURL, | |
90 std::string()); | |
91 registry->RegisterStringPref(prefs::kDefaultSearchProviderSearchURL, | |
92 std::string()); | |
93 registry->RegisterStringPref(prefs::kDefaultSearchProviderInstantURL, | |
94 std::string()); | |
95 registry->RegisterStringPref(prefs::kDefaultSearchProviderImageURL, | |
96 std::string()); | |
97 registry->RegisterStringPref(prefs::kDefaultSearchProviderNewTabURL, | |
98 std::string()); | |
99 registry->RegisterStringPref(prefs::kDefaultSearchProviderSearchURLPostParams, | |
100 std::string()); | |
101 registry->RegisterStringPref( | |
102 prefs::kDefaultSearchProviderSuggestURLPostParams, std::string()); | |
103 registry->RegisterStringPref( | |
104 prefs::kDefaultSearchProviderInstantURLPostParams, std::string()); | |
105 registry->RegisterStringPref(prefs::kDefaultSearchProviderImageURLPostParams, | |
106 std::string()); | |
107 registry->RegisterStringPref(prefs::kDefaultSearchProviderKeyword, | |
108 std::string()); | |
109 registry->RegisterStringPref(prefs::kDefaultSearchProviderIconURL, | |
110 std::string()); | |
111 registry->RegisterStringPref(prefs::kDefaultSearchProviderEncodings, | |
112 std::string()); | |
113 registry->RegisterListPref(prefs::kDefaultSearchProviderAlternateURLs); | |
114 registry->RegisterStringPref( | |
115 prefs::kDefaultSearchProviderSearchTermsReplacementKey, std::string()); | |
116 } | 81 } |
117 | 82 |
118 content::BrowserContext* TemplateURLServiceFactory::GetBrowserContextToUse( | 83 content::BrowserContext* TemplateURLServiceFactory::GetBrowserContextToUse( |
119 content::BrowserContext* context) const { | 84 content::BrowserContext* context) const { |
120 return chrome::GetBrowserContextRedirectedInIncognito(context); | 85 return chrome::GetBrowserContextRedirectedInIncognito(context); |
121 } | 86 } |
122 | 87 |
123 bool TemplateURLServiceFactory::ServiceIsNULLWhileTesting() const { | 88 bool TemplateURLServiceFactory::ServiceIsNULLWhileTesting() const { |
124 return true; | 89 return true; |
125 } | 90 } |
OLD | NEW |