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

Unified Diff: webkit/glue/webdropdata_win.cc

Issue 10532168: Allow empty strings to be written to the clipboard (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment fix Created 8 years, 6 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 | « webkit/glue/webdropdata.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webdropdata_win.cc
diff --git a/webkit/glue/webdropdata_win.cc b/webkit/glue/webdropdata_win.cc
index 049df9ec0bea4782c670a9d620b9c5d0612cd242..9dd8306a1897c2aaf0cea8f45b2d25adf03c4c19 100644
--- a/webkit/glue/webdropdata_win.cc
+++ b/webkit/glue/webdropdata_win.cc
@@ -25,11 +25,19 @@ void WebDropData::PopulateWebDropData(IDataObject* data_object,
ui::ClipboardUtil::GetFilenames(data_object, &filenames);
for (size_t i = 0; i < filenames.size(); ++i)
drop_data->filenames.push_back(FileInfo(filenames[i], string16()));
- ui::ClipboardUtil::GetPlainText(data_object, &drop_data->plain_text);
- std::string base_url;
- ui::ClipboardUtil::GetHtml(data_object, &drop_data->text_html, &base_url);
- if (!base_url.empty()) {
- drop_data->html_base_url = GURL(base_url);
+ string16 text;
+ ui::ClipboardUtil::GetPlainText(data_object, &text);
+ if (!text.empty()) {
+ drop_data->text = NullableString16(text, false);
+ }
+ string16 html;
+ std::string html_base_url;
+ ui::ClipboardUtil::GetHtml(data_object, &html, &html_base_url);
+ if (!html.empty()) {
+ drop_data->html = NullableString16(html, false);
+ }
+ if (!html_base_url.empty()) {
+ drop_data->html_base_url = GURL(html_base_url);
}
ui::ClipboardUtil::GetWebCustomData(data_object,
&drop_data->custom_data);
« no previous file with comments | « webkit/glue/webdropdata.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698