OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/google_now/google_now_service_factory.h" |
| 6 |
| 7 #include "base/memory/singleton.h" |
| 8 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 9 #include "chrome/browser/ui/google_now/google_now_service.h" |
| 10 |
| 11 // static |
| 12 GoogleNowService* GoogleNowServiceFactory::GetForProfile(Profile* profile) { |
| 13 return static_cast<GoogleNowService*>( |
| 14 GetInstance()->GetServiceForProfile(profile, true)); |
| 15 } |
| 16 |
| 17 // static |
| 18 GoogleNowServiceFactory* GoogleNowServiceFactory::GetInstance() { |
| 19 return Singleton<GoogleNowServiceFactory>::get(); |
| 20 } |
| 21 |
| 22 GoogleNowServiceFactory::GoogleNowServiceFactory() |
| 23 : ProfileKeyedServiceFactory( |
| 24 "GoogleNowService", ProfileDependencyManager::GetInstance()) { |
| 25 } |
| 26 |
| 27 bool GoogleNowServiceFactory::ServiceIsCreatedWithProfile() const { |
| 28 return true; |
| 29 } |
| 30 |
| 31 ProfileKeyedService* |
| 32 GoogleNowServiceFactory::BuildServiceInstanceFor(Profile* profile) const { |
| 33 GoogleNowService* const google_now_service = new GoogleNowService(profile); |
| 34 google_now_service->Init(); |
| 35 return google_now_service; |
| 36 } |
OLD | NEW |