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

Issue 25668005: Android should be able to copy HTML snippets to the system clipboard. (Closed)

Created:
7 years, 2 months ago by Peter Beverloo
Modified:
7 years, 1 month ago
CC:
chromium-reviews, dcheng, miguelg
Visibility:
Public.

Description

Android should be able to copy HTML snippets to the system clipboard. Currently the only clipboard data we actually push to the Android system clipboard is plain-text data, so any formatting and links will be removed when someone pastes content from Chromium to, for example, Gmail. In order to push HTML data on the Android clipboard, we do need to know the plain-text representation so that non-HTML consumers can still use what's on there (there only is one primary clip). For that reason, we only push HTML to the Android system clipboard if there also is a plain-text representation available in the ClipboardMap. There are a few situations in which we end up calling Clipboard::WriteHTML. Android doesn't care about Pepper and drag and drop data right now. The WebClipboardImpl::writeImage() method will write a HTML snippet, but we'll ignore that because no plain-text data will be pasted. The fourth case is WebClipboardImpl::writeHTML(), used for DOM fragments and rich content, which will work fine after this patch. BUG=214200 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=231337

Patch Set 1 #

Total comments: 2

Patch Set 2 : rebased #

Patch Set 3 : add a test #

Total comments: 2

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -3 lines) Patch
A content/public/android/javatests/src/org/chromium/content/browser/ClipboardTest.java View 1 2 1 chunk +97 lines, -0 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/Clipboard.java View 2 chunks +17 lines, -0 lines 0 comments Download
M ui/base/clipboard/clipboard_android.cc View 1 2 3 1 chunk +19 lines, -3 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Peter Beverloo
7 years, 2 months ago (2013-10-02 15:50:15 UTC) #1
tony
I think this is OK, but it seems really fragile and likely to be broken ...
7 years, 2 months ago (2013-10-02 16:49:22 UTC) #2
dcheng
https://codereview.chromium.org/25668005/diff/1/ui/base/clipboard/clipboard_android.cc File ui/base/clipboard/clipboard_android.cc (right): https://codereview.chromium.org/25668005/diff/1/ui/base/clipboard/clipboard_android.cc#newcode118 ui/base/clipboard/clipboard_android.cc:118: env, clipboard_manager_.obj(), html.obj(), text.obj()); What is the expected behavior ...
7 years, 2 months ago (2013-10-02 22:24:14 UTC) #3
Peter Beverloo
Sorry for the long silence -- now trying to find the right way to test ...
7 years, 2 months ago (2013-10-23 17:11:34 UTC) #4
joth
On 2013/10/23 17:11:34, Peter Beverloo wrote: > Sorry for the long silence -- now trying ...
7 years, 2 months ago (2013-10-24 03:18:20 UTC) #5
Peter Beverloo
+bulach Ready for re-review, now including a content_shell-based instrumentation test.
7 years, 1 month ago (2013-10-24 17:22:20 UTC) #6
bulach
lgtm, thanks for the test! :) there's one comment in the code that I didn't ...
7 years, 1 month ago (2013-10-25 14:32:47 UTC) #7
Peter Beverloo
Thank you for the review, Marcus! Tony/Daniel, any further comments? https://codereview.chromium.org/25668005/diff/57001/ui/base/clipboard/clipboard_android.cc File ui/base/clipboard/clipboard_android.cc (right): https://codereview.chromium.org/25668005/diff/57001/ui/base/clipboard/clipboard_android.cc#newcode107 ...
7 years, 1 month ago (2013-10-25 15:29:37 UTC) #8
tony
LGTM
7 years, 1 month ago (2013-10-25 16:44:57 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/peter@chromium.org/25668005/117001
7 years, 1 month ago (2013-10-28 10:06:06 UTC) #10
commit-bot: I haz the power
7 years, 1 month ago (2013-10-28 16:25:04 UTC) #11
Message was sent while issue was closed.
Change committed as 231337

Powered by Google App Engine
This is Rietveld 408576698