diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-30 22:59:25 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-30 22:59:25 +0000 |
commit | 59d9aacfdf4f6b2679231d576a659b83e61d423f (patch) | |
tree | a94f09203387e76b5f9f9543592988b1cc9b3733 /webkit | |
parent | 77a260365cd88f272afb4ce45268e78c5c4765cf (diff) | |
download | chromium_src-59d9aacfdf4f6b2679231d576a659b83e61d423f.zip chromium_src-59d9aacfdf4f6b2679231d576a659b83e61d423f.tar.gz chromium_src-59d9aacfdf4f6b2679231d576a659b83e61d423f.tar.bz2 |
Fix regression with pasting images in Gmail.
BUG=27708
TEST=Right-click an image on a web page and select copy. Paste it into a Gmail compose window. Picture should appear. Also try pasting the image into WordPad, it should appear.
Review URL: http://codereview.chromium.org/450018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33364 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/webclipboard_impl.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/webkit/glue/webclipboard_impl.cc b/webkit/glue/webclipboard_impl.cc index bac8e0a..4d73652 100644 --- a/webkit/glue/webclipboard_impl.cc +++ b/webkit/glue/webclipboard_impl.cc @@ -156,8 +156,14 @@ void WebClipboardImpl::writeImage( scw.WriteBitmapFromPixels(bitmap.getPixels(), image.size()); } - // We intentionally only write the image. If the user wants the URL, they - // can get that from the context menu. + // When writing the image, we also write the image markup so that pasting + // into rich text editors, such as Gmail, reveals the image. We also don't + // want to call writeText(), since some applications (WordPad) don't pick the + // image if there is also a text format on the clipboard. + if (!url.isEmpty()) { + scw.WriteBookmark(title, url.spec()); + scw.WriteHTML(UTF8ToUTF16(URLToImageMarkup(url, title)), ""); + } } bool WebClipboardImpl::ConvertBufferType(Buffer buffer, |