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

Unified Diff: content/browser/renderer_host/clipboard_message_filter.cc

Issue 6625075: Add stubs and glue for routing a request for an image from the clipboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 9 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 | « content/browser/renderer_host/clipboard_message_filter.h ('k') | ui/base/clipboard/clipboard.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/clipboard_message_filter.cc
diff --git a/content/browser/renderer_host/clipboard_message_filter.cc b/content/browser/renderer_host/clipboard_message_filter.cc
index 8cb3b9d620a11d2857b09d2d7a8248e52d927a52..ca71e5dcb6cd956745547e653b4e1a139e0c4add 100644
--- a/content/browser/renderer_host/clipboard_message_filter.cc
+++ b/content/browser/renderer_host/clipboard_message_filter.cc
@@ -38,7 +38,9 @@ ClipboardMessageFilter::ClipboardMessageFilter() {
void ClipboardMessageFilter::OverrideThreadForMessage(
const IPC::Message& message, BrowserThread::ID* thread) {
#if defined(USE_X11)
- if (IPC_MESSAGE_CLASS(message) == ClipboardMsgStart)
+ if (message.type() == ClipboardHostMsg_ReadImage::ID)
+ *thread = BrowserThread::BACKGROUND_X11;
+ else if (IPC_MESSAGE_CLASS(message) == ClipboardMsgStart)
*thread = BrowserThread::UI;
#endif
}
@@ -53,6 +55,7 @@ bool ClipboardMessageFilter::OnMessageReceived(const IPC::Message& message,
IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadText, OnReadText)
IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadAsciiText, OnReadAsciiText)
IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadHTML, OnReadHTML)
+ IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadImage, OnReadImage)
#if defined(OS_MACOSX)
IPC_MESSAGE_HANDLER(ClipboardHostMsg_FindPboardWriteStringAsync,
OnFindPboardWriteString)
@@ -132,6 +135,11 @@ void ClipboardMessageFilter::OnReadHTML(
*url = GURL(src_url_str);
}
+void ClipboardMessageFilter::OnReadImage(
+ ui::Clipboard::Buffer buffer, std::string* data) {
+ GetClipboard()->ReadImage(buffer, data);
+}
+
void ClipboardMessageFilter::OnReadAvailableTypes(
ui::Clipboard::Buffer buffer, bool* succeeded, std::vector<string16>* types,
bool* contains_filenames) {
« no previous file with comments | « content/browser/renderer_host/clipboard_message_filter.h ('k') | ui/base/clipboard/clipboard.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698