When Retrier succeeds, record errors it encountered.
[chromium-blink-merge.git] / ui / base / clipboard / custom_data_helper.h
blobab7aae99eca3e58ae79df67f21c0ab2d24de5317
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
3 // found in the LICENSE file.
4 //
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
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.
10 #ifndef UI_BASE_CLIPBOARD_CUSTOM_DATA_HELPER_H_
11 #define UI_BASE_CLIPBOARD_CUSTOM_DATA_HELPER_H_
13 #include <map>
14 #include <vector>
16 #include "base/string16.h"
17 #include "ui/base/ui_export.h"
19 class Pickle;
21 #if defined(OS_MACOSX)
22 #ifdef __OBJC__
23 @class NSString;
24 #else
25 class NSString;
26 #endif
27 #endif // defined(OS_MACOSX)
29 namespace ui {
31 #if defined(OS_MACOSX)
32 UI_EXPORT extern NSString* const kWebCustomDataPboardType;
33 #elif (!defined(OS_WIN) && defined(USE_AURA)) || defined(TOOLKIT_GTK)
34 UI_EXPORT extern const char kMimeTypeWebCustomData[];
35 #endif
37 UI_EXPORT void ReadCustomDataTypes(const void* data,
38 size_t data_length,
39 std::vector<string16>* types);
40 UI_EXPORT void ReadCustomDataForType(const void* data,
41 size_t data_length,
42 const string16& type,
43 string16* result);
44 UI_EXPORT void ReadCustomDataIntoMap(const void* data,
45 size_t data_length,
46 std::map<string16, string16>* result);
48 UI_EXPORT void WriteCustomDataToPickle(const std::map<string16, string16>& data,
49 Pickle* pickle);
51 } // namespace ui
53 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_