| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 MediaRouterFactory::~MediaRouterFactory() { | 62 MediaRouterFactory::~MediaRouterFactory() { |
| 63 } | 63 } |
| 64 | 64 |
| 65 content::BrowserContext* MediaRouterFactory::GetBrowserContextToUse( | 65 content::BrowserContext* MediaRouterFactory::GetBrowserContextToUse( |
| 66 content::BrowserContext* context) const { | 66 content::BrowserContext* context) const { |
| 67 return chrome::GetBrowserContextRedirectedInIncognito(context); | 67 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 68 } | 68 } |
| 69 | 69 |
| 70 KeyedService* MediaRouterFactory::BuildServiceInstanceFor( | 70 KeyedService* MediaRouterFactory::BuildServiceInstanceFor( |
| 71 BrowserContext* context) const { | 71 BrowserContext* context) const { |
| 72 MediaRouterBase* media_router = nullptr; |
| 72 #if defined(OS_ANDROID) | 73 #if defined(OS_ANDROID) |
| 73 return new MediaRouterAndroid(context); | 74 media_router = new MediaRouterAndroid(context); |
| 74 #else | 75 #else |
| 75 return new MediaRouterMojoImpl(extensions::ProcessManager::Get(context)); | 76 media_router = |
| 77 new MediaRouterMojoImpl(extensions::ProcessManager::Get(context)); |
| 76 #endif | 78 #endif |
| 79 media_router->Initialize(); |
| 80 return media_router; |
| 77 } | 81 } |
| 78 | 82 |
| 79 } // namespace media_router | 83 } // namespace media_router |
| OLD | NEW |