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

Side by Side Diff: chrome/browser/search/suggestions/suggestions_service_factory.cc

Issue 271793003: components: Extract pref_registry component out of user_prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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 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/search/suggestions/suggestions_service_factory.h" 5 #include "chrome/browser/search/suggestions/suggestions_service_factory.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/profiles/incognito_helpers.h" 8 #include "chrome/browser/profiles/incognito_helpers.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/search/suggestions/suggestions_service.h" 10 #include "chrome/browser/search/suggestions/suggestions_service.h"
11 #include "chrome/common/pref_names.h" 11 #include "chrome/common/pref_names.h"
12 #include "components/keyed_service/content/browser_context_dependency_manager.h" 12 #include "components/keyed_service/content/browser_context_dependency_manager.h"
13 #include "components/user_prefs/pref_registry_syncable.h" 13 #include "components/pref_registry/pref_registry_syncable.h"
14 14
15 namespace suggestions { 15 namespace suggestions {
16 16
17 // static 17 // static
18 SuggestionsService* SuggestionsServiceFactory::GetForProfile(Profile* profile) { 18 SuggestionsService* SuggestionsServiceFactory::GetForProfile(Profile* profile) {
19 if (!SuggestionsService::IsEnabled()) 19 if (!SuggestionsService::IsEnabled())
20 return NULL; 20 return NULL;
21 21
22 return static_cast<SuggestionsService*>( 22 return static_cast<SuggestionsService*>(
23 GetInstance()->GetServiceForBrowserContext(profile, true)); 23 GetInstance()->GetServiceForBrowserContext(profile, true));
(...skipping 18 matching lines...) Expand all
42 content::BrowserContext* context) const { 42 content::BrowserContext* context) const {
43 return chrome::GetBrowserContextRedirectedInIncognito(context); 43 return chrome::GetBrowserContextRedirectedInIncognito(context);
44 } 44 }
45 45
46 KeyedService* SuggestionsServiceFactory::BuildServiceInstanceFor( 46 KeyedService* SuggestionsServiceFactory::BuildServiceInstanceFor(
47 content::BrowserContext* profile) const { 47 content::BrowserContext* profile) const {
48 return new SuggestionsService(static_cast<Profile*>(profile)); 48 return new SuggestionsService(static_cast<Profile*>(profile));
49 } 49 }
50 50
51 } // namespace suggestions 51 } // namespace suggestions
OLDNEW
« no previous file with comments | « chrome/browser/search/search.cc ('k') | chrome/browser/search_engines/default_search_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698