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

Side by Side 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, 2 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 unified diff | Download patch
OLDNEW
(Empty)
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
5 #include "chrome/browser/media/router/offscreen_presentation_manager_factory.h"
6
7 #include "base/lazy_instance.h"
8 #include "chrome/browser/media/router/offscreen_presentation_manager.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10
11 namespace media_router {
12
13 namespace {
14
15 base::LazyInstance<OffscreenPresentationManagerFactory> service_factory =
16 LAZY_INSTANCE_INITIALIZER;
17
18 } // namespace
19
20 // static
21 OffscreenPresentationManager*
22 OffscreenPresentationManagerFactory::GetOrCreateForBrowserContext(
23 content::BrowserContext* context) {
24 DCHECK(context);
25 return static_cast<OffscreenPresentationManager*>(
26 service_factory.Get().GetServiceForBrowserContext(context, true));
27 }
28
29 OffscreenPresentationManagerFactory::OffscreenPresentationManagerFactory()
30 : BrowserContextKeyedServiceFactory(
31 "OffscreenPresentationManager",
32 BrowserContextDependencyManager::GetInstance()) {}
33 OffscreenPresentationManagerFactory::~OffscreenPresentationManagerFactory() {}
34
35 KeyedService* OffscreenPresentationManagerFactory::BuildServiceInstanceFor(
36 content::BrowserContext* context) const {
37 return new OffscreenPresentationManager;
38 }
39
40 content::BrowserContext*
41 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
42 content::BrowserContext* context) const {
43 return context;
44 }
45
46 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698