| 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" | 14 #include "chromecast/common/media/cast_media_client.h" | 
| 15 #include "chromecast/crash/cast_crash_keys.h" | 15 #include "chromecast/crash/cast_crash_keys.h" | 
| 16 #include "chromecast/media/base/supported_codec_profile_levels_memo.h" | 16 #include "chromecast/media/base/supported_codec_profile_levels_memo.h" | 
| 17 #include "chromecast/renderer/cast_render_frame_action_deferrer.h" | 17 #include "chromecast/renderer/cast_render_frame_action_deferrer.h" | 
| 18 #include "chromecast/renderer/key_systems_cast.h" | 18 #include "chromecast/renderer/key_systems_cast.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/common/service_names.mojom.h" | 
| 22 #include "content/public/renderer/render_frame.h" | 23 #include "content/public/renderer/render_frame.h" | 
| 23 #include "content/public/renderer/render_thread.h" | 24 #include "content/public/renderer/render_thread.h" | 
| 24 #include "content/public/renderer/render_view.h" | 25 #include "content/public/renderer/render_view.h" | 
| 25 #include "media/base/media.h" | 26 #include "media/base/media.h" | 
| 26 #include "services/service_manager/public/cpp/interface_provider.h" | 27 #include "services/service_manager/public/cpp/connector.h" | 
| 27 #include "third_party/WebKit/public/platform/WebColor.h" | 28 #include "third_party/WebKit/public/platform/WebColor.h" | 
| 28 #include "third_party/WebKit/public/web/WebFrameWidget.h" | 29 #include "third_party/WebKit/public/web/WebFrameWidget.h" | 
| 29 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 30 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 
| 30 #include "third_party/WebKit/public/web/WebSettings.h" | 31 #include "third_party/WebKit/public/web/WebSettings.h" | 
| 31 #include "third_party/WebKit/public/web/WebView.h" | 32 #include "third_party/WebKit/public/web/WebView.h" | 
| 32 | 33 | 
| 33 #if defined(OS_ANDROID) | 34 #if defined(OS_ANDROID) | 
| 34 #include "media/base/android/media_codec_util.h" | 35 #include "media/base/android/media_codec_util.h" | 
| 35 #endif  // OS_ANDROID | 36 #endif  // OS_ANDROID | 
| 36 | 37 | 
| (...skipping 26 matching lines...) Expand all  Loading... | 
| 63 | 64 | 
| 64 CastContentRendererClient::~CastContentRendererClient() { | 65 CastContentRendererClient::~CastContentRendererClient() { | 
| 65 } | 66 } | 
| 66 | 67 | 
| 67 void CastContentRendererClient::RenderThreadStarted() { | 68 void CastContentRendererClient::RenderThreadStarted() { | 
| 68   base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 69   base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 
| 69 | 70 | 
| 70   // Register as observer for media capabilities | 71   // Register as observer for media capabilities | 
| 71   content::RenderThread* thread = content::RenderThread::Get(); | 72   content::RenderThread* thread = content::RenderThread::Get(); | 
| 72   media::mojom::MediaCapsPtr media_caps; | 73   media::mojom::MediaCapsPtr media_caps; | 
| 73   thread->GetRemoteInterfaces()->GetInterface(&media_caps); | 74   thread->GetConnector()->BindInterface(content::mojom::kBrowserServiceName, | 
|  | 75                                         &media_caps); | 
| 74   media::mojom::MediaCapsObserverPtr proxy; | 76   media::mojom::MediaCapsObserverPtr proxy; | 
| 75   media_caps_observer_.reset( | 77   media_caps_observer_.reset( | 
| 76       new media::MediaCapsObserverImpl(&proxy, supported_profiles_.get())); | 78       new media::MediaCapsObserverImpl(&proxy, supported_profiles_.get())); | 
| 77   media_caps->AddObserver(std::move(proxy)); | 79   media_caps->AddObserver(std::move(proxy)); | 
| 78 | 80 | 
| 79   chromecast::media::CastMediaClient::Initialize(supported_profiles_.get()); | 81   chromecast::media::CastMediaClient::Initialize(supported_profiles_.get()); | 
| 80 | 82 | 
| 81   prescient_networking_dispatcher_.reset( | 83   prescient_networking_dispatcher_.reset( | 
| 82       new network_hints::PrescientNetworkingDispatcher()); | 84       new network_hints::PrescientNetworkingDispatcher()); | 
| 83 | 85 | 
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 147 } | 149 } | 
| 148 | 150 | 
| 149 void CastContentRendererClient:: | 151 void CastContentRendererClient:: | 
| 150     SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() { | 152     SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() { | 
| 151   // Settings for ATV (Android defaults are not what we want). | 153   // Settings for ATV (Android defaults are not what we want). | 
| 152   blink::WebRuntimeFeatures::enableMediaControlsOverlayPlayButton(false); | 154   blink::WebRuntimeFeatures::enableMediaControlsOverlayPlayButton(false); | 
| 153 } | 155 } | 
| 154 | 156 | 
| 155 }  // namespace shell | 157 }  // namespace shell | 
| 156 }  // namespace chromecast | 158 }  // namespace chromecast | 
| OLD | NEW | 
|---|