Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: ui/base/clipboard/custom_data_helper.h

Issue 8803005: Helpers to pickle custom data for web copy/paste and drag/drop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove clunky StringPiece usage. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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.
9
10 #ifndef UI_BASE_CLIPBOARD_CUSTOM_DATA_HELPER_H_
11 #define UI_BASE_CLIPBOARD_CUSTOM_DATA_HELPER_H_
12 #pragma once
13
14 #include <map>
15 #include <vector>
16
17 #include "base/string16.h"
18 #include "ui/base/ui_export.h"
19
20 class Pickle;
21
22 namespace ui {
23
24 UI_EXPORT void ReadCustomDataTypes(const void* data,
25 size_t data_length,
26 std::vector<string16>* types);
27 UI_EXPORT void ReadCustomDataForType(const void* data,
28 size_t data_length,
29 const string16& type,
30 string16* result);
31 UI_EXPORT void ReadCustomDataIntoMap(const void* data,
32 size_t data_length,
33 std::map<string16, string16>* result);
34
35 UI_EXPORT void WriteCustomDataToPickle(const std::map<string16, string16>& data,
36 Pickle* pickle);
37
38 } // namespace ui
39
40 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_
OLDNEW
« no previous file with comments | « no previous file | ui/base/clipboard/custom_data_helper.cc » ('j') | ui/base/clipboard/custom_data_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698