Re-enable index-basics-workers test to see if still times
[chromium-blink-merge.git] / apps / app_restore_service_factory.cc
blob71dd80b5820aa5e870c181b4c5cca78099f5ae25
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"
11 namespace apps {
13 // static
14 AppRestoreService* AppRestoreServiceFactory::GetForProfile(Profile* profile) {
15 return static_cast<AppRestoreService*>(
16 GetInstance()->GetServiceForProfile(profile, true));
19 // static
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 {
44 return true;
47 } // namespace apps