| 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 #import "base/mac/scoped_nsobject.h" | |
| 9 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #import "ui/base/clipboard/clipboard_util_mac.h" |
| 10 #include "ui/base/dragdrop/os_exchange_data.h" | 11 #include "ui/base/dragdrop/os_exchange_data.h" |
| 11 | 12 |
| 12 @class NSPasteboard; | 13 @class NSPasteboard; |
| 13 | 14 |
| 14 namespace ui { | 15 namespace ui { |
| 16 class UniquePasteboard; |
| 15 | 17 |
| 16 // OSExchangeData::Provider implementation for Mac. | 18 // OSExchangeData::Provider implementation for Mac. |
| 17 class UI_BASE_EXPORT OSExchangeDataProviderMac | 19 class UI_BASE_EXPORT OSExchangeDataProviderMac |
| 18 : public OSExchangeData::Provider { | 20 : public OSExchangeData::Provider { |
| 19 public: | 21 public: |
| 20 OSExchangeDataProviderMac(); | 22 OSExchangeDataProviderMac(); |
| 21 explicit OSExchangeDataProviderMac(NSPasteboard* pasteboard); | |
| 22 ~OSExchangeDataProviderMac() override; | 23 ~OSExchangeDataProviderMac() override; |
| 23 | 24 |
| 24 // Overridden from OSExchangeData::Provider: | 25 // Overridden from OSExchangeData::Provider: |
| 25 Provider* Clone() const override; | 26 Provider* Clone() const override; |
| 26 void MarkOriginatedFromRenderer() override; | 27 void MarkOriginatedFromRenderer() override; |
| 27 bool DidOriginateFromRenderer() const override; | 28 bool DidOriginateFromRenderer() const override; |
| 28 void SetString(const base::string16& data) override; | 29 void SetString(const base::string16& data) override; |
| 29 void SetURL(const GURL& url, const base::string16& title) override; | 30 void SetURL(const GURL& url, const base::string16& title) override; |
| 30 void SetFilename(const base::FilePath& path) override; | 31 void SetFilename(const base::FilePath& path) override; |
| 31 void SetFilenames(const std::vector<FileInfo>& filenames) override; | 32 void SetFilenames(const std::vector<FileInfo>& filenames) override; |
| 32 void SetPickledData(const Clipboard::FormatType& format, | 33 void SetPickledData(const Clipboard::FormatType& format, |
| 33 const base::Pickle& data) override; | 34 const base::Pickle& data) override; |
| 34 bool GetString(base::string16* data) const override; | 35 bool GetString(base::string16* data) const override; |
| 35 bool GetURLAndTitle(OSExchangeData::FilenameToURLPolicy policy, | 36 bool GetURLAndTitle(OSExchangeData::FilenameToURLPolicy policy, |
| 36 GURL* url, | 37 GURL* url, |
| 37 base::string16* title) const override; | 38 base::string16* title) const override; |
| 38 bool GetFilename(base::FilePath* path) const override; | 39 bool GetFilename(base::FilePath* path) const override; |
| 39 bool GetFilenames(std::vector<FileInfo>* filenames) const override; | 40 bool GetFilenames(std::vector<FileInfo>* filenames) const override; |
| 40 bool GetPickledData(const Clipboard::FormatType& format, | 41 bool GetPickledData(const Clipboard::FormatType& format, |
| 41 base::Pickle* data) const override; | 42 base::Pickle* data) const override; |
| 42 bool HasString() const override; | 43 bool HasString() const override; |
| 43 bool HasURL(OSExchangeData::FilenameToURLPolicy policy) const override; | 44 bool HasURL(OSExchangeData::FilenameToURLPolicy policy) const override; |
| 44 bool HasFile() const override; | 45 bool HasFile() const override; |
| 45 bool HasCustomFormat(const Clipboard::FormatType& format) const override; | 46 bool HasCustomFormat(const Clipboard::FormatType& format) const override; |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 base::scoped_nsobject<NSPasteboard> pasteboard_; | 49 explicit OSExchangeDataProviderMac(scoped_refptr<ui::UniquePasteboard>); |
| 50 scoped_refptr<ui::UniquePasteboard> pasteboard_; |
| 49 | 51 |
| 50 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderMac); | 52 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderMac); |
| 51 }; | 53 }; |
| 52 | 54 |
| 53 } // namespace ui | 55 } // namespace ui |
| 54 | 56 |
| 55 #endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_MAC_H_ | 57 #endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_MAC_H_ |
| OLD | NEW |