Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1830)

Unified Diff: chrome/browser/media/router/offscreen_presentation_manager_factory.cc

Issue 1314413005: [Presentation API] 1-UA presentation support + presenter APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Yuri's comments; rework of the OffscreenPresentationManager interface Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/router/offscreen_presentation_manager_factory.cc
diff --git a/chrome/browser/media/router/offscreen_presentation_manager_factory.cc b/chrome/browser/media/router/offscreen_presentation_manager_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d42fa372a3f0f0439fe5c348970fe7e849377ea3
--- /dev/null
+++ b/chrome/browser/media/router/offscreen_presentation_manager_factory.cc
@@ -0,0 +1,46 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/media/router/offscreen_presentation_manager_factory.h"
+
+#include "base/lazy_instance.h"
+#include "chrome/browser/media/router/offscreen_presentation_manager.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+
+namespace media_router {
+
+namespace {
+
+base::LazyInstance<OffscreenPresentationManagerFactory> service_factory =
+ LAZY_INSTANCE_INITIALIZER;
+
+} // namespace
+
+// static
+OffscreenPresentationManager*
+OffscreenPresentationManagerFactory::GetOrCreateForBrowserContext(
+ content::BrowserContext* context) {
+ DCHECK(context);
+ return static_cast<OffscreenPresentationManager*>(
+ service_factory.Get().GetServiceForBrowserContext(context, true));
+}
+
+OffscreenPresentationManagerFactory::OffscreenPresentationManagerFactory()
+ : BrowserContextKeyedServiceFactory(
+ "OffscreenPresentationManager",
+ BrowserContextDependencyManager::GetInstance()) {}
+OffscreenPresentationManagerFactory::~OffscreenPresentationManagerFactory() {}
+
+KeyedService* OffscreenPresentationManagerFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ return new OffscreenPresentationManager;
+}
+
+content::BrowserContext*
+OffscreenPresentationManagerFactory::GetBrowserContextToUse(
mark a. foltz 2015/10/01 18:39:13 Will this return the same OPM for a profile and an
imcheng 2015/10/06 00:59:14 So in ReceiverPresentationServiceDelegate we expli
+ content::BrowserContext* context) const {
+ return context;
+}
+
+} // namespace media_router

Powered by Google App Engine
This is Rietveld 408576698