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

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

Issue 229763005: Store default search provider data in dictionary pref. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Eriks comments and clean up Created 6 years, 8 months 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 | Annotate | Revision Log
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/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "chrome/browser/google/google_url_tracker_factory.h" 10 #include "chrome/browser/google/google_url_tracker_factory.h"
11 #include "chrome/browser/history/history_service_factory.h" 11 #include "chrome/browser/history/history_service_factory.h"
12 #include "chrome/browser/profiles/incognito_helpers.h" 12 #include "chrome/browser/profiles/incognito_helpers.h"
13 #include "chrome/browser/search_engines/default_search_manager.h"
13 #include "chrome/browser/search_engines/template_url_service.h" 14 #include "chrome/browser/search_engines/template_url_service.h"
14 #include "chrome/browser/webdata/web_data_service_factory.h" 15 #include "chrome/browser/webdata/web_data_service_factory.h"
15 #include "chrome/common/pref_names.h" 16 #include "chrome/common/pref_names.h"
16 #include "components/keyed_service/content/browser_context_dependency_manager.h" 17 #include "components/keyed_service/content/browser_context_dependency_manager.h"
17 #include "components/user_prefs/pref_registry_syncable.h" 18 #include "components/user_prefs/pref_registry_syncable.h"
18 19
19 // static 20 // static
20 TemplateURLService* TemplateURLServiceFactory::GetForProfile(Profile* profile) { 21 TemplateURLService* TemplateURLServiceFactory::GetForProfile(Profile* profile) {
21 return static_cast<TemplateURLService*>( 22 return static_cast<TemplateURLService*>(
22 GetInstance()->GetServiceForBrowserContext(profile, true)); 23 GetInstance()->GetServiceForBrowserContext(profile, true));
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 registry->RegisterStringPref( 118 registry->RegisterStringPref(
118 prefs::kDefaultSearchProviderEncodings, 119 prefs::kDefaultSearchProviderEncodings,
119 std::string(), 120 std::string(),
120 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 121 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
121 registry->RegisterListPref(prefs::kDefaultSearchProviderAlternateURLs, 122 registry->RegisterListPref(prefs::kDefaultSearchProviderAlternateURLs,
122 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 123 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
123 registry->RegisterStringPref( 124 registry->RegisterStringPref(
124 prefs::kDefaultSearchProviderSearchTermsReplacementKey, 125 prefs::kDefaultSearchProviderSearchTermsReplacementKey,
125 std::string(), 126 std::string(),
126 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 127 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
128 DefaultSearchManager::RegisterProfilePrefs(registry);
gab 2014/04/23 20:00:18 I would prefer having this call at the top before
Cait (Slow) 2014/04/23 23:26:55 Done.
127 } 129 }
128 130
129 content::BrowserContext* TemplateURLServiceFactory::GetBrowserContextToUse( 131 content::BrowserContext* TemplateURLServiceFactory::GetBrowserContextToUse(
130 content::BrowserContext* context) const { 132 content::BrowserContext* context) const {
131 return chrome::GetBrowserContextRedirectedInIncognito(context); 133 return chrome::GetBrowserContextRedirectedInIncognito(context);
132 } 134 }
133 135
134 bool TemplateURLServiceFactory::ServiceIsNULLWhileTesting() const { 136 bool TemplateURLServiceFactory::ServiceIsNULLWhileTesting() const {
135 return true; 137 return true;
136 } 138 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698