Elim cr-checkbox
[chromium-blink-merge.git] / chrome / browser / chromeos / file_manager / volume_manager_factory.h
blob7a87d9b58cb040d9e98bdd6def015c68e9601933
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 namespace base {
12 template <typename T>
13 struct DefaultSingletonTraits;
14 } // namespace base
16 namespace content {
17 class BrowserContext;
18 } // namespace content
20 namespace file_manager {
22 class VolumeManager;
24 // Factory to create VolumeManager.
25 class VolumeManagerFactory : public BrowserContextKeyedServiceFactory {
26 public:
27 // Returns VolumeManager instance.
28 static VolumeManager* Get(content::BrowserContext* context);
30 static VolumeManagerFactory* GetInstance();
32 protected:
33 // BrowserContextKeyedBaseFactory overrides:
34 content::BrowserContext* GetBrowserContextToUse(
35 content::BrowserContext* context) const override;
36 bool ServiceIsCreatedWithBrowserContext() const override;
37 bool ServiceIsNULLWhileTesting() const override;
39 // BrowserContextKeyedServiceFactory overrides:
40 KeyedService* BuildServiceInstanceFor(
41 content::BrowserContext* context) const override;
43 private:
44 // For Singleton.
45 friend struct base::DefaultSingletonTraits<VolumeManagerFactory>;
47 VolumeManagerFactory();
48 ~VolumeManagerFactory() override;
50 DISALLOW_COPY_AND_ASSIGN(VolumeManagerFactory);
53 } // namespace file_manager
55 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_FACTORY_H_