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

Issue 2842016: Implement new Chromium IPCs for copying/dragging (Closed)

Created:
10 years, 6 months ago by dcheng
Modified:
9 years, 7 months ago
Reviewers:
tony
CC:
chromium-reviews, jam+cc_chromium.org, dpranke+watch_chromium.org, ben+cc_chromium.org, pam+watch_chromium.org, brettw-cc_chromium.org, darin-cc_chromium.org, John Grabowski
Visibility:
Public.

Description

Implement new Chromium IPCs for copying/dragging. A new ClipboardDispatcher interface has been added to handle the IPC calls. The new methods don't really belong on the existing Clipboard class, since that class deals with only copy and paste. On Windows and Mac, ClipboardDispatcher will share logic for copy/paste and drag/drop. GTK will have to use two separate code paths. BUG=31037 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=51790

Patch Set 1 #

Patch Set 2 : Fix existing style violation #

Patch Set 3 : Adding ClipboardDispatcher stubs. #

Patch Set 4 : Fix GTK build. #

Total comments: 9

Patch Set 5 : . #

Patch Set 6 : Appease lint. #

Total comments: 1

Patch Set 7 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+384 lines, -20 lines) Patch
M app/clipboard/clipboard.h View 1 2 3 4 3 chunks +5 lines, -2 lines 0 comments Download
A chrome/browser/clipboard_dispatcher.h View 3 4 5 1 chunk +41 lines, -0 lines 0 comments Download
A chrome/browser/clipboard_dispatcher_gtk.cc View 3 4 5 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/browser/clipboard_dispatcher_mac.mm View 3 4 5 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/browser/clipboard_dispatcher_win.cc View 3 4 5 1 chunk +33 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/resource_message_filter.h View 1 2 3 4 2 chunks +11 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/resource_message_filter.cc View 1 2 3 4 5 6 3 chunks +37 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/resource_message_filter_gtk.cc View 1 2 3 10 chunks +66 lines, -9 lines 0 comments Download
M chrome/chrome_browser.gypi View 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/render_messages.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/common/render_messages_internal.h View 1 2 3 4 5 6 1 chunk +16 lines, -0 lines 0 comments Download
M chrome/renderer/renderer_glue.cc View 1 2 3 4 5 6 1 chunk +25 lines, -0 lines 0 comments Download
M webkit/glue/webclipboard_impl.h View 2 chunks +6 lines, -1 line 0 comments Download
M webkit/glue/webclipboard_impl.cc View 1 2 3 4 5 6 3 chunks +39 lines, -0 lines 0 comments Download
M webkit/glue/webkit_glue.h View 1 2 3 4 5 6 2 chunks +15 lines, -1 line 0 comments Download
M webkit/tools/test_shell/mock_webclipboard_impl.h View 2 chunks +0 lines, -3 lines 0 comments Download
M webkit/tools/test_shell/mock_webclipboard_impl.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M webkit/tools/test_shell/simple_clipboard_impl.cc View 1 2 3 4 5 6 1 chunk +17 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
dcheng
Just a couple stubs for now. To give an idea of what a ClipboardDispatcher implementation ...
10 years, 5 months ago (2010-07-02 02:56:14 UTC) #1
tony
Mainly some style nits. http://codereview.chromium.org/2842016/diff/8001/9001 File app/clipboard/clipboard.h (right): http://codereview.chromium.org/2842016/diff/8001/9001#newcode86 app/clipboard/clipboard.h:86: static bool IsValidBuffer(int32 buffer) { ...
10 years, 5 months ago (2010-07-02 03:49:34 UTC) #2
dcheng
http://codereview.chromium.org/2842016/diff/8001/9001 File app/clipboard/clipboard.h (right): http://codereview.chromium.org/2842016/diff/8001/9001#newcode86 app/clipboard/clipboard.h:86: static bool IsValidBuffer(int32 buffer) { On 2010/07/02 03:49:34, tony ...
10 years, 5 months ago (2010-07-03 00:18:02 UTC) #3
tony
10 years, 5 months ago (2010-07-03 11:56:50 UTC) #4
LGTM

http://codereview.chromium.org/2842016/diff/8001/9002
File chrome/browser/clipboard_dispatcher.h (right):

http://codereview.chromium.org/2842016/diff/8001/9002#newcode17
chrome/browser/clipboard_dispatcher.h:17: static std::vector<string16>
ReadAvailableTypes(Clipboard::Buffer buffer,
On 2010/07/03 00:18:03, dcheng wrote:
> On 2010/07/02 03:49:34, tony wrote:
> > Nit: Maybe pass in a std::vector<string16>* instead of returning the vector
of
> > string16 to avoid the copy?  Maybe all the Read methods in this class should
> > have a consistent return value (e.g., a bool that returns true on successful
> > read).
> 
> Done. Not 100% sure the bool return value will be used, but might as well have
> it there.

Feel free to change to void functions if you don't think the return is ever
going to be used.

http://codereview.chromium.org/2842016/diff/36001/37018
File webkit/tools/test_shell/simple_clipboard_impl.cc (right):

http://codereview.chromium.org/2842016/diff/36001/37018#newcode55
webkit/tools/test_shell/simple_clipboard_impl.cc:55: std::vector<string16>
ClipboardReadAvailableTypes(Clipboard::Buffer buffer,
This needs to be updated too.

Powered by Google App Engine
This is Rietveld 408576698