| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_MAC_H_ | 5 #ifndef UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_MAC_H_ |
| 6 #define UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_MAC_H_ | 6 #define UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_MAC_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #import "ui/base/clipboard/clipboard_util_mac.h" | 10 #import "ui/base/clipboard/clipboard_util_mac.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 bool GetFilename(base::FilePath* path) const override; | 44 bool GetFilename(base::FilePath* path) const override; |
| 45 bool GetFilenames(std::vector<FileInfo>* filenames) const override; | 45 bool GetFilenames(std::vector<FileInfo>* filenames) const override; |
| 46 bool GetPickledData(const Clipboard::FormatType& format, | 46 bool GetPickledData(const Clipboard::FormatType& format, |
| 47 base::Pickle* data) const override; | 47 base::Pickle* data) const override; |
| 48 bool HasString() const override; | 48 bool HasString() const override; |
| 49 bool HasURL(OSExchangeData::FilenameToURLPolicy policy) const override; | 49 bool HasURL(OSExchangeData::FilenameToURLPolicy policy) const override; |
| 50 bool HasFile() const override; | 50 bool HasFile() const override; |
| 51 bool HasCustomFormat(const Clipboard::FormatType& format) const override; | 51 bool HasCustomFormat(const Clipboard::FormatType& format) const override; |
| 52 void SetDragImage(const gfx::ImageSkia& image, | 52 void SetDragImage(const gfx::ImageSkia& image, |
| 53 const gfx::Vector2d& cursor_offset) override; | 53 const gfx::Vector2d& cursor_offset) override; |
| 54 const gfx::ImageSkia& GetDragImage() const override; | 54 gfx::ImageSkia GetDragImage() const override; |
| 55 const gfx::Vector2d& GetDragImageOffset() const override; | 55 gfx::Vector2d GetDragImageOffset() const override; |
| 56 | 56 |
| 57 // Returns the data for the specified type in the pasteboard. | 57 // Returns the data for the specified type in the pasteboard. |
| 58 NSData* GetNSDataForType(NSString* type) const; | 58 NSData* GetNSDataForType(NSString* type) const; |
| 59 | 59 |
| 60 // Creates an OSExchangeData object from the given NSPasteboard object. | 60 // Creates an OSExchangeData object from the given NSPasteboard object. |
| 61 static std::unique_ptr<OSExchangeData> CreateDataFromPasteboard( | 61 static std::unique_ptr<OSExchangeData> CreateDataFromPasteboard( |
| 62 NSPasteboard* pasteboard); | 62 NSPasteboard* pasteboard); |
| 63 | 63 |
| 64 // Returns an array of pasteboard types that can be supported by | 64 // Returns an array of pasteboard types that can be supported by |
| 65 // OSExchangeData. | 65 // OSExchangeData. |
| 66 static NSArray* SupportedPasteboardTypes(); | 66 static NSArray* SupportedPasteboardTypes(); |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 explicit OSExchangeDataProviderMac(scoped_refptr<ui::UniquePasteboard>); | 69 explicit OSExchangeDataProviderMac(scoped_refptr<ui::UniquePasteboard>); |
| 70 scoped_refptr<ui::UniquePasteboard> pasteboard_; | 70 scoped_refptr<ui::UniquePasteboard> pasteboard_; |
| 71 | 71 |
| 72 // Drag image and offset data. | 72 // Drag image and offset data. |
| 73 gfx::ImageSkia drag_image_; | 73 gfx::ImageSkia drag_image_; |
| 74 gfx::Vector2d cursor_offset_; | 74 gfx::Vector2d cursor_offset_; |
| 75 | 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderMac); | 76 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderMac); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 } // namespace ui | 79 } // namespace ui |
| 80 | 80 |
| 81 #endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_MAC_H_ | 81 #endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_MAC_H_ |
| OLD | NEW |