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

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

Issue 1024553003: [Suggestions Service] Enable Suggestions Service by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | components/suggestions/suggestions_service.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 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/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/profiles/incognito_helpers.h" 9 #include "chrome/browser/profiles/incognito_helpers.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 10 matching lines...) Expand all
21 #include "components/suggestions/suggestions_store.h" 21 #include "components/suggestions/suggestions_store.h"
22 #include "content/public/browser/browser_context.h" 22 #include "content/public/browser/browser_context.h"
23 #include "content/public/browser/browser_thread.h" 23 #include "content/public/browser/browser_thread.h"
24 24
25 using content::BrowserThread; 25 using content::BrowserThread;
26 26
27 namespace suggestions { 27 namespace suggestions {
28 28
29 // static 29 // static
30 SuggestionsService* SuggestionsServiceFactory::GetForProfile(Profile* profile) { 30 SuggestionsService* SuggestionsServiceFactory::GetForProfile(Profile* profile) {
31 if (!SuggestionsService::IsEnabled())
32 return NULL;
33
34 return static_cast<SuggestionsService*>( 31 return static_cast<SuggestionsService*>(
35 GetInstance()->GetServiceForBrowserContext(profile, true)); 32 GetInstance()->GetServiceForBrowserContext(profile, true));
36 } 33 }
37 34
38 // static 35 // static
39 SuggestionsServiceFactory* SuggestionsServiceFactory::GetInstance() { 36 SuggestionsServiceFactory* SuggestionsServiceFactory::GetInstance() {
40 return Singleton<SuggestionsServiceFactory>::get(); 37 return Singleton<SuggestionsServiceFactory>::get();
41 } 38 }
42 39
43 SuggestionsServiceFactory::SuggestionsServiceFactory() 40 SuggestionsServiceFactory::SuggestionsServiceFactory()
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 the_profile->GetRequestContext(), suggestions_store.Pass(), 72 the_profile->GetRequestContext(), suggestions_store.Pass(),
76 thumbnail_manager.Pass(), blacklist_store.Pass()); 73 thumbnail_manager.Pass(), blacklist_store.Pass());
77 } 74 }
78 75
79 void SuggestionsServiceFactory::RegisterProfilePrefs( 76 void SuggestionsServiceFactory::RegisterProfilePrefs(
80 user_prefs::PrefRegistrySyncable* registry) { 77 user_prefs::PrefRegistrySyncable* registry) {
81 SuggestionsService::RegisterProfilePrefs(registry); 78 SuggestionsService::RegisterProfilePrefs(registry);
82 } 79 }
83 80
84 } // namespace suggestions 81 } // namespace suggestions
OLDNEW
« no previous file with comments | « no previous file | components/suggestions/suggestions_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698