| 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 <sys/sysinfo.h> | 7 #include <sys/sysinfo.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/memory_pressure_listener.h" | 10 #include "base/memory/memory_pressure_listener.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 } // namespace | 28 } // namespace |
| 29 | 29 |
| 30 void CastContentRendererClient::RenderThreadStarted() { | 30 void CastContentRendererClient::RenderThreadStarted() { |
| 31 #if defined(USE_NSS) | 31 #if defined(USE_NSS) |
| 32 // Note: Copied from chrome_render_process_observer.cc to fix b/8676652. | 32 // Note: Copied from chrome_render_process_observer.cc to fix b/8676652. |
| 33 // | 33 // |
| 34 // On platforms where the system NSS shared libraries are used, | 34 // On platforms where the system NSS shared libraries are used, |
| 35 // initialize NSS now because it won't be able to load the .so's | 35 // initialize NSS now because it won't be able to load the .so's |
| 36 // after entering the sandbox. | 36 // after entering the sandbox. |
| 37 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) | 37 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 38 if (!command_line->HasSwitch(switches::kSingleProcess)) |
| 38 crypto::InitNSSSafely(); | 39 crypto::InitNSSSafely(); |
| 39 #endif | 40 #endif |
| 40 } | 41 } |
| 41 | 42 |
| 42 void CastContentRendererClient::RenderViewCreated( | 43 void CastContentRendererClient::RenderViewCreated( |
| 43 content::RenderView* render_view) { | 44 content::RenderView* render_view) { |
| 44 blink::WebView* webview = render_view->GetWebView(); | 45 blink::WebView* webview = render_view->GetWebView(); |
| 45 if (webview) { | 46 if (webview) { |
| 46 webview->setBaseBackgroundColor(kColorBlack); | 47 webview->setBaseBackgroundColor(kColorBlack); |
| 47 | 48 |
| 48 // The following settings express consistent behaviors across Cast | 49 // The following settings express consistent behaviors across Cast |
| 49 // embedders, though Android has enabled by default for mobile browsers. | 50 // embedders, though Android has enabled by default for mobile browsers. |
| 50 webview->settings()->setShrinksViewportContentToFit(false); | 51 webview->settings()->setShrinksViewportContentToFit(false); |
| 51 webview->settings()->setMediaControlsOverlayPlayButtonEnabled(false); | 52 webview->settings()->setMediaControlsOverlayPlayButtonEnabled(false); |
| 52 } | 53 } |
| 53 } | 54 } |
| 54 | 55 |
| 55 void CastContentRendererClient::AddKeySystems( | 56 void CastContentRendererClient::AddKeySystems( |
| 56 std::vector< ::media::KeySystemInfo>* key_systems) { | 57 std::vector< ::media::KeySystemInfo>* key_systems) { |
| 57 AddChromecastKeySystems(key_systems); | 58 AddChromecastKeySystems(key_systems); |
| 58 AddChromecastPlatformKeySystems(key_systems); | 59 AddChromecastPlatformKeySystems(key_systems); |
| 59 } | 60 } |
| 60 | 61 |
| 61 } // namespace shell | 62 } // namespace shell |
| 62 } // namespace chromecast | 63 } // namespace chromecast |
| OLD | NEW |