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

Unified Diff: content/renderer/drop_data_builder.cc

Issue 2658573003: Use explicit WebString conversions in clipboard and drag-and-drop code (Closed)
Patch Set: Created 3 years, 11 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 | « content/renderer/clipboard_utils.cc ('k') | content/renderer/webclipboard_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/drop_data_builder.cc
diff --git a/content/renderer/drop_data_builder.cc b/content/renderer/drop_data_builder.cc
index 3dc64de3a3e89739d77b76d0d02f6ce1a7fab76c..65a5dc5fa31276bf80d9cbda2eca230ea5458108 100644
--- a/content/renderer/drop_data_builder.cc
+++ b/content/renderer/drop_data_builder.cc
@@ -16,6 +16,7 @@
#include "ui/base/clipboard/clipboard.h"
using blink::WebDragData;
+using blink::WebString;
using blink::WebVector;
namespace content {
@@ -31,33 +32,33 @@ DropData DropDataBuilder::Build(const WebDragData& drag_data) {
const WebDragData::Item& item = item_list[i];
switch (item.storageType) {
case WebDragData::Item::StorageTypeString: {
- base::string16 str_type(item.stringType);
+ base::string16 str_type(item.stringType.utf16());
if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeText)) {
- result.text = base::NullableString16(item.stringData, false);
+ result.text = WebString::toNullableString16(item.stringData);
break;
}
if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeURIList)) {
result.url = blink::WebStringToGURL(item.stringData);
- result.url_title = item.title;
+ result.url_title = item.title.utf16();
break;
}
if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeDownloadURL)) {
- result.download_metadata = item.stringData;
+ result.download_metadata = item.stringData.utf16();
break;
}
if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeHTML)) {
- result.html = base::NullableString16(item.stringData, false);
+ result.html = WebString::toNullableString16(item.stringData);
result.html_base_url = item.baseURL;
break;
}
result.custom_data.insert(
- std::make_pair(item.stringType, item.stringData));
+ std::make_pair(item.stringType.utf16(), item.stringData.utf16()));
break;
}
case WebDragData::Item::StorageTypeBinaryData:
result.file_contents.assign(item.binaryData.data(),
item.binaryData.size());
- result.file_description_filename = item.title;
+ result.file_description_filename = item.title.utf16();
break;
case WebDragData::Item::StorageTypeFilename:
// TODO(varunjain): This only works on chromeos. Support win/mac/gtk.
« no previous file with comments | « content/renderer/clipboard_utils.cc ('k') | content/renderer/webclipboard_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698