event_router_factory.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2015 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.
  4. #ifndef EXTENSIONS_BROWSER_EVENT_ROUTER_FACTORY_H_
  5. #define EXTENSIONS_BROWSER_EVENT_ROUTER_FACTORY_H_
  6. #include "base/memory/singleton.h"
  7. #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
  8. namespace extensions {
  9. class EventRouter;
  10. class EventRouterFactory : public BrowserContextKeyedServiceFactory {
  11. public:
  12. EventRouterFactory(const EventRouterFactory&) = delete;
  13. EventRouterFactory& operator=(const EventRouterFactory&) = delete;
  14. static EventRouter* GetForBrowserContext(content::BrowserContext* context);
  15. static EventRouterFactory* GetInstance();
  16. private:
  17. friend struct base::DefaultSingletonTraits<EventRouterFactory>;
  18. EventRouterFactory();
  19. ~EventRouterFactory() override;
  20. // BrowserContextKeyedServiceFactory implementation
  21. KeyedService* BuildServiceInstanceFor(
  22. content::BrowserContext* context) const override;
  23. content::BrowserContext* GetBrowserContextToUse(
  24. content::BrowserContext* context) const override;
  25. };
  26. } // namespace extensions
  27. #endif // EXTENSIONS_BROWSER_EVENT_ROUTER_FACTORY_H_