Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Side by Side Diff: chromecast/renderer/cast_content_renderer_client.cc

Issue 2144683002: [Chromecast] Fix window size/page scale issues on ATV (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Defaults are fine for linux Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 base::debug::SetCrashKeyValue(crash_keys::kPreviousApp, previous_app); 89 base::debug::SetCrashKeyValue(crash_keys::kPreviousApp, previous_app);
90 } 90 }
91 91
92 void CastContentRendererClient::RenderViewCreated( 92 void CastContentRendererClient::RenderViewCreated(
93 content::RenderView* render_view) { 93 content::RenderView* render_view) {
94 blink::WebView* webview = render_view->GetWebView(); 94 blink::WebView* webview = render_view->GetWebView();
95 if (webview) { 95 if (webview) {
96 blink::WebFrameWidget* web_frame_widget = render_view->GetWebFrameWidget(); 96 blink::WebFrameWidget* web_frame_widget = render_view->GetWebFrameWidget();
97 web_frame_widget->setBaseBackgroundColor(kColorBlack); 97 web_frame_widget->setBaseBackgroundColor(kColorBlack);
98 98
99 // The following settings express consistent behaviors across Cast 99 // Settings for ATV (Android defaults are not what we want):
100 // embedders, though Android has enabled by default for mobile browsers.
101 webview->settings()->setShrinksViewportContentToFit(false);
102 webview->settings()->setMediaControlsOverlayPlayButtonEnabled(false); 100 webview->settings()->setMediaControlsOverlayPlayButtonEnabled(false);
103 101
104 // Scale 1 ensures window.innerHeight/Width match application resolution.
105 // PageScaleOverride is the 'user agent' value which overrides page
106 // settings (from meta viewport tag) - thus preventing inconsistency
107 // between Android and non-Android cast_shell.
108 webview->setDefaultPageScaleLimits(1.f, 1.f);
109 webview->setInitialPageScaleOverride(1.f);
110
111 // Disable application cache as Chromecast doesn't support off-line 102 // Disable application cache as Chromecast doesn't support off-line
112 // application running. 103 // application running.
113 webview->settings()->setOfflineWebApplicationCacheEnabled(false); 104 webview->settings()->setOfflineWebApplicationCacheEnabled(false);
114 } 105 }
115 } 106 }
116 107
117 void CastContentRendererClient::AddSupportedKeySystems( 108 void CastContentRendererClient::AddSupportedKeySystems(
118 std::vector<std::unique_ptr<::media::KeySystemProperties>>* 109 std::vector<std::unique_ptr<::media::KeySystemProperties>>*
119 key_systems_properties) { 110 key_systems_properties) {
120 AddChromecastKeySystems(key_systems_properties, false); 111 AddChromecastKeySystems(key_systems_properties, false);
(...skipping 28 matching lines...) Expand all
149 closure.Run(); 140 closure.Run();
150 return; 141 return;
151 } 142 }
152 143
153 // Lifetime is tied to |render_frame| via content::RenderFrameObserver. 144 // Lifetime is tied to |render_frame| via content::RenderFrameObserver.
154 new CastMediaLoadDeferrer(render_frame, closure); 145 new CastMediaLoadDeferrer(render_frame, closure);
155 } 146 }
156 147
157 } // namespace shell 148 } // namespace shell
158 } // namespace chromecast 149 } // namespace chromecast
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698