| 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/shell/renderer/cast_content_renderer_client.h" | 5 #include "chromecast/shell/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" |
| 11 #include "chromecast/shell/renderer/key_systems_cast.h" | 11 #include "chromecast/shell/renderer/key_systems_cast.h" |
| 12 #include "content/public/common/content_switches.h" | 12 #include "content/public/common/content_switches.h" |
| 13 #include "content/public/renderer/render_view.h" | 13 #include "content/public/renderer/render_view.h" |
| 14 #include "crypto/nss_util.h" | 14 #include "crypto/nss_util.h" |
| 15 #include "third_party/WebKit/public/platform/WebColor.h" | 15 #include "third_party/WebKit/public/platform/WebColor.h" |
| 16 #include "third_party/WebKit/public/web/WebSettings.h" |
| 16 #include "third_party/WebKit/public/web/WebView.h" | 17 #include "third_party/WebKit/public/web/WebView.h" |
| 17 | 18 |
| 18 namespace chromecast { | 19 namespace chromecast { |
| 19 namespace shell { | 20 namespace shell { |
| 20 | 21 |
| 21 namespace { | 22 namespace { |
| 22 | 23 |
| 23 // Default background color to set for WebViews | 24 // Default background color to set for WebViews |
| 24 const blink::WebColor kColorBlack = 0x000000FF; | 25 const blink::WebColor kColorBlack = 0x000000FF; |
| 25 | 26 |
| 26 } // namespace | 27 } // namespace |
| 27 | 28 |
| 28 void CastContentRendererClient::RenderThreadStarted() { | 29 void CastContentRendererClient::RenderThreadStarted() { |
| 29 #if defined(USE_NSS) | 30 #if defined(USE_NSS) |
| 30 // Note: Copied from chrome_render_process_observer.cc to fix b/8676652. | 31 // Note: Copied from chrome_render_process_observer.cc to fix b/8676652. |
| 31 // | 32 // |
| 32 // On platforms where the system NSS shared libraries are used, | 33 // On platforms where the system NSS shared libraries are used, |
| 33 // initialize NSS now because it won't be able to load the .so's | 34 // initialize NSS now because it won't be able to load the .so's |
| 34 // after entering the sandbox. | 35 // after entering the sandbox. |
| 35 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) | 36 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) |
| 36 crypto::InitNSSSafely(); | 37 crypto::InitNSSSafely(); |
| 37 #endif | 38 #endif |
| 38 } | 39 } |
| 39 | 40 |
| 40 void CastContentRendererClient::RenderViewCreated( | 41 void CastContentRendererClient::RenderViewCreated( |
| 41 content::RenderView* render_view) { | 42 content::RenderView* render_view) { |
| 42 blink::WebView* webview = render_view->GetWebView(); | 43 blink::WebView* webview = render_view->GetWebView(); |
| 43 if (webview) { | 44 if (webview) { |
| 44 webview->setBaseBackgroundColor(kColorBlack); | 45 webview->setBaseBackgroundColor(kColorBlack); |
| 46 webview->settings()->setShrinksViewportContentToFit(false); |
| 45 } | 47 } |
| 46 } | 48 } |
| 47 | 49 |
| 48 void CastContentRendererClient::AddKeySystems( | 50 void CastContentRendererClient::AddKeySystems( |
| 49 std::vector<content::KeySystemInfo>* key_systems) { | 51 std::vector<content::KeySystemInfo>* key_systems) { |
| 50 AddChromecastKeySystems(key_systems); | 52 AddChromecastKeySystems(key_systems); |
| 51 AddChromecastPlatformKeySystems(key_systems); | 53 AddChromecastPlatformKeySystems(key_systems); |
| 52 } | 54 } |
| 53 | 55 |
| 54 } // namespace shell | 56 } // namespace shell |
| 55 } // namespace chromecast | 57 } // namespace chromecast |
| OLD | NEW |