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