summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/common/clipboard_messages.h9
-rw-r--r--chrome/renderer/renderer_glue.cc16
-rw-r--r--content/browser/renderer_host/clipboard_message_filter.cc10
-rw-r--r--content/browser/renderer_host/clipboard_message_filter.h7
-rw-r--r--ui/base/clipboard/clipboard.h3
-rw-r--r--ui/base/clipboard/clipboard_linux.cc14
-rw-r--r--ui/base/clipboard/clipboard_mac.mm13
-rw-r--r--ui/base/clipboard/clipboard_win.cc13
-rw-r--r--webkit/glue/webkit_glue.h10
-rw-r--r--webkit/tools/test_shell/simple_clipboard_impl.cc14
10 files changed, 73 insertions, 36 deletions
diff --git a/chrome/common/clipboard_messages.h b/chrome/common/clipboard_messages.h
index 7679c3f..7fe14af 100644
--- a/chrome/common/clipboard_messages.h
+++ b/chrome/common/clipboard_messages.h
@@ -31,6 +31,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(ClipboardHostMsg_IsFormatAvailable,
std::string /* format */,
ui::Clipboard::Buffer /* buffer */,
bool /* result */)
+IPC_SYNC_MESSAGE_CONTROL1_2(ClipboardHostMsg_ReadAvailableTypes,
+ ui::Clipboard::Buffer /* buffer */,
+ std::vector<string16> /* types */,
+ bool /* contains filenames */)
IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_ReadText,
ui::Clipboard::Buffer /* buffer */,
string16 /* result */)
@@ -48,11 +52,6 @@ IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_ReadImage,
IPC_MESSAGE_CONTROL1(ClipboardHostMsg_FindPboardWriteStringAsync,
string16 /* text */)
#endif
-IPC_SYNC_MESSAGE_CONTROL1_3(ClipboardHostMsg_ReadAvailableTypes,
- ui::Clipboard::Buffer /* buffer */,
- bool /* result */,
- std::vector<string16> /* types */,
- bool /* contains filenames */)
IPC_SYNC_MESSAGE_CONTROL2_3(ClipboardHostMsg_ReadData,
ui::Clipboard::Buffer /* buffer */,
string16 /* type */,
diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc
index 4b31730..5cabf27 100644
--- a/chrome/renderer/renderer_glue.cc
+++ b/chrome/renderer/renderer_glue.cc
@@ -166,6 +166,13 @@ bool ClipboardIsFormatAvailable(const ui::Clipboard::FormatType& format,
return result;
}
+void ClipboardReadAvailableTypes(ui::Clipboard::Buffer buffer,
+ std::vector<string16>* types,
+ bool* contains_filenames) {
+ RenderThread::current()->Send(new ClipboardHostMsg_ReadAvailableTypes(
+ buffer, types, contains_filenames));
+}
+
void ClipboardReadText(ui::Clipboard::Buffer buffer, string16* result) {
RenderThread::current()->Send(new ClipboardHostMsg_ReadText(buffer, result));
}
@@ -185,15 +192,6 @@ void ClipboardReadImage(ui::Clipboard::Buffer buffer, std::string* data) {
RenderThread::current()->Send(new ClipboardHostMsg_ReadImage(buffer, data));
}
-bool ClipboardReadAvailableTypes(ui::Clipboard::Buffer buffer,
- std::vector<string16>* types,
- bool* contains_filenames) {
- bool result = false;
- RenderThread::current()->Send(new ClipboardHostMsg_ReadAvailableTypes(
- buffer, &result, types, contains_filenames));
- return result;
-}
-
bool ClipboardReadData(ui::Clipboard::Buffer buffer, const string16& type,
string16* data, string16* metadata) {
bool result = false;
diff --git a/content/browser/renderer_host/clipboard_message_filter.cc b/content/browser/renderer_host/clipboard_message_filter.cc
index ca71e5d..741d435 100644
--- a/content/browser/renderer_host/clipboard_message_filter.cc
+++ b/content/browser/renderer_host/clipboard_message_filter.cc
@@ -52,6 +52,8 @@ bool ClipboardMessageFilter::OnMessageReceived(const IPC::Message& message,
IPC_MESSAGE_HANDLER(ClipboardHostMsg_WriteObjectsAsync, OnWriteObjectsAsync)
IPC_MESSAGE_HANDLER(ClipboardHostMsg_WriteObjectsSync, OnWriteObjectsSync)
IPC_MESSAGE_HANDLER(ClipboardHostMsg_IsFormatAvailable, OnIsFormatAvailable)
+ IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadAvailableTypes,
+ OnReadAvailableTypes)
IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadText, OnReadText)
IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadAsciiText, OnReadAsciiText)
IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadHTML, OnReadHTML)
@@ -60,8 +62,6 @@ bool ClipboardMessageFilter::OnMessageReceived(const IPC::Message& message,
IPC_MESSAGE_HANDLER(ClipboardHostMsg_FindPboardWriteStringAsync,
OnFindPboardWriteString)
#endif
- IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadAvailableTypes,
- OnReadAvailableTypes)
IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadData, OnReadData)
IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadFilenames, OnReadFilenames)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -141,11 +141,9 @@ void ClipboardMessageFilter::OnReadImage(
}
void ClipboardMessageFilter::OnReadAvailableTypes(
- ui::Clipboard::Buffer buffer, bool* succeeded, std::vector<string16>* types,
+ ui::Clipboard::Buffer buffer, std::vector<string16>* types,
bool* contains_filenames) {
- *contains_filenames = false;
- *succeeded = ClipboardDispatcher::ReadAvailableTypes(
- buffer, types, contains_filenames);
+ GetClipboard()->ReadAvailableTypes(buffer, types, contains_filenames);
}
void ClipboardMessageFilter::OnReadData(
diff --git a/content/browser/renderer_host/clipboard_message_filter.h b/content/browser/renderer_host/clipboard_message_filter.h
index 682e241e..b77a5a2 100644
--- a/content/browser/renderer_host/clipboard_message_filter.h
+++ b/content/browser/renderer_host/clipboard_message_filter.h
@@ -32,6 +32,9 @@ class ClipboardMessageFilter : public BrowserMessageFilter {
void OnIsFormatAvailable(ui::Clipboard::FormatType format,
ui::Clipboard::Buffer buffer,
bool* result);
+ void OnReadAvailableTypes(ui::Clipboard::Buffer buffer,
+ std::vector<string16>* types,
+ bool* contains_filenames);
void OnReadText(ui::Clipboard::Buffer buffer, string16* result);
void OnReadAsciiText(ui::Clipboard::Buffer buffer, std::string* result);
void OnReadHTML(ui::Clipboard::Buffer buffer, string16* markup, GURL* url);
@@ -39,10 +42,6 @@ class ClipboardMessageFilter : public BrowserMessageFilter {
#if defined(OS_MACOSX)
void OnFindPboardWriteString(const string16& text);
#endif
- void OnReadAvailableTypes(ui::Clipboard::Buffer buffer,
- bool* succeeded,
- std::vector<string16>* types,
- bool* contains_filenames);
void OnReadData(ui::Clipboard::Buffer buffer, const string16& type,
bool* succeeded, string16* data, string16* metadata);
void OnReadFilenames(ui::Clipboard::Buffer buffer, bool* succeeded,
diff --git a/ui/base/clipboard/clipboard.h b/ui/base/clipboard/clipboard.h
index bb3bc29..2d040c8 100644
--- a/ui/base/clipboard/clipboard.h
+++ b/ui/base/clipboard/clipboard.h
@@ -139,6 +139,9 @@ class Clipboard {
bool IsFormatAvailableByString(const std::string& format,
Buffer buffer) const;
+ void ReadAvailableTypes(Buffer buffer, std::vector<string16>* types,
+ bool* contains_filenames) const;
+
// Reads UNICODE text from the clipboard, if available.
void ReadText(Buffer buffer, string16* result) const;
diff --git a/ui/base/clipboard/clipboard_linux.cc b/ui/base/clipboard/clipboard_linux.cc
index 3bb1e88..07ea6b7 100644
--- a/ui/base/clipboard/clipboard_linux.cc
+++ b/ui/base/clipboard/clipboard_linux.cc
@@ -292,6 +292,20 @@ bool Clipboard::IsFormatAvailableByString(const std::string& format,
return IsFormatAvailable(format, buffer);
}
+void Clipboard::ReadAvailableTypes(Clipboard::Buffer buffer,
+ std::vector<string16>* types,
+ bool* contains_filenames) const {
+ if (!types || !contains_filenames) {
+ NOTREACHED();
+ return;
+ }
+
+ // TODO(dcheng): Implement me.
+ types->clear();
+ *contains_filenames = false;
+}
+
+
void Clipboard::ReadText(Clipboard::Buffer buffer, string16* result) const {
GtkClipboard* clipboard = LookupBackingClipboard(buffer);
if (clipboard == NULL)
diff --git a/ui/base/clipboard/clipboard_mac.mm b/ui/base/clipboard/clipboard_mac.mm
index 77f5952..be1908b 100644
--- a/ui/base/clipboard/clipboard_mac.mm
+++ b/ui/base/clipboard/clipboard_mac.mm
@@ -177,6 +177,19 @@ bool Clipboard::IsFormatAvailable(const Clipboard::FormatType& format,
return [types containsObject:format_ns];
}
+void Clipboard::ReadAvailableTypes(Clipboard::Buffer buffer,
+ std::vector<string16>* types,
+ bool* contains_filenames) const {
+ if (!types || !contains_filenames) {
+ NOTREACHED();
+ return;
+ }
+
+ // TODO(dcheng): Implement me.
+ types->clear();
+ *contains_filenames = false;
+}
+
void Clipboard::ReadText(Clipboard::Buffer buffer, string16* result) const {
DCHECK_EQ(buffer, BUFFER_STANDARD);
NSPasteboard* pb = GetPasteboard();
diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
index 603779b..4380b00 100644
--- a/ui/base/clipboard/clipboard_win.cc
+++ b/ui/base/clipboard/clipboard_win.cc
@@ -331,6 +331,19 @@ bool Clipboard::IsFormatAvailableByString(
return ::IsClipboardFormatAvailable(format) != FALSE;
}
+void Clipboard::ReadAvailableTypes(Clipboard::Buffer buffer,
+ std::vector<string16>* types,
+ bool* contains_filenames) const {
+ if (!types || !contains_filenames) {
+ NOTREACHED();
+ return;
+ }
+
+ // TODO(dcheng): Implement me.
+ types->clear();
+ *contains_filenames = false;
+}
+
void Clipboard::ReadText(Clipboard::Buffer buffer, string16* result) const {
DCHECK_EQ(buffer, BUFFER_STANDARD);
if (!result) {
diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h
index 68c3394..a860888 100644
--- a/webkit/glue/webkit_glue.h
+++ b/webkit/glue/webkit_glue.h
@@ -188,6 +188,11 @@ ui::Clipboard* ClipboardGetClipboard();
bool ClipboardIsFormatAvailable(const ui::Clipboard::FormatType& format,
ui::Clipboard::Buffer buffer);
+// Reads the available types from the clipboard, if available.
+void ClipboardReadAvailableTypes(ui::Clipboard::Buffer buffer,
+ std::vector<string16>* types,
+ bool* contains_filenames);
+
// Reads UNICODE text from the clipboard, if available.
void ClipboardReadText(ui::Clipboard::Buffer buffer, string16* result);
@@ -200,11 +205,6 @@ void ClipboardReadHTML(ui::Clipboard::Buffer buffer, string16* markup,
void ClipboardReadImage(ui::Clipboard::Buffer buffer, std::string* data);
-// Reads the available types from the clipboard, if available.
-bool ClipboardReadAvailableTypes(ui::Clipboard::Buffer buffer,
- std::vector<string16>* types,
- bool* contains_filenames);
-
// Reads one type of data from the clipboard, if available.
bool ClipboardReadData(ui::Clipboard::Buffer buffer, const string16& type,
string16* data, string16* metadata);
diff --git a/webkit/tools/test_shell/simple_clipboard_impl.cc b/webkit/tools/test_shell/simple_clipboard_impl.cc
index cf7c43b..cd12ded 100644
--- a/webkit/tools/test_shell/simple_clipboard_impl.cc
+++ b/webkit/tools/test_shell/simple_clipboard_impl.cc
@@ -36,6 +36,13 @@ bool ClipboardIsFormatAvailable(const ui::Clipboard::FormatType& format,
return ClipboardGetClipboard()->IsFormatAvailable(format, buffer);
}
+// TODO(dcheng): Implement.
+void ClipboardReadAvailableTypes(ui::Clipboard::Buffer buffer,
+ std::vector<string16>* types,
+ bool* contains_filenames) {
+ return;
+}
+
void ClipboardReadText(ui::Clipboard::Buffer buffer, string16* result) {
ClipboardGetClipboard()->ReadText(buffer, result);
}
@@ -56,13 +63,6 @@ void ClipboardReadImage(ui::Clipboard::Buffer buffer, std::string* data) {
ClipboardGetClipboard()->ReadImage(buffer, data);
}
-// TODO(dcheng): Implement.
-bool ClipboardReadAvailableTypes(ui::Clipboard::Buffer buffer,
- std::vector<string16>* types,
- bool* contains_filenames) {
- return false;
-}
-
bool ClipboardReadData(ui::Clipboard::Buffer buffer, const string16& type,
string16* data, string16* metadata) {
return false;