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

Side by Side Diff: chrome/browser/media/router/offscreen_presentation_manager_factory.cc

Issue 2343013002: [Presentation API] (MR side) 1-UA: notify receiver page when receiver connection becomes available (Closed)
Patch Set: resolve code review comments from Derek Created 4 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 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 "chrome/browser/profiles/incognito_helpers.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11
12 namespace media_router {
13
14 namespace {
15
16 base::LazyInstance<OffscreenPresentationManagerFactory> service_factory =
17 LAZY_INSTANCE_INITIALIZER;
18
19 } // namespace
20
21 // static
22 OffscreenPresentationManager*
23 OffscreenPresentationManagerFactory::GetOrCreateForBrowserContext(
24 content::BrowserContext* context) {
25 DCHECK(context);
26 return static_cast<OffscreenPresentationManager*>(
27 service_factory.Get().GetServiceForBrowserContext(context, true));
28 }
29
30 OffscreenPresentationManagerFactory::OffscreenPresentationManagerFactory()
31 : BrowserContextKeyedServiceFactory(
32 "OffscreenPresentationManager",
33 BrowserContextDependencyManager::GetInstance()) {}
34 OffscreenPresentationManagerFactory::~OffscreenPresentationManagerFactory() {}
35
36 content::BrowserContext*
37 OffscreenPresentationManagerFactory::GetBrowserContextToUse(
38 content::BrowserContext* context) const {
39 return chrome::GetBrowserContextRedirectedInIncognito(context);
40 }
41 KeyedService* OffscreenPresentationManagerFactory::BuildServiceInstanceFor(
42 content::BrowserContext* context) const {
43 return new OffscreenPresentationManager;
44 }
45
46 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698