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.
5 #include "base/basictypes.h"
6 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
8 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_FACTORY_H_
9 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_FACTORY_H_
11 template<typename T
> struct DefaultSingletonTraits
;
15 } // namespace content
17 namespace file_manager
{
21 // Factory to create VolumeManager.
22 class VolumeManagerFactory
: public BrowserContextKeyedServiceFactory
{
24 // Returns VolumeManager instance.
25 static VolumeManager
* Get(content::BrowserContext
* context
);
27 static VolumeManagerFactory
* GetInstance();
30 // BrowserContextKeyedBaseFactory overrides:
31 content::BrowserContext
* GetBrowserContextToUse(
32 content::BrowserContext
* context
) const override
;
33 bool ServiceIsCreatedWithBrowserContext() const override
;
34 bool ServiceIsNULLWhileTesting() const override
;
36 // BrowserContextKeyedServiceFactory overrides:
37 KeyedService
* BuildServiceInstanceFor(
38 content::BrowserContext
* context
) const override
;
42 friend struct DefaultSingletonTraits
<VolumeManagerFactory
>;
44 VolumeManagerFactory();
45 ~VolumeManagerFactory() override
;
47 DISALLOW_COPY_AND_ASSIGN(VolumeManagerFactory
);
50 } // namespace file_manager
52 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_FACTORY_H_