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

Unified Diff: ui/base/dragdrop/os_exchange_data_provider_mac.mm

Issue 2179813003: Allow OSExchangeData::Provider to be overridden at run time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac + win Created 4 years, 5 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_mac.h ('k') | ui/base/dragdrop/os_exchange_data_provider_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/dragdrop/os_exchange_data_provider_mac.mm
diff --git a/ui/base/dragdrop/os_exchange_data_provider_mac.mm b/ui/base/dragdrop/os_exchange_data_provider_mac.mm
index 9f9fa915ca48465435f7d41c69db236e602c0e05..11b0a495bb12312609aef9ad8992d20b8ca1724c 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_mac.mm
+++ b/ui/base/dragdrop/os_exchange_data_provider_mac.mm
@@ -29,8 +29,10 @@ OSExchangeDataProviderMac::OSExchangeDataProviderMac(
OSExchangeDataProviderMac::~OSExchangeDataProviderMac() {
}
-OSExchangeData::Provider* OSExchangeDataProviderMac::Clone() const {
- return new OSExchangeDataProviderMac(pasteboard_);
+std::unique_ptr<OSExchangeData::Provider>
+OSExchangeDataProviderMac::Clone() const {
+ return std::unique_ptr<OSExchangeData::Provider>(
+ new OSExchangeDataProviderMac(pasteboard_));
}
void OSExchangeDataProviderMac::MarkOriginatedFromRenderer() {
@@ -199,7 +201,8 @@ OSExchangeDataProviderMac::CreateDataFromPasteboard(NSPasteboard* pasteboard) {
for (NSPasteboardItem* item in [pasteboard pasteboardItems])
ClipboardUtil::AddDataToPasteboard(provider->pasteboard_->get(), item);
- return base::MakeUnique<OSExchangeData>(provider);
+ return base::MakeUnique<OSExchangeData>(
+ base::WrapUnique<OSExchangeData::Provider>(provider));
}
// static
@@ -212,12 +215,4 @@ NSArray* OSExchangeDataProviderMac::SupportedPasteboardTypes() {
];
}
-///////////////////////////////////////////////////////////////////////////////
-// OSExchangeData, public:
-
-// static
-OSExchangeData::Provider* OSExchangeData::CreateProvider() {
- return new OSExchangeDataProviderMac;
-}
-
} // namespace ui
« no previous file with comments | « ui/base/dragdrop/os_exchange_data_provider_mac.h ('k') | ui/base/dragdrop/os_exchange_data_provider_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698