| 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 26 matching lines...) Expand all Loading... |
| 37 return static_cast<MediaRouter*>( | 37 return static_cast<MediaRouter*>( |
| 38 service_factory.Get().GetServiceForBrowserContext(context, true)); | 38 service_factory.Get().GetServiceForBrowserContext(context, true)); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void MediaRouterFactory::BrowserContextShutdown( | 41 void MediaRouterFactory::BrowserContextShutdown( |
| 42 content::BrowserContext* context) { | 42 content::BrowserContext* context) { |
| 43 if (context->IsOffTheRecord()) { | 43 if (context->IsOffTheRecord()) { |
| 44 MediaRouter* router = | 44 MediaRouter* router = |
| 45 static_cast<MediaRouter*>(GetServiceForBrowserContext(context, false)); | 45 static_cast<MediaRouter*>(GetServiceForBrowserContext(context, false)); |
| 46 if (router) | 46 if (router) |
| 47 router->OnOffTheRecordProfileShutdown(); | 47 router->OnIncognitoProfileShutdown(); |
| 48 } | 48 } |
| 49 BrowserContextKeyedServiceFactory::BrowserContextShutdown(context); | 49 BrowserContextKeyedServiceFactory::BrowserContextShutdown(context); |
| 50 } | 50 } |
| 51 | 51 |
| 52 MediaRouterFactory::MediaRouterFactory() | 52 MediaRouterFactory::MediaRouterFactory() |
| 53 : BrowserContextKeyedServiceFactory( | 53 : BrowserContextKeyedServiceFactory( |
| 54 "MediaRouter", | 54 "MediaRouter", |
| 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. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 79 media_router = new MediaRouterAndroid(context); | 79 media_router = new MediaRouterAndroid(context); |
| 80 #else | 80 #else |
| 81 media_router = | 81 media_router = |
| 82 new MediaRouterMojoImpl(extensions::ProcessManager::Get(context)); | 82 new MediaRouterMojoImpl(extensions::ProcessManager::Get(context)); |
| 83 #endif | 83 #endif |
| 84 media_router->Initialize(); | 84 media_router->Initialize(); |
| 85 return media_router; | 85 return media_router; |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace media_router | 88 } // namespace media_router |
| OLD | NEW |