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_ |
11 #define UI_BASE_CLIPBOARD_CUSTOM_DATA_HELPER_H_ | 11 #define UI_BASE_CLIPBOARD_CUSTOM_DATA_HELPER_H_ |
12 | 12 |
13 #include <map> | 13 #include <map> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
17 #include "ui/base/ui_base_export.h" | 17 #include "ui/base/ui_base_export.h" |
18 | 18 |
| 19 namespace base { |
19 class Pickle; | 20 class Pickle; |
| 21 } |
20 | 22 |
21 #if defined(OS_MACOSX) | 23 #if defined(OS_MACOSX) |
22 #ifdef __OBJC__ | 24 #ifdef __OBJC__ |
23 @class NSString; | 25 @class NSString; |
24 #else | 26 #else |
25 class NSString; | 27 class NSString; |
26 #endif | 28 #endif |
27 #endif // defined(OS_MACOSX) | 29 #endif // defined(OS_MACOSX) |
28 | 30 |
29 namespace ui { | 31 namespace ui { |
(...skipping 11 matching lines...) Expand all Loading... |
41 size_t data_length, | 43 size_t data_length, |
42 const base::string16& type, | 44 const base::string16& type, |
43 base::string16* result); | 45 base::string16* result); |
44 UI_BASE_EXPORT void ReadCustomDataIntoMap( | 46 UI_BASE_EXPORT void ReadCustomDataIntoMap( |
45 const void* data, | 47 const void* data, |
46 size_t data_length, | 48 size_t data_length, |
47 std::map<base::string16, base::string16>* result); | 49 std::map<base::string16, base::string16>* result); |
48 | 50 |
49 UI_BASE_EXPORT void WriteCustomDataToPickle( | 51 UI_BASE_EXPORT void WriteCustomDataToPickle( |
50 const std::map<base::string16, base::string16>& data, | 52 const std::map<base::string16, base::string16>& data, |
51 Pickle* pickle); | 53 base::Pickle* pickle); |
52 | 54 |
53 } // namespace ui | 55 } // namespace ui |
54 | 56 |
55 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ | 57 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ |
OLD | NEW |