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