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

Unified 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: Review comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/base/clipboard/custom_data_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/clipboard/custom_data_helper.h
diff --git a/ui/base/clipboard/custom_data_helper.h b/ui/base/clipboard/custom_data_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..3294f5168e60f989e0fdb426b0dbe8b052f2d35f
--- /dev/null
+++ b/ui/base/clipboard/custom_data_helper.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Due to restrictions of most operating systems, we don't directly map each
+// type of custom data to a native data transfer type. Instead, we serialize
+// each key-value pair into the pickle as a pair of string objects, and then
+// write the binary data in the pickle to the native data transfer object.
+
+#ifndef UI_BASE_CLIPBOARD_CUSTOM_DATA_HELPER_H_
+#define UI_BASE_CLIPBOARD_CUSTOM_DATA_HELPER_H_
+#pragma once
+
+#include <map>
+#include <vector>
+
+#include "base/string16.h"
+#include "ui/base/ui_export.h"
+
+class Pickle;
+
+namespace ui {
+
+UI_EXPORT void ReadCustomDataTypes(const void* data,
+ size_t data_length,
+ std::vector<string16>* types);
+UI_EXPORT void ReadCustomDataForType(const void* data,
+ size_t data_length,
+ const string16& type,
+ string16* result);
+UI_EXPORT void ReadCustomDataIntoMap(const void* data,
+ size_t data_length,
+ std::map<string16, string16>* result);
+
+UI_EXPORT void WriteCustomDataToPickle(const std::map<string16, string16>& data,
+ Pickle* pickle);
+
+} // namespace ui
+
+#endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_
« no previous file with comments | « no previous file | ui/base/clipboard/custom_data_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698