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

Unified Diff: ui/base/dragdrop/os_exchange_data_provider_win.cc

Issue 212693004: Merge 259353 "Mark drags starting in web content as tainted to a..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1847/src/
Patch Set: Created 6 years, 9 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 | « ui/base/dragdrop/os_exchange_data_provider_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/dragdrop/os_exchange_data_provider_win.cc
===================================================================
--- ui/base/dragdrop/os_exchange_data_provider_win.cc (revision 259999)
+++ ui/base/dragdrop/os_exchange_data_provider_win.cc (working copy)
@@ -23,6 +23,14 @@
namespace ui {
+static const OSExchangeData::CustomFormat& GetRendererTaintCustomType() {
+ CR_DEFINE_STATIC_LOCAL(
+ ui::OSExchangeData::CustomFormat,
+ format,
+ (ui::Clipboard::GetFormatType("chromium/x-renderer-taint")));
+ return format;
+}
+
// Creates a new STGMEDIUM object to hold the specified text. The caller
// owns the resulting object. The "Bytes" version does not NULL terminate, the
// string version does.
@@ -269,6 +277,16 @@
return new OSExchangeDataProviderWin(data_object());
}
+void OSExchangeDataProviderWin::MarkOriginatedFromRenderer() {
+ STGMEDIUM* storage = GetStorageForString(std::string());
+ data_->contents_.push_back(new DataObjectImpl::StoredDataInfo(
+ GetRendererTaintCustomType().ToFormatEtc(), storage));
+}
+
+bool OSExchangeDataProviderWin::DidOriginateFromRenderer() const {
+ return HasCustomFormat(GetRendererTaintCustomType());
+}
+
void OSExchangeDataProviderWin::SetString(const base::string16& data) {
STGMEDIUM* storage = GetStorageForString(data);
data_->contents_.push_back(new DataObjectImpl::StoredDataInfo(
« no previous file with comments | « ui/base/dragdrop/os_exchange_data_provider_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698