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/sessions/app_restore_service_factory.h" |
| 6 |
| 7 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 8 #include "chrome/browser/sessions/app_restore_service.h" |
| 9 |
| 10 // static |
| 11 AppRestoreService* AppRestoreServiceFactory::GetForProfile(Profile* profile) { |
| 12 return static_cast<AppRestoreService*>( |
| 13 GetInstance()->GetServiceForProfile(profile, true)); |
| 14 } |
| 15 |
| 16 // static |
| 17 void AppRestoreServiceFactory::ResetForProfile(Profile* profile) { |
| 18 AppRestoreServiceFactory* factory = GetInstance(); |
| 19 factory->ProfileShutdown(profile); |
| 20 factory->ProfileDestroyed(profile); |
| 21 } |
| 22 |
| 23 AppRestoreServiceFactory* AppRestoreServiceFactory::GetInstance() { |
| 24 return Singleton<AppRestoreServiceFactory>::get(); |
| 25 } |
| 26 |
| 27 AppRestoreServiceFactory::AppRestoreServiceFactory() |
| 28 : ProfileKeyedServiceFactory("AppRestoreService", |
| 29 ProfileDependencyManager::GetInstance()) { |
| 30 } |
| 31 |
| 32 AppRestoreServiceFactory::~AppRestoreServiceFactory() { |
| 33 } |
| 34 |
| 35 ProfileKeyedService* AppRestoreServiceFactory::BuildServiceInstanceFor( |
| 36 Profile* profile) const { |
| 37 AppRestoreService* service = NULL; |
| 38 service = new AppRestoreService(profile); |
| 39 return service; |
| 40 } |
| 41 |
| 42 bool AppRestoreServiceFactory::ServiceIsNULLWhileTesting() { |
| 43 return true; |
| 44 } |
| 45 |
| 46 bool AppRestoreServiceFactory::ServiceIsCreatedWithProfile() { |
| 47 return true; |
| 48 } |
| 49 |
OLD | NEW |