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

Unified Diff: content/browser/web_contents/web_drag_source_mac.mm

Issue 11666018: Don't put HTML onto the clipboard if there is file content data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_drag_source_mac.mm
diff --git a/content/browser/web_contents/web_drag_source_mac.mm b/content/browser/web_contents/web_drag_source_mac.mm
index 2063b093599ecfdf719dc8b25583aba67d0dc94b..336d072febeeb97e147e35ba5a45642f9851bd96 100644
--- a/content/browser/web_contents/web_drag_source_mac.mm
+++ b/content/browser/web_contents/web_drag_source_mac.mm
@@ -343,11 +343,6 @@ void PromiseWriterHelper(const WebDropData& drop_data,
declareTypes:[NSArray arrayWithObject:ui::kChromeDragDummyPboardType]
owner:contentsView_];
- // HTML.
- if (!dropData_->html.string().empty())
- [pasteboard_ addTypes:[NSArray arrayWithObject:NSHTMLPboardType]
- owner:contentsView_];
-
// URL (and title).
if (dropData_->url.is_valid()) {
NSURL* url = [NSURL URLWithString:SysUTF8ToNSString(dropData_->url.spec())];
@@ -433,6 +428,15 @@ void PromiseWriterHelper(const WebDropData& drop_data,
}
}
+ // HTML.
+ // Mail.app and TextEdit don't accept drops with both HTML and file content on
+ // them <http://crbug.com/55879>. If there is both file content and HTML in
+ // |dropData_| (as in the case of dragging an image), only provide the file
+ // data.
Nico 2012/12/23 00:08:26 How does the HTML content for just an image look?
+ if (!dropData_->html.string().empty() && dropData_->file_contents.empty())
+ [pasteboard_ addTypes:[NSArray arrayWithObject:NSHTMLPboardType]
+ owner:contentsView_];
+
// Plain text.
if (!dropData_->text.string().empty())
[pasteboard_ addTypes:[NSArray arrayWithObject:NSStringPboardType]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698