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

Issue 2601001: Linux: for Flash, disable right clicks in windowless mode. (Closed)

Created:
10 years, 6 months ago by viettrungluu
Modified:
9 years, 6 months ago
CC:
chromium-reviews, jam, darin-cc_chromium.org
Visibility:
Public.

Description

Linux: for Flash, disable right clicks in windowless mode. This is a temporary hack to avoid hangs until Flash (10.1) is fixed. See bug. BUG=40157 TEST=On windowless Flash content, with Flash 10.1, right clicks shouldn't causes hangs. For windowed content, right clicks should work as before and bring up the Flash context menu. Other plugins shouldn't be affected (unless they're accepting Flash content). Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=48854

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -2 lines) Patch
M webkit/glue/plugins/webplugin_delegate_impl.h View 1 chunk +1 line, -0 lines 0 comments Download
M webkit/glue/plugins/webplugin_delegate_impl_gtk.cc View 2 chunks +14 lines, -2 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
viettrungluu
Ugh, but Flash isn't going to be fixed on time.
10 years, 6 months ago (2010-06-03 17:45:40 UTC) #1
Elliot Glaysher
10 years, 6 months ago (2010-06-03 17:49:53 UTC) #2
LGTM

On Thu, Jun 3, 2010 at 10:45 AM,  <viettrungluu@chromium.org> wrote:
> Reviewers: cpu, Elliot Glaysher,
>
> Message:
> Ugh, but Flash isn't going to be fixed on time.
>
> Description:
> Linux: for Flash, disable right clicks in windowless mode.
>
> This is a temporary hack to avoid hangs until Flash (10.1) is fixed. See
> bug.
>
> BUG=40157
> TEST=On windowless Flash content, with Flash 10.1, right clicks shouldn't
> causes
> hangs. For windowed content, right clicks should work as before and bring up
> the
> Flash context menu. Other plugins shouldn't be affected (unless they're
> accepting Flash content).
>
> Please review this at http://codereview.chromium.org/2601001/show
>
> Affected files:
>  M webkit/glue/plugins/webplugin_delegate_impl.h
>  M webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
>
>
> Index: webkit/glue/plugins/webplugin_delegate_impl.h
> diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h
> b/webkit/glue/plugins/webplugin_delegate_impl.h
> index
>
0d113caa9c487bec59df587c994efec57aa7df16..e624e6fd0492bd73ccf77911f11ec61483844475
> 100644
> --- a/webkit/glue/plugins/webplugin_delegate_impl.h
> +++ b/webkit/glue/plugins/webplugin_delegate_impl.h
> @@ -72,6 +72,7 @@ class WebPluginDelegateImpl : public
> webkit_glue::WebPluginDelegate {
>     PLUGIN_QUIRK_ALWAYS_NOTIFY_SUCCESS = 4096, // Windows
>     PLUGIN_QUIRK_ALLOW_FASTER_QUICKDRAW_PATH = 8192, // Mac
>     PLUGIN_QUIRK_HANDLE_MOUSE_CAPTURE = 16384, // Windows
> +    PLUGIN_QUIRK_WINDOWLESS_NO_RIGHT_CLICK = 32768, // Linux
>   };
>
>   static WebPluginDelegateImpl* Create(const FilePath& filename,
> Index: webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
> diff --git a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
> b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
> index
>
e9830b4c505d6eacc6ed78b076f7aa7008e13d39..7eceb0dcbcaefea708b9632f8fbb401287aac19d
> 100644
> --- a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
> +++ b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
> @@ -54,9 +54,13 @@ WebPluginDelegateImpl::WebPluginDelegateImpl(
>   memset(&window_, 0, sizeof(window_));
>   if (instance_->mime_type() == "application/x-shockwave-flash") {
>     // Flash is tied to Firefox's whacky behavior with windowless plugins.
> See
> -    // comments in WindowlessPaint
> +    // comments in WindowlessPaint.
> +    // TODO(viettrungluu): PLUGIN_QUIRK_WINDOWLESS_NO_RIGHT_CLICK: Don't
> allow
> +    // right-clicks in windowless content since Flash 10.1 (initial
> release, at
> +    // least) hangs in that case. Remove this once Flash is fixed.
>     quirks_ |= PLUGIN_QUIRK_WINDOWLESS_OFFSET_WINDOW_TO_DRAW
> -        | PLUGIN_QUIRK_WINDOWLESS_INVALIDATE_AFTER_SET_WINDOW;
> +        | PLUGIN_QUIRK_WINDOWLESS_INVALIDATE_AFTER_SET_WINDOW
> +        | PLUGIN_QUIRK_WINDOWLESS_NO_RIGHT_CLICK;
>   }
>
>   // TODO(evanm): I played with this for quite a while but couldn't
> @@ -680,6 +684,14 @@ bool WebPluginDelegateImpl::PlatformHandleInputEvent(
>   if (!NPEventFromWebInputEvent(event, timestamp, &np_event)) {
>     return false;
>   }
> +  // See comment about PLUGIN_QUIRK_WINDOWLESS_NO_RIGHT_CLICK in
> constructor.
> +  if (windowless_ &&
> +      (quirks_ & PLUGIN_QUIRK_WINDOWLESS_NO_RIGHT_CLICK) &&
> +      (np_event.type == ButtonPress || np_event.type == ButtonRelease) &&
> +      (np_event.xbutton.button == Button3)) {
> +    return false;
> +  }
> +
>   bool ret = instance()->NPP_HandleEvent(&np_event) != 0;
>
>   // Flash always returns false, even when the event is handled.
>
>
>

Powered by Google App Engine
This is Rietveld 408576698