OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/renderer/cast_content_renderer_client.h" | 5 #include "chromecast/renderer/cast_content_renderer_client.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "chromecast/base/chromecast_switches.h" | 13 #include "chromecast/base/chromecast_switches.h" |
14 #include "chromecast/common/media/cast_media_client.h" | |
15 #include "chromecast/crash/cast_crash_keys.h" | 14 #include "chromecast/crash/cast_crash_keys.h" |
16 #include "chromecast/media/base/supported_codec_profile_levels_memo.h" | 15 #include "chromecast/media/base/supported_codec_profile_levels_memo.h" |
17 #include "chromecast/renderer/cast_render_frame_action_deferrer.h" | 16 #include "chromecast/renderer/cast_render_frame_action_deferrer.h" |
18 #include "chromecast/renderer/key_systems_cast.h" | 17 #include "chromecast/renderer/key_systems_cast.h" |
| 18 #include "chromecast/renderer/media/cast_media_client.h" |
19 #include "chromecast/renderer/media/media_caps_observer_impl.h" | 19 #include "chromecast/renderer/media/media_caps_observer_impl.h" |
20 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" | 20 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" |
21 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
22 #include "content/public/renderer/render_frame.h" | 22 #include "content/public/renderer/render_frame.h" |
23 #include "content/public/renderer/render_thread.h" | 23 #include "content/public/renderer/render_thread.h" |
24 #include "content/public/renderer/render_view.h" | 24 #include "content/public/renderer/render_view.h" |
25 #include "media/base/media.h" | 25 #include "media/base/media.h" |
26 #include "services/service_manager/public/cpp/interface_provider.h" | 26 #include "services/service_manager/public/cpp/interface_provider.h" |
27 #include "third_party/WebKit/public/platform/WebColor.h" | 27 #include "third_party/WebKit/public/platform/WebColor.h" |
28 #include "third_party/WebKit/public/web/WebFrameWidget.h" | 28 #include "third_party/WebKit/public/web/WebFrameWidget.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 // Register as observer for media capabilities | 70 // Register as observer for media capabilities |
71 content::RenderThread* thread = content::RenderThread::Get(); | 71 content::RenderThread* thread = content::RenderThread::Get(); |
72 media::mojom::MediaCapsPtr media_caps; | 72 media::mojom::MediaCapsPtr media_caps; |
73 thread->GetRemoteInterfaces()->GetInterface(&media_caps); | 73 thread->GetRemoteInterfaces()->GetInterface(&media_caps); |
74 media::mojom::MediaCapsObserverPtr proxy; | 74 media::mojom::MediaCapsObserverPtr proxy; |
75 media_caps_observer_.reset( | 75 media_caps_observer_.reset( |
76 new media::MediaCapsObserverImpl(&proxy, supported_profiles_.get())); | 76 new media::MediaCapsObserverImpl(&proxy, supported_profiles_.get())); |
77 media_caps->AddObserver(std::move(proxy)); | 77 media_caps->AddObserver(std::move(proxy)); |
78 | 78 |
79 chromecast::media::CastMediaClient::Initialize(supported_profiles_.get()); | 79 ::media::SetMediaClient( |
| 80 new chromecast::media::CastMediaClient(this, supported_profiles_.get())); |
80 | 81 |
81 prescient_networking_dispatcher_.reset( | 82 prescient_networking_dispatcher_.reset( |
82 new network_hints::PrescientNetworkingDispatcher()); | 83 new network_hints::PrescientNetworkingDispatcher()); |
83 | 84 |
84 std::string last_launched_app = | 85 std::string last_launched_app = |
85 command_line->GetSwitchValueNative(switches::kLastLaunchedApp); | 86 command_line->GetSwitchValueNative(switches::kLastLaunchedApp); |
86 if (!last_launched_app.empty()) | 87 if (!last_launched_app.empty()) |
87 base::debug::SetCrashKeyValue(crash_keys::kLastApp, last_launched_app); | 88 base::debug::SetCrashKeyValue(crash_keys::kLastApp, last_launched_app); |
88 | 89 |
89 std::string previous_app = | 90 std::string previous_app = |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 148 } |
148 | 149 |
149 void CastContentRendererClient:: | 150 void CastContentRendererClient:: |
150 SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() { | 151 SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() { |
151 // Settings for ATV (Android defaults are not what we want). | 152 // Settings for ATV (Android defaults are not what we want). |
152 blink::WebRuntimeFeatures::enableMediaControlsOverlayPlayButton(false); | 153 blink::WebRuntimeFeatures::enableMediaControlsOverlayPlayButton(false); |
153 } | 154 } |
154 | 155 |
155 } // namespace shell | 156 } // namespace shell |
156 } // namespace chromecast | 157 } // namespace chromecast |
OLD | NEW |