Commit 09303230 authored by dcheng@chromium.org's avatar dcheng@chromium.org

Don't write image markup to the clipboard when copying images on OS X.

If image markup is present on the clipboard, Mail.app will always prefer it over the actual image even if we declare the image types before the HTML type in -[NSPasteboard types]. With this change, we also match the behavior of other Mac browser when invoking the "Copy Image" action.

BUG=33016
TEST=Manual test with 'copy image' context menu item and then pasting it into a Mail.app draft.

Review URL: http://codereview.chromium.org/7044074

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88569 0039d316-1c4b-4281-b951-d872f2087c98
parent ca9fee9c
......@@ -179,13 +179,18 @@ void WebClipboardImpl::writeImage(
scw.WriteBitmapFromPixels(bitmap.getPixels(), image.size());
}
// 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());
#if !defined(OS_MACOSX)
// 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.
// We also don't want to write HTML on a Mac, since Mail.app prefers to use
// the image markup over attaching the actual image. See
// http://crbug.com/33016 for details.
scw.WriteHTML(UTF8ToUTF16(URLToImageMarkup(url, title)), "");
#endif
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment