local_presentation_manager_factory.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 WEBLAYER_BROWSER_MEDIA_LOCAL_PRESENTATION_MANAGER_FACTORY_H_
  5. #define WEBLAYER_BROWSER_MEDIA_LOCAL_PRESENTATION_MANAGER_FACTORY_H_
  6. #include "base/no_destructor.h"
  7. #include "components/media_router/browser/presentation/local_presentation_manager_factory.h"
  8. namespace content {
  9. class BrowserContext;
  10. }
  11. namespace weblayer {
  12. // A version of LocalPresentationManagerFactory that does not redirect from
  13. // incognito to normal context.
  14. class LocalPresentationManagerFactory
  15. : public media_router::LocalPresentationManagerFactory {
  16. public:
  17. LocalPresentationManagerFactory(const LocalPresentationManagerFactory&) =
  18. delete;
  19. LocalPresentationManagerFactory& operator=(
  20. const LocalPresentationManagerFactory&) = delete;
  21. static LocalPresentationManagerFactory* GetInstance();
  22. private:
  23. friend base::NoDestructor<LocalPresentationManagerFactory>;
  24. LocalPresentationManagerFactory();
  25. ~LocalPresentationManagerFactory() override;
  26. // BrowserContextKeyedServiceFactory interface.
  27. content::BrowserContext* GetBrowserContextToUse(
  28. content::BrowserContext* context) const override;
  29. };
  30. } // namespace weblayer
  31. #endif // WEBLAYER_BROWSER_MEDIA_LOCAL_PRESENTATION_MANAGER_FACTORY_H_