| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/media/router/offscreen_presentation_manager_factory.h" | 5 #include "chrome/browser/media/router/offscreen_presentation_manager_factory.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 | 8 |
| 9 #include "chrome/browser/media/router/offscreen_presentation_manager.h" | 9 #include "chrome/browser/media/router/offscreen_presentation_manager.h" |
| 10 #include "chrome/browser/profiles/incognito_helpers.h" | 10 #include "chrome/browser/profiles/incognito_helpers.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 12 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
| 14 | 14 |
| 15 namespace media_router { | 15 namespace media_router { |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 base::LazyInstance<OffscreenPresentationManagerFactory> service_factory = | 19 base::LazyInstance<OffscreenPresentationManagerFactory>::DestructorAtExit |
| 20 LAZY_INSTANCE_INITIALIZER; | 20 service_factory = LAZY_INSTANCE_INITIALIZER; |
| 21 | 21 |
| 22 } // namespace | 22 } // namespace |
| 23 | 23 |
| 24 // static | 24 // static |
| 25 OffscreenPresentationManager* | 25 OffscreenPresentationManager* |
| 26 OffscreenPresentationManagerFactory::GetOrCreateForWebContents( | 26 OffscreenPresentationManagerFactory::GetOrCreateForWebContents( |
| 27 content::WebContents* web_contents) { | 27 content::WebContents* web_contents) { |
| 28 DCHECK(web_contents); | 28 DCHECK(web_contents); |
| 29 return OffscreenPresentationManagerFactory::GetOrCreateForBrowserContext( | 29 return OffscreenPresentationManagerFactory::GetOrCreateForBrowserContext( |
| 30 web_contents->GetBrowserContext()); | 30 web_contents->GetBrowserContext()); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 56 OffscreenPresentationManagerFactory::GetBrowserContextToUse( | 56 OffscreenPresentationManagerFactory::GetBrowserContextToUse( |
| 57 content::BrowserContext* context) const { | 57 content::BrowserContext* context) const { |
| 58 return chrome::GetBrowserContextRedirectedInIncognito(context); | 58 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 59 } | 59 } |
| 60 KeyedService* OffscreenPresentationManagerFactory::BuildServiceInstanceFor( | 60 KeyedService* OffscreenPresentationManagerFactory::BuildServiceInstanceFor( |
| 61 content::BrowserContext* context) const { | 61 content::BrowserContext* context) const { |
| 62 return new OffscreenPresentationManager; | 62 return new OffscreenPresentationManager; |
| 63 } | 63 } |
| 64 | 64 |
| 65 } // namespace media_router | 65 } // namespace media_router |
| OLD | NEW |