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

Issue 15088: Add support for custom cursors set by windowless plugins. Windowless plugins... (Closed)

Created:
12 years ago by ananta
Modified:
9 years, 6 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Add support for custom cursors set by windowless plugins. Windowless plugins typically set the cursor in NPP_HandleEvent for WM_MOUSEMOVE.The current implementation looks for the cursor type and if the typedoes not match predefinedcursor types defaults to the pointer cursor. The fixes are as below:- 1. Marshal the HCURSOR after copying it to ensure that it remains valid. This works as a HCURSOR is a user object and can be used across processes. Ideally we would like to convert it to a skia bitmap but there are issues with converting monochrome cursors. 2. Added support for marshaling platform specific data in the webcursor Serialize/Deserialize functions. This is in the form of functions like InitPlatformData, SerializePlatformData, DeserializePlatformData, etc. which are stubbed out for the other platforms. 3. Mimic webkit windowless plugin behavior where it sets a flag to ignore the next setCursor after HandleEvent of WM_MOUSEMOVE. If we don't do this the cursor keeps changing between a pointerCursor and the cursor set by the plugin which also causes flicker. 4. Fixed the WebCursor::IsEqual function to ensure that it checks all fields for equality. 5. The browser(RenderWidgetHostViewWin) now maintains a WebCursor instance representing the current cursor. Any cursor updates received from the renderer update the current cursor member maintained by the browser. 6. We intercept the SetCursor API for windowless plugins like Flash and Silverlight and remember the cursor being set. We don't invoke the original API as the browser UI thread would do it anyways. This fixes the annoying cursor flicker caused by the windowless flash plugin instance constantly setting the cursor even when the tab is not visible. This fixes bug http://code.google.com/p/chromium/issues/detail?id=3800. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=7798

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 3

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 13

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Total comments: 3

Patch Set 12 : '' #

Patch Set 13 : '' #

Patch Set 14 : '' #

Patch Set 15 : '' #

Patch Set 16 : '' #

Patch Set 17 : '' #

Patch Set 18 : '' #

Patch Set 19 : '' #

Total comments: 4

Patch Set 20 : '' #

Patch Set 21 : '' #

Patch Set 22 : '' #

Patch Set 23 : '' #

Patch Set 24 : '' #

Total comments: 5

Patch Set 25 : '' #

Patch Set 26 : '' #

Patch Set 27 : '' #

Patch Set 28 : '' #

Patch Set 29 : '' #

Total comments: 2

Patch Set 30 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+336 lines, -106 lines) Patch
M chrome/browser/render_widget_host_view_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +2 lines, -5 lines 0 comments Download
M chrome/browser/render_widget_host_view_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 5 chunks +12 lines, -25 lines 0 comments Download
M webkit/glue/chrome_client_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 2 chunks +3 lines, -0 lines 0 comments Download
M webkit/glue/chrome_client_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 2 chunks +15 lines, -1 line 0 comments Download
M webkit/glue/plugins/webplugin_delegate_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 2 chunks +12 lines, -5 lines 0 comments Download
M webkit/glue/plugins/webplugin_delegate_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 11 chunks +65 lines, -17 lines 0 comments Download
M webkit/glue/webcursor.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 5 chunks +45 lines, -10 lines 0 comments Download
M webkit/glue/webcursor.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 5 chunks +53 lines, -4 lines 0 comments Download
M webkit/glue/webcursor_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +24 lines, -0 lines 0 comments Download
M webkit/glue/webcursor_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +23 lines, -0 lines 0 comments Download
M webkit/glue/webcursor_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3 chunks +66 lines, -17 lines 0 comments Download
M webkit/glue/webplugin_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +7 lines, -2 lines 0 comments Download
M webkit/tools/test_shell/test_webview_delegate.h View 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3 chunks +3 lines, -5 lines 0 comments Download
M webkit/tools/test_shell/test_webview_delegate_gtk.cc View 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +3 lines, -2 lines 0 comments Download
M webkit/tools/test_shell/test_webview_delegate_win.cc View 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 2 chunks +3 lines, -13 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
ananta
12 years ago (2008-12-19 20:26:54 UTC) #1
darin (slow to review)
http://codereview.chromium.org/15088/diff/204/44 File chrome/browser/render_widget_host_view_win.h (right): http://codereview.chromium.org/15088/diff/204/44#newcode223 Line 223: regular_cursor, these need to be UPPER_CASE per the ...
12 years ago (2008-12-22 16:41:15 UTC) #2
ananta
On 2008/12/22 16:41:15, darin wrote: > http://codereview.chromium.org/15088/diff/204/44 > File chrome/browser/render_widget_host_view_win.h (right): > > http://codereview.chromium.org/15088/diff/204/44#newcode223 > ...
12 years ago (2008-12-23 00:28:38 UTC) #3
darin (slow to review)
Looking good... http://codereview.chromium.org/15088/diff/801/813 File chrome/browser/render_widget_host_view_win.cc (right): http://codereview.chromium.org/15088/diff/801/813#newcode86 Line 86: current_cursor_.Clear(); WebCursor should have a destructor ...
12 years ago (2008-12-23 05:00:25 UTC) #4
ananta
On 2008/12/23 05:00:25, darin wrote: > Looking good... > > http://codereview.chromium.org/15088/diff/801/813 > File chrome/browser/render_widget_host_view_win.cc (right): ...
12 years ago (2008-12-23 06:05:21 UTC) #5
ananta
Based on our discussion, added a flag indicating whether the WebCursor has ownership of the ...
12 years ago (2008-12-23 20:50:35 UTC) #6
darin (slow to review)
http://codereview.chromium.org/15088/diff/499/503 File webkit/glue/plugins/webplugin_delegate_impl.cc (right): http://codereview.chromium.org/15088/diff/499/503#newcode1141 Line 1141: web_current_cursor.Clear(); so this .Clear call should be unnecessary ...
12 years ago (2008-12-23 20:58:02 UTC) #7
ananta
On 2008/12/23 20:58:02, darin wrote: > http://codereview.chromium.org/15088/diff/499/503 > File webkit/glue/plugins/webplugin_delegate_impl.cc (right): > > http://codereview.chromium.org/15088/diff/499/503#newcode1141 > ...
12 years ago (2008-12-23 21:09:39 UTC) #8
darin (slow to review)
> We cannot use DISALLOW_COPY_AND_ASSIGN as the renderer uses the default > assignment operator. It ...
12 years ago (2008-12-23 21:39:04 UTC) #9
ananta
On 2008/12/23 21:39:04, darin wrote: > > We cannot use DISALLOW_COPY_AND_ASSIGN as the renderer uses ...
12 years ago (2008-12-23 22:00:12 UTC) #10
darin (slow to review)
things are getting complicated. maybe a better solution would be to put external_cursor_ and custom_cursor_ ...
12 years ago (2008-12-23 23:30:31 UTC) #11
ananta
Based on our discussion, the WebCursor instance now does not attempt to copy the external ...
12 years ago (2008-12-24 00:32:54 UTC) #12
darin (slow to review)
LGTM w/ these issues resolved. Feel free to postpone the ToPlatformCursorType removal to a future ...
12 years ago (2008-12-24 00:45:04 UTC) #13
ananta
On 2008/12/24 00:45:04, darin wrote: > LGTM w/ these issues resolved. Feel free to postpone ...
12 years ago (2008-12-24 01:24:24 UTC) #14
ananta
Hi Darin Based on our discussion last week about intercepting the SetCursor API for windowless ...
11 years, 11 months ago (2008-12-30 21:12:40 UTC) #15
darin (slow to review)
LGTM http://codereview.chromium.org/15088/diff/1690/1694 File webkit/glue/plugins/webplugin_delegate_impl.cc (right): http://codereview.chromium.org/15088/diff/1690/1694#newcode275 Line 275: // and remember the cursor being set. ...
11 years, 11 months ago (2009-01-09 00:55:02 UTC) #16
ananta
11 years, 11 months ago (2009-01-09 01:22:28 UTC) #17
On 2009/01/09 00:55:02, darin wrote:
> LGTM
> 
> http://codereview.chromium.org/15088/diff/1690/1694
> File webkit/glue/plugins/webplugin_delegate_impl.cc (right):
> 
> http://codereview.chromium.org/15088/diff/1690/1694#newcode275
> Line 275: // and remember the cursor being set. This is shipped over  to the
> browser
> nit: kill extra space between "over" and "to"

Done

> 
> http://codereview.chromium.org/15088/diff/1690/1694#newcode1168
> Line 1168: return GetCursor();
> hmm... so we are effectively making it look to the plugin as though the
> SetCursor call did nothing because we return GetCursor() instead of "cursor"
> here.  Maybe this deserves a comment.  It might be reasonable to return
"cursor"
> instead to make it look like the cursor got set.
I changed it to return the previous cursor from the WebCursor member in the
plugin before updating it to the new cursor.

Submitted based on our discussion.

Powered by Google App Engine
This is Rietveld 408576698