| 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/media_router_factory.h" | 5 #include "chrome/browser/media/router/media_router_factory.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/browser/profiles/incognito_helpers.h" | 8 #include "chrome/browser/profiles/incognito_helpers.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 BrowserContextDependencyManager::GetInstance()) { | 55 BrowserContextDependencyManager::GetInstance()) { |
| 56 #if !defined(OS_ANDROID) | 56 #if !defined(OS_ANDROID) |
| 57 // On desktop platforms, MediaRouter depends on ProcessManager. | 57 // On desktop platforms, MediaRouter depends on ProcessManager. |
| 58 DependsOn(extensions::ProcessManagerFactory::GetInstance()); | 58 DependsOn(extensions::ProcessManagerFactory::GetInstance()); |
| 59 #endif | 59 #endif |
| 60 } | 60 } |
| 61 | 61 |
| 62 MediaRouterFactory::~MediaRouterFactory() { | 62 MediaRouterFactory::~MediaRouterFactory() { |
| 63 } | 63 } |
| 64 | 64 |
| 65 // static |
| 66 MediaRouterFactory* MediaRouterFactory::GetMediaRouterFactoryForTest() { |
| 67 return &service_factory.Get(); |
| 68 } |
| 69 |
| 65 content::BrowserContext* MediaRouterFactory::GetBrowserContextToUse( | 70 content::BrowserContext* MediaRouterFactory::GetBrowserContextToUse( |
| 66 content::BrowserContext* context) const { | 71 content::BrowserContext* context) const { |
| 67 return chrome::GetBrowserContextRedirectedInIncognito(context); | 72 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 68 } | 73 } |
| 69 | 74 |
| 70 KeyedService* MediaRouterFactory::BuildServiceInstanceFor( | 75 KeyedService* MediaRouterFactory::BuildServiceInstanceFor( |
| 71 BrowserContext* context) const { | 76 BrowserContext* context) const { |
| 72 #if defined(OS_ANDROID) | 77 #if defined(OS_ANDROID) |
| 73 return new MediaRouterAndroid(context); | 78 return new MediaRouterAndroid(context); |
| 74 #else | 79 #else |
| 75 return new MediaRouterMojoImpl(extensions::ProcessManager::Get(context)); | 80 return new MediaRouterMojoImpl(extensions::ProcessManager::Get(context)); |
| 76 #endif | 81 #endif |
| 77 } | 82 } |
| 78 | 83 |
| 79 } // namespace media_router | 84 } // namespace media_router |
| OLD | NEW |