summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-04 19:07:12 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-04 19:07:12 +0000
commit3a5a8f3ced18095419e5d79075bd2e0cfc9a88b4 (patch)
tree827bb68c510634260845f750642b7360b18cc33a /chrome
parent88e8e752268e85da7196e5dbd8c622a7b0565e19 (diff)
downloadchromium_src-3a5a8f3ced18095419e5d79075bd2e0cfc9a88b4.zip
chromium_src-3a5a8f3ced18095419e5d79075bd2e0cfc9a88b4.tar.gz
chromium_src-3a5a8f3ced18095419e5d79075bd2e0cfc9a88b4.tar.bz2
Convert RTF on the pasteboard to HTML and all it to substitute if present and no HTML is on a paste or drop. Safari does not put HTML on the pasteboard, only RTF.
BUG=44661 TEST=dropping/pasting html should retain basic structure, but fonts/colors don't seem to propagate. Review URL: http://codereview.chromium.org/2674002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48962 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/web_drop_target.mm7
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/web_drop_target.mm b/chrome/browser/cocoa/web_drop_target.mm
index 68c0b79..915990a 100644
--- a/chrome/browser/cocoa/web_drop_target.mm
+++ b/chrome/browser/cocoa/web_drop_target.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -253,10 +253,13 @@ using WebKit::WebDragOperationsMask;
base::SysNSStringToUTF16([pboard stringForType:NSStringPboardType]);
}
- // Get HTML.
+ // Get HTML. If there's no HTML, try RTF.
if ([types containsObject:NSHTMLPboardType]) {
data->text_html =
base::SysNSStringToUTF16([pboard stringForType:NSHTMLPboardType]);
+ } else if ([types containsObject:NSRTFPboardType]) {
+ NSString* html = [pboard htmlFromRtf];
+ data->text_html = base::SysNSStringToUTF16(html);
}
// Get files.