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

Unified Diff: chrome/browser/clipboard_dispatcher.h

Issue 2842016: Implement new Chromium IPCs for copying/dragging (Closed)
Patch Set: . Created 10 years, 5 months 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 | « app/clipboard/clipboard.h ('k') | chrome/browser/clipboard_dispatcher_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/clipboard_dispatcher.h
diff --git a/chrome/browser/clipboard_dispatcher.h b/chrome/browser/clipboard_dispatcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..e3467992870a4eec7d1fc91a30232a429ba01c03
--- /dev/null
+++ b/chrome/browser/clipboard_dispatcher.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2010 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.
+
+#ifndef CHROME_BROWSER_CLIPBOARD_DISPATCHER_H_
+#define CHROME_BROWSER_CLIPBOARD_DISPATCHER_H_
+
+#include <vector>
+
+#include "app/clipboard/clipboard.h"
+#include "base/basictypes.h"
+#include "base/string16.h"
+
+// This class backs IPC requests from the renderer for clipboard data. In this
+// context, clipboard does not only refer to the usual concept of a clipboard
+// for copy/paste, which is why it's not in app/clipboard/clipboard.h. It can
+// refer to one of three different types of clipboards:
+// - The copy/paste clipboard, which contains data that has been copied/cut.
+// - The dragging clipboard, which contains data that is currently being
+// dragged.
+// - On X, the selection clipboard, which contains data for the current
+// selection.
+class ClipboardDispatcher {
+ public:
+ static bool ReadAvailableTypes(Clipboard::Buffer buffer,
+ std::vector<string16>* types,
+ bool* contains_filenames);
+ static bool ReadData(Clipboard::Buffer buffer, const string16& type,
+ string16* data, string16* metadata);
+ static bool ReadFilenames(Clipboard::Buffer buffer,
+ std::vector<string16>* filenames);
+
+ private:
+ // This class is not meant to be instantiated. All public members are static.
+ ClipboardDispatcher();
+
+ DISALLOW_COPY_AND_ASSIGN(ClipboardDispatcher);
+};
+
+#endif // CHROME_BROWSER_CLIPBOARD_DISPATCHER_H_
+
« no previous file with comments | « app/clipboard/clipboard.h ('k') | chrome/browser/clipboard_dispatcher_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698