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.
5 #include "apps/app_restore_service_factory.h"
7 #include "apps/app_restore_service.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/profiles/profile_dependency_manager.h"
14 AppRestoreService
* AppRestoreServiceFactory::GetForProfile(Profile
* profile
) {
15 return static_cast<AppRestoreService
*>(
16 GetInstance()->GetServiceForProfile(profile
, true));
20 void AppRestoreServiceFactory::ResetForProfile(Profile
* profile
) {
21 AppRestoreServiceFactory
* factory
= GetInstance();
22 factory
->ProfileShutdown(profile
);
23 factory
->ProfileDestroyed(profile
);
26 AppRestoreServiceFactory
* AppRestoreServiceFactory::GetInstance() {
27 return Singleton
<AppRestoreServiceFactory
>::get();
30 AppRestoreServiceFactory::AppRestoreServiceFactory()
31 : ProfileKeyedServiceFactory("AppRestoreService",
32 ProfileDependencyManager::GetInstance()) {
35 AppRestoreServiceFactory::~AppRestoreServiceFactory() {
38 ProfileKeyedService
* AppRestoreServiceFactory::BuildServiceInstanceFor(
39 content::BrowserContext
* profile
) const {
40 return new AppRestoreService(static_cast<Profile
*>(profile
));
43 bool AppRestoreServiceFactory::ServiceIsCreatedWithProfile() const {