| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_PRIVATE_API
_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_FACTORY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_PRIVATE_API
_FACTORY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 10 | 10 |
| 11 class Profile; | 11 class Profile; |
| 12 | 12 |
| 13 namespace file_manager { | 13 namespace file_manager { |
| 14 | 14 |
| 15 class FileManagerPrivateAPI; | 15 class EventRouter; |
| 16 | 16 |
| 17 class FileManagerPrivateAPIFactory : public BrowserContextKeyedServiceFactory { | 17 class EventRouterFactory : public BrowserContextKeyedServiceFactory { |
| 18 public: | 18 public: |
| 19 // Returns the FileManagerPrivateAPI for |profile|, creating it if | 19 // Returns the EventRouter for |profile|, creating it if |
| 20 // it is not yet created. | 20 // it is not yet created. |
| 21 static FileManagerPrivateAPI* GetForProfile(Profile* profile); | 21 static EventRouter* GetForProfile(Profile* profile); |
| 22 | 22 |
| 23 // Returns the FileManagerPrivateAPIFactory instance. | 23 // Returns the EventRouterFactory instance. |
| 24 static FileManagerPrivateAPIFactory* GetInstance(); | 24 static EventRouterFactory* GetInstance(); |
| 25 | 25 |
| 26 protected: | 26 protected: |
| 27 // BrowserContextKeyedBaseFactory overrides: | 27 // BrowserContextKeyedBaseFactory overrides: |
| 28 virtual content::BrowserContext* GetBrowserContextToUse( | 28 virtual content::BrowserContext* GetBrowserContextToUse( |
| 29 content::BrowserContext* context) const OVERRIDE; | 29 content::BrowserContext* context) const OVERRIDE; |
| 30 virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; | 30 virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; |
| 31 virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; | 31 virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 friend struct DefaultSingletonTraits<FileManagerPrivateAPIFactory>; | 34 friend struct DefaultSingletonTraits<EventRouterFactory>; |
| 35 | 35 |
| 36 FileManagerPrivateAPIFactory(); | 36 EventRouterFactory(); |
| 37 virtual ~FileManagerPrivateAPIFactory(); | 37 virtual ~EventRouterFactory(); |
| 38 | 38 |
| 39 // BrowserContextKeyedServiceFactory: | 39 // BrowserContextKeyedServiceFactory: |
| 40 virtual KeyedService* BuildServiceInstanceFor( | 40 virtual KeyedService* BuildServiceInstanceFor( |
| 41 content::BrowserContext* context) const OVERRIDE; | 41 content::BrowserContext* context) const OVERRIDE; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 } // namespace file_manager | 44 } // namespace file_manager |
| 45 | 45 |
| 46 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_PRIVATE_
API_FACTORY_H_ | 46 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_FACTORY_
H_ |
| OLD | NEW |