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