Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |