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

Unified Diff: content/browser/web_contents/web_contents_view_aura.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
Index: content/browser/web_contents/web_contents_view_aura.cc
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index 101e58b31e96cbb83321febfd26c845ac705f772..448c14567bd751fc008cfc0be10e04dbdf703c52 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -94,12 +94,12 @@ class WebDragSourceAura : public MessageLoopForUI::Observer {
// Utility to fill a ui::OSExchangeDataProviderAura object from WebDropData.
void PrepareDragData(const WebDropData& drop_data,
ui::OSExchangeDataProviderAura* provider) {
- if (!drop_data.plain_text.empty())
- provider->SetString(drop_data.plain_text);
+ if (!drop_data.text.string().empty())
+ provider->SetString(drop_data.text.string());
if (drop_data.url.is_valid())
provider->SetURL(drop_data.url, drop_data.url_title);
- if (!drop_data.text_html.empty())
- provider->SetHtml(drop_data.text_html, drop_data.html_base_url);
+ if (!drop_data.html.string().empty())
+ provider->SetHtml(drop_data.html.string(), drop_data.html_base_url);
if (!drop_data.filenames.empty()) {
std::vector<ui::OSExchangeData::FileInfo> filenames;
for (std::vector<WebDropData::FileInfo>::const_iterator it =
@@ -123,20 +123,26 @@ void PrepareDragData(const WebDropData& drop_data,
// Utility to fill a WebDropData object from ui::OSExchangeData.
void PrepareWebDropData(WebDropData* drop_data,
const ui::OSExchangeData& data) {
- string16 plain_text, url_title;
- GURL url;
-
+ string16 plain_text;
data.GetString(&plain_text);
if (!plain_text.empty())
- drop_data->plain_text = plain_text;
+ drop_data->text = NullableString16(plain_text, false);
+ GURL url;
+ string16 url_title;
data.GetURLAndTitle(&url, &url_title);
if (url.is_valid()) {
drop_data->url = url;
drop_data->url_title = url_title;
}
- data.GetHtml(&drop_data->text_html, &drop_data->html_base_url);
+ string16 html;
+ GURL html_base_url;
+ data.GetHtml(&html, &html_base_url);
+ if (!html.empty())
+ drop_data->html = NullableString16(html, false);
+ if (html_base_url.is_valid())
+ drop_data->html_base_url = html_base_url;
std::vector<ui::OSExchangeData::FileInfo> files;
if (data.GetFilenames(&files) && !files.empty()) {
« no previous file with comments | « content/browser/web_contents/web_contents_drag_win.cc ('k') | content/browser/web_contents/web_drag_dest_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698