| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Due to restrictions of most operating systems, we don't directly map each | 5 // Due to restrictions of most operating systems, we don't directly map each |
| 6 // type of custom data to a native data transfer type. Instead, we serialize | 6 // type of custom data to a native data transfer type. Instead, we serialize |
| 7 // each key-value pair into the pickle as a pair of string objects, and then | 7 // each key-value pair into the pickle as a pair of string objects, and then |
| 8 // write the binary data in the pickle to the native data transfer object. | 8 // write the binary data in the pickle to the native data transfer object. |
| 9 | 9 |
| 10 #ifndef UI_BASE_CLIPBOARD_CUSTOM_DATA_HELPER_H_ | 10 #ifndef UI_BASE_CLIPBOARD_CUSTOM_DATA_HELPER_H_ |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 @class NSString; | 28 @class NSString; |
| 29 #else | 29 #else |
| 30 class NSString; | 30 class NSString; |
| 31 #endif | 31 #endif |
| 32 #endif // defined(OS_MACOSX) | 32 #endif // defined(OS_MACOSX) |
| 33 | 33 |
| 34 namespace ui { | 34 namespace ui { |
| 35 | 35 |
| 36 #if defined(OS_MACOSX) && !defined(USE_AURA) | 36 #if defined(OS_MACOSX) && !defined(USE_AURA) |
| 37 UI_BASE_EXPORT extern NSString* const kWebCustomDataPboardType; | 37 UI_BASE_EXPORT extern NSString* const kWebCustomDataPboardType; |
| 38 #elif !defined(OS_WIN) && defined(USE_AURA) |
| 39 UI_BASE_EXPORT extern const char kMimeTypeWebCustomData[]; |
| 38 #endif | 40 #endif |
| 39 | 41 |
| 40 UI_BASE_EXPORT void ReadCustomDataTypes(const void* data, | 42 UI_BASE_EXPORT void ReadCustomDataTypes(const void* data, |
| 41 size_t data_length, | 43 size_t data_length, |
| 42 std::vector<base::string16>* types); | 44 std::vector<base::string16>* types); |
| 43 UI_BASE_EXPORT void ReadCustomDataForType(const void* data, | 45 UI_BASE_EXPORT void ReadCustomDataForType(const void* data, |
| 44 size_t data_length, | 46 size_t data_length, |
| 45 const base::string16& type, | 47 const base::string16& type, |
| 46 base::string16* result); | 48 base::string16* result); |
| 47 UI_BASE_EXPORT void ReadCustomDataIntoMap( | 49 UI_BASE_EXPORT void ReadCustomDataIntoMap( |
| 48 const void* data, | 50 const void* data, |
| 49 size_t data_length, | 51 size_t data_length, |
| 50 std::map<base::string16, base::string16>* result); | 52 std::map<base::string16, base::string16>* result); |
| 51 | 53 |
| 52 UI_BASE_EXPORT void WriteCustomDataToPickle( | 54 UI_BASE_EXPORT void WriteCustomDataToPickle( |
| 53 const std::map<base::string16, base::string16>& data, | 55 const std::map<base::string16, base::string16>& data, |
| 54 base::Pickle* pickle); | 56 base::Pickle* pickle); |
| 55 | 57 |
| 56 } // namespace ui | 58 } // namespace ui |
| 57 | 59 |
| 58 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ | 60 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ |
| OLD | NEW |