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" |
11 | 11 |
12 #if defined(OS_ANDROID) | 12 #if defined(OS_ANDROID) |
13 #include "chrome/browser/media/android/router/media_router_android.h" | 13 #include "chrome/browser/media/android/router/media_router_android.h" |
14 #else | 14 #else |
15 #include "chrome/browser/media/router/mojo/media_router_mojo_impl.h" | 15 #include "chrome/browser/media/router/mojo/media_router_mojo_impl.h" |
16 #include "extensions/browser/process_manager.h" | 16 #include "extensions/browser/process_manager.h" |
17 #include "extensions/browser/process_manager_factory.h" | 17 #include "extensions/browser/process_manager_factory.h" |
18 #endif | 18 #endif |
19 | 19 |
20 using content::BrowserContext; | 20 using content::BrowserContext; |
21 | 21 |
22 namespace media_router { | 22 namespace media_router { |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 base::LazyInstance<MediaRouterFactory> service_factory = | 26 base::LazyInstance<MediaRouterFactory>::DestructorAtExit service_factory = |
27 LAZY_INSTANCE_INITIALIZER; | 27 LAZY_INSTANCE_INITIALIZER; |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 // static | 31 // static |
32 MediaRouter* MediaRouterFactory::GetApiForBrowserContext( | 32 MediaRouter* MediaRouterFactory::GetApiForBrowserContext( |
33 BrowserContext* context) { | 33 BrowserContext* context) { |
34 DCHECK(context); | 34 DCHECK(context); |
35 // GetServiceForBrowserContext returns a KeyedService hence the static_cast<> | 35 // GetServiceForBrowserContext returns a KeyedService hence the static_cast<> |
36 // to return a pointer to MediaRouter. | 36 // to return a pointer to MediaRouter. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |