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 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_PRIVATE_API_FACTORY_H_
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_PRIVATE_API_FACTORY_H_
8 #include "base/memory/singleton.h"
9 #include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h"
13 namespace file_manager {
15 class FileBrowserPrivateAPI;
17 class FileBrowserPrivateAPIFactory : public BrowserContextKeyedServiceFactory {
19 // Returns the FileBrowserPrivateAPI for |profile|, creating it if
20 // it is not yet created.
21 static FileBrowserPrivateAPI* GetForProfile(Profile* profile);
23 // Returns the FileBrowserPrivateAPIFactory instance.
24 static FileBrowserPrivateAPIFactory* GetInstance();
27 // BrowserContextKeyedBaseFactory overrides:
28 virtual content::BrowserContext* GetBrowserContextToUse(
29 content::BrowserContext* context) const OVERRIDE;
30 virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE;
31 virtual bool ServiceIsNULLWhileTesting() const OVERRIDE;
34 friend struct DefaultSingletonTraits<FileBrowserPrivateAPIFactory>;
36 FileBrowserPrivateAPIFactory();
37 virtual ~FileBrowserPrivateAPIFactory();
39 // BrowserContextKeyedServiceFactory:
40 virtual BrowserContextKeyedService* BuildServiceInstanceFor(
41 content::BrowserContext* profile) const OVERRIDE;
44 } // namespace file_manager
46 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_PRIVATE_API_FACTORY_H_