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

Unified Diff: chrome/browser/cocoa/web_drop_target.mm

Issue 2674002: Convert RTF on the pasteboard to HTML and all it to substitute if present and... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/clipboard/clipboard_mac.mm ('k') | third_party/mozilla/NSPasteboard+Utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/web_drop_target.mm
===================================================================
--- chrome/browser/cocoa/web_drop_target.mm (revision 48762)
+++ chrome/browser/cocoa/web_drop_target.mm (working copy)
@@ -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 @@
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.
« no previous file with comments | « app/clipboard/clipboard_mac.mm ('k') | third_party/mozilla/NSPasteboard+Utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698