media_router_factory.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2020 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 COMPONENTS_MEDIA_ROUTER_BROWSER_MEDIA_ROUTER_FACTORY_H_
  5. #define COMPONENTS_MEDIA_ROUTER_BROWSER_MEDIA_ROUTER_FACTORY_H_
  6. #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
  7. namespace content {
  8. class BrowserContext;
  9. }
  10. namespace media_router {
  11. class MediaRouter;
  12. // A factory that lazily returns a MediaRouter implementation for a given
  13. // BrowserContext.
  14. class MediaRouterFactory : public BrowserContextKeyedServiceFactory {
  15. public:
  16. MediaRouterFactory(const MediaRouterFactory&) = delete;
  17. MediaRouterFactory& operator=(const MediaRouterFactory&) = delete;
  18. static MediaRouter* GetApiForBrowserContext(content::BrowserContext* context);
  19. static MediaRouterFactory* GetInstance();
  20. protected:
  21. MediaRouterFactory();
  22. ~MediaRouterFactory() override;
  23. };
  24. } // namespace media_router
  25. #endif // COMPONENTS_MEDIA_ROUTER_BROWSER_MEDIA_ROUTER_FACTORY_H_