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