| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |