| 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 16 matching lines...) Expand all  Loading... | 
|  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   return static_cast<SuggestionsService*>( |  31   return static_cast<SuggestionsService*>( | 
|  32       GetInstance()->GetServiceForBrowserContext(profile, true)); |  32       GetInstance()->GetServiceForBrowserContext(profile, true)); | 
|  33 } |  33 } | 
|  34  |  34  | 
|  35 // static |  35 // static | 
|  36 SuggestionsServiceFactory* SuggestionsServiceFactory::GetInstance() { |  36 SuggestionsServiceFactory* SuggestionsServiceFactory::GetInstance() { | 
|  37   return Singleton<SuggestionsServiceFactory>::get(); |  37   return base::Singleton<SuggestionsServiceFactory>::get(); | 
|  38 } |  38 } | 
|  39  |  39  | 
|  40 SuggestionsServiceFactory::SuggestionsServiceFactory() |  40 SuggestionsServiceFactory::SuggestionsServiceFactory() | 
|  41     : BrowserContextKeyedServiceFactory( |  41     : BrowserContextKeyedServiceFactory( | 
|  42           "SuggestionsService", |  42           "SuggestionsService", | 
|  43           BrowserContextDependencyManager::GetInstance()) { |  43           BrowserContextDependencyManager::GetInstance()) { | 
|  44   // No dependencies. |  44   // No dependencies. | 
|  45 } |  45 } | 
|  46  |  46  | 
|  47 SuggestionsServiceFactory::~SuggestionsServiceFactory() {} |  47 SuggestionsServiceFactory::~SuggestionsServiceFactory() {} | 
| (...skipping 26 matching lines...) Expand all  Loading... | 
|  74       the_profile->GetRequestContext(), suggestions_store.Pass(), |  74       the_profile->GetRequestContext(), suggestions_store.Pass(), | 
|  75       thumbnail_manager.Pass(), blacklist_store.Pass()); |  75       thumbnail_manager.Pass(), blacklist_store.Pass()); | 
|  76 } |  76 } | 
|  77  |  77  | 
|  78 void SuggestionsServiceFactory::RegisterProfilePrefs( |  78 void SuggestionsServiceFactory::RegisterProfilePrefs( | 
|  79     user_prefs::PrefRegistrySyncable* registry) { |  79     user_prefs::PrefRegistrySyncable* registry) { | 
|  80   SuggestionsService::RegisterProfilePrefs(registry); |  80   SuggestionsService::RegisterProfilePrefs(registry); | 
|  81 } |  81 } | 
|  82  |  82  | 
|  83 }  // namespace suggestions |  83 }  // namespace suggestions | 
| OLD | NEW |