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

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

Issue 1964283002: MacViews: Implemented Drag & Drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for dcheng Created 4 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: ui/base/dragdrop/os_exchange_data_provider_mac.h
diff --git a/ui/base/dragdrop/os_exchange_data_provider_mac.h b/ui/base/dragdrop/os_exchange_data_provider_mac.h
index 378602923a97eeb0f38ccd4c0a2081a6c0a26304..3da579c62963611bb5ea299ec68fc6daf625152c 100644
--- a/ui/base/dragdrop/os_exchange_data_provider_mac.h
+++ b/ui/base/dragdrop/os_exchange_data_provider_mac.h
@@ -9,8 +9,13 @@
#include "base/memory/ref_counted.h"
#import "ui/base/clipboard/clipboard_util_mac.h"
#include "ui/base/dragdrop/os_exchange_data.h"
+#include "ui/gfx/geometry/vector2d.h"
+#include "ui/gfx/image/image_skia.h"
+@class NSArray;
+@class NSData;
@class NSPasteboard;
+@class NSString;
namespace ui {
class UniquePasteboard;
@@ -44,11 +49,30 @@ class UI_BASE_EXPORT OSExchangeDataProviderMac
bool HasURL(OSExchangeData::FilenameToURLPolicy policy) const override;
bool HasFile() const override;
bool HasCustomFormat(const Clipboard::FormatType& format) const override;
+ void SetDragImage(const gfx::ImageSkia& image,
+ const gfx::Vector2d& cursor_offset) override;
+ const gfx::ImageSkia& GetDragImage() const override;
+ const gfx::Vector2d& GetDragImageOffset() const override;
+
+ // Returns the data for the specified type in the pasteboard.
+ NSData* GetNSDataForType(NSString* type) const;
+
+ // Creates an OSExchangeData object from the given NSPasteboard object.
+ static std::unique_ptr<OSExchangeData> CreateDataFromPasteboard(
+ NSPasteboard* pasteboard);
+
+ // Returns an array of pasteboard types that can be supported by
+ // OSExchangeData.
+ static NSArray* SupportedPasteboardTypes();
private:
explicit OSExchangeDataProviderMac(scoped_refptr<ui::UniquePasteboard>);
scoped_refptr<ui::UniquePasteboard> pasteboard_;
+ // Drag image and offset data.
+ gfx::ImageSkia drag_image_;
+ gfx::Vector2d cursor_offset_;
+
DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderMac);
};

Powered by Google App Engine
This is Rietveld 408576698