diff options
author | Yuri Wiitala <miu@chromium.org> | 2015-07-09 14:53:27 -0700 |
---|---|---|
committer | Yuri Wiitala <miu@chromium.org> | 2015-07-09 21:54:31 +0000 |
commit | bc3bae580416c92e24ee0db7fd5acbcf26502499 (patch) | |
tree | 2634100f1364e39f8084f6225b946e1297ff0206 | |
parent | e35ea9651d092213e941a13f39cd5a99a14eeb81 (diff) | |
download | chromium_src-bc3bae580416c92e24ee0db7fd5acbcf26502499.zip chromium_src-bc3bae580416c92e24ee0db7fd5acbcf26502499.tar.gz chromium_src-bc3bae580416c92e24ee0db7fd5acbcf26502499.tar.bz2 |
Flash Fullscreen GetScreenSize() workaround for >18.0.0.200
Fixes image translation issues when Flash is rendering in fullscreen
mode by reporting the view size instead of the actual screen size.
This change is meant to be a short-term workaround to un-break end-
users until the root-cause problem can be fixed and deployed in a
future Flash plugin update.
BUG=506016
TEST=Follow repro steps in http://crbug.com/506016#11 (comment 11).
TBR=ihf@chromium.org,bbudge@chromium.org
Review URL: https://codereview.chromium.org/1212343015
Cr-Commit-Position: refs/heads/master@{#337727}
Review URL: https://codereview.chromium.org/1228993004 .
Cr-Commit-Position: refs/branch-heads/2403@{#480}
Cr-Branched-From: f54b8097a9c45ed4ad308133d49f05325d6c5070-refs/heads/master@{#330231}
-rw-r--r-- | content/renderer/pepper/pepper_plugin_instance_impl.cc | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc index 85dfd02..73c4c13 100644 --- a/content/renderer/pepper/pepper_plugin_instance_impl.cc +++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc @@ -2627,8 +2627,19 @@ PP_Bool PepperPluginInstanceImpl::SetFullscreen(PP_Instance instance, PP_Bool PepperPluginInstanceImpl::GetScreenSize(PP_Instance instance, PP_Size* size) { - blink::WebScreenInfo info = render_frame()->GetRenderWidget()->screenInfo(); - *size = PP_MakeSize(info.rect.width, info.rect.height); + if (flash_fullscreen_) { + // Workaround for Flash rendering bug: Flash is assuming the fullscreen view + // size will be equal to the physical screen size. However, the fullscreen + // view is sized by the browser UI, and may not be the same size as the + // screen or the desktop. Therefore, report the view size as the screen + // size when in fullscreen mode. http://crbug.com/506016 + // TODO(miu): Remove this workaround once Flash has been fixed. + *size = view_data_.rect.size; + } else { + // All other cases: Report the screen size. + blink::WebScreenInfo info = render_frame()->GetRenderWidget()->screenInfo(); + *size = PP_MakeSize(info.rect.width, info.rect.height); + } return PP_TRUE; } @@ -3243,6 +3254,11 @@ void PepperPluginInstanceImpl::KeepSizeAttributesBeforeFullscreen() { void PepperPluginInstanceImpl::SetSizeAttributesForFullscreen() { if (!render_frame_) return; + + // TODO(miu): Revisit this logic. If the style must be modified for correct + // behavior, the width and height should probably be set to 100%, rather than + // a fixed screen size. + blink::WebScreenInfo info = render_frame_->GetRenderWidget()->screenInfo(); screen_size_for_fullscreen_ = gfx::Size(info.rect.width, info.rect.height); std::string width = StringPrintf("%d", screen_size_for_fullscreen_.width()); |