OLD | NEW |
| (Empty) |
1 // Copyright 2013 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 "apps/saved_files_service_factory.h" | |
6 | |
7 #include "apps/saved_files_service.h" | |
8 #include "components/keyed_service/content/browser_context_dependency_manager.h" | |
9 #include "content/public/browser/browser_context.h" | |
10 | |
11 namespace apps { | |
12 | |
13 // static | |
14 SavedFilesService* SavedFilesServiceFactory::GetForBrowserContext( | |
15 content::BrowserContext* context) { | |
16 return static_cast<SavedFilesService*>( | |
17 GetInstance()->GetServiceForBrowserContext(context, true)); | |
18 } | |
19 | |
20 // static | |
21 SavedFilesService* SavedFilesServiceFactory::GetForBrowserContextIfExists( | |
22 content::BrowserContext* context) { | |
23 return static_cast<SavedFilesService*>( | |
24 GetInstance()->GetServiceForBrowserContext(context, false)); | |
25 } | |
26 | |
27 // static | |
28 SavedFilesServiceFactory* SavedFilesServiceFactory::GetInstance() { | |
29 return base::Singleton<SavedFilesServiceFactory>::get(); | |
30 } | |
31 | |
32 SavedFilesServiceFactory::SavedFilesServiceFactory() | |
33 : BrowserContextKeyedServiceFactory( | |
34 "SavedFilesService", | |
35 BrowserContextDependencyManager::GetInstance()) {} | |
36 | |
37 SavedFilesServiceFactory::~SavedFilesServiceFactory() {} | |
38 | |
39 KeyedService* SavedFilesServiceFactory::BuildServiceInstanceFor( | |
40 content::BrowserContext* context) const { | |
41 return new SavedFilesService(context); | |
42 } | |
43 | |
44 } // namespace apps | |
OLD | NEW |