summaryrefslogtreecommitdiffstats
path: root/chrome/browser/clipboard_dispatcher.h
diff options
context:
space:
mode:
authordcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-07 22:43:41 +0000
committerdcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-07 22:43:41 +0000
commit97c2c0304fcda75890b4490ca5e6d569db30ca6d (patch)
tree083da18448d0479ffd8ec09ba530475309bb1fac /chrome/browser/clipboard_dispatcher.h
parent156c84585048ca444173b55097392e43c199a56c (diff)
downloadchromium_src-97c2c0304fcda75890b4490ca5e6d569db30ca6d.zip
chromium_src-97c2c0304fcda75890b4490ca5e6d569db30ca6d.tar.gz
chromium_src-97c2c0304fcda75890b4490ca5e6d569db30ca6d.tar.bz2
Implement new Chromium IPCs for copying/dragging.
A new ClipboardDispatcher interface has been added to handle the IPC calls. The new methods don't really belong on the existing Clipboard class, since that class deals with only copy and paste. On Windows and Mac, ClipboardDispatcher will share logic for copy/paste and drag/drop. GTK will have to use two separate code paths. BUG=31037 TEST=none Review URL: http://codereview.chromium.org/2842016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51790 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/clipboard_dispatcher.h')
-rw-r--r--chrome/browser/clipboard_dispatcher.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/chrome/browser/clipboard_dispatcher.h b/chrome/browser/clipboard_dispatcher.h
new file mode 100644
index 0000000..e346799
--- /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_
+