summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 22:16:05 +0000
committerjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 22:16:05 +0000
commit65a6150d49263ff6e3135c5631f9ba5eb12823df (patch)
tree36f5b8624ae02cc69ae29ade9923404f6fec80b3 /chrome
parent9f53c7d5f1ce83bb2025b1797300c6d60dd7d8ff (diff)
downloadchromium_src-65a6150d49263ff6e3135c5631f9ba5eb12823df.zip
chromium_src-65a6150d49263ff6e3135c5631f9ba5eb12823df.tar.gz
chromium_src-65a6150d49263ff6e3135c5631f9ba5eb12823df.tar.bz2
Roll webkit deps 48155:48185 and remove a couple of passing tests from test_expectations.txt.
Also, merge in http://codereview.chromium.org/174367 (original author: vandebo@chromium.org), which is the downstream half of r48168. BUG=4360 BUG=21228 BUG=18792 TEST=none TBR=eroman git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25669 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_mac.mm8
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_win.cc8
-rw-r--r--chrome/browser/bookmarks/bookmark_utils.cc2
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc7
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view.h4
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.cc16
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.h7
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc20
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.h15
-rw-r--r--chrome/browser/renderer_host/resource_message_filter_gtk.cc42
-rw-r--r--chrome/common/render_messages.h34
-rw-r--r--chrome/common/render_messages_internal.h20
-rw-r--r--chrome/renderer/render_view.cc12
-rw-r--r--chrome/renderer/render_view.h2
-rw-r--r--chrome/renderer/renderer_glue.cc20
15 files changed, 112 insertions, 105 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
index 83b6214..94a9af6 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
@@ -661,9 +661,10 @@ std::wstring AutocompleteEditViewMac::GetClipboardText(Clipboard* clipboard) {
// will too.
DCHECK(clipboard);
- if (clipboard->IsFormatAvailable(Clipboard::GetPlainTextWFormatType())) {
+ if (clipboard->IsFormatAvailable(Clipboard::GetPlainTextWFormatType(),
+ Clipboard::BUFFER_STANDARD)) {
string16 text16;
- clipboard->ReadText(&text16);
+ clipboard->ReadText(Clipboard::BUFFER_STANDARD, &text16);
// Note: Unlike in the find popup and textfield view, here we completely
// remove whitespace strings containing newlines. We assume users are
@@ -681,7 +682,8 @@ std::wstring AutocompleteEditViewMac::GetClipboardText(Clipboard* clipboard) {
// and pastes from the URL bar to itself, the text will get fixed up and
// cannonicalized, which is not what the user expects. By pasting in this
// order, we are sure to paste what the user copied.
- if (clipboard->IsFormatAvailable(Clipboard::GetUrlWFormatType())) {
+ if (clipboard->IsFormatAvailable(Clipboard::GetUrlWFormatType(),
+ Clipboard::BUFFER_STANDARD)) {
std::string url_str;
clipboard->ReadBookmark(NULL, &url_str);
// pass resulting url string through GURL to normalize
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
index 5fe2ba0..3347a34 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
@@ -2180,9 +2180,10 @@ void AutocompleteEditViewWin::TextChanged() {
std::wstring AutocompleteEditViewWin::GetClipboardText() const {
// Try text format.
Clipboard* clipboard = g_browser_process->clipboard();
- if (clipboard->IsFormatAvailable(Clipboard::GetPlainTextWFormatType())) {
+ if (clipboard->IsFormatAvailable(Clipboard::GetPlainTextWFormatType(),
+ Clipboard::BUFFER_STANDARD)) {
std::wstring text;
- clipboard->ReadText(&text);
+ clipboard->ReadText(Clipboard::BUFFER_STANDARD, &text);
// Note: Unlike in the find popup and textfield view, here we completely
// remove whitespace strings containing newlines. We assume users are
@@ -2200,7 +2201,8 @@ std::wstring AutocompleteEditViewWin::GetClipboardText() const {
// and pastes from the URL bar to itself, the text will get fixed up and
// cannonicalized, which is not what the user expects. By pasting in this
// order, we are sure to paste what the user copied.
- if (clipboard->IsFormatAvailable(Clipboard::GetUrlWFormatType())) {
+ if (clipboard->IsFormatAvailable(Clipboard::GetUrlWFormatType(),
+ Clipboard::BUFFER_STANDARD)) {
std::string url_str;
clipboard->ReadBookmark(NULL, &url_str);
// pass resulting url string through GURL to normalize
diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc
index 51250c3..25daf35 100644
--- a/chrome/browser/bookmarks/bookmark_utils.cc
+++ b/chrome/browser/bookmarks/bookmark_utils.cc
@@ -392,7 +392,7 @@ bool CanPasteFromClipboard(const BookmarkNode* node) {
return false;
return g_browser_process->clipboard()->IsFormatAvailable(
- BookmarkDragData::kClipboardFormatString);
+ BookmarkDragData::kClipboardFormatString, Clipboard::BUFFER_STANDARD);
}
std::string GetNameForURL(const GURL& url) {
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index 066d1cc..9085996 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -825,8 +825,6 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
OnRemoveAutofillEntry)
IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRequest, OnExtensionRequest)
IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged)
- IPC_MESSAGE_HANDLER(ViewHostMsg_PasteFromSelectionClipboard,
- OnMsgPasteFromSelectionClipboard)
IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionPostMessage,
OnExtensionPostMessage)
IPC_MESSAGE_HANDLER(ViewHostMsg_AccessibilityFocusChange,
@@ -1262,11 +1260,6 @@ void RenderViewHost::OnMsgSelectionChanged(const std::string& text) {
view()->SelectionChanged(text);
}
-void RenderViewHost::OnMsgPasteFromSelectionClipboard() {
- if (view())
- view()->PasteFromSelectionClipboard();
-}
-
void RenderViewHost::OnMsgRunFileChooser(bool multiple_files,
const string16& title,
const FilePath& default_file) {
diff --git a/chrome/browser/renderer_host/render_widget_host_view.h b/chrome/browser/renderer_host/render_widget_host_view.h
index 508be27..05f3f6d 100644
--- a/chrome/browser/renderer_host/render_widget_host_view.h
+++ b/chrome/browser/renderer_host/render_widget_host_view.h
@@ -132,10 +132,6 @@ class RenderWidgetHostView {
// Notifies the View that the renderer text selection has changed.
virtual void SelectionChanged(const std::string& text) { };
- // Tells the View to get the text from the selection clipboard and send it
- // back to the renderer asynchronously.
- virtual void PasteFromSelectionClipboard() { }
-
// Tells the View whether the context menu is showing. This is used on Linux
// to suppress updates to webkit focus for the duration of the show.
virtual void ShowingContextMenu(bool showing) { }
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
index ec6be0f..460d4f7 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -524,11 +524,6 @@ void RenderWidgetHostViewGtk::SelectionChanged(const std::string& text) {
gtk_clipboard_set_text(x_clipboard, text.c_str(), text.length());
}
-void RenderWidgetHostViewGtk::PasteFromSelectionClipboard() {
- GtkClipboard* x_clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY);
- gtk_clipboard_request_text(x_clipboard, ReceivedSelectionText, this);
-}
-
void RenderWidgetHostViewGtk::ShowingContextMenu(bool showing) {
is_showing_context_menu_ = showing;
}
@@ -614,17 +609,6 @@ void RenderWidgetHostViewGtk::ShowCurrentCursor() {
gdk_cursor_unref(gdk_cursor);
}
-void RenderWidgetHostViewGtk::ReceivedSelectionText(GtkClipboard* clipboard,
- const gchar* text, gpointer userdata) {
- // If there's nothing to paste (|text| is NULL), do nothing.
- if (!text)
- return;
- RenderWidgetHostViewGtk* host_view =
- reinterpret_cast<RenderWidgetHostViewGtk*>(userdata);
- host_view->host_->Send(new ViewMsg_InsertText(host_view->host_->routing_id(),
- UTF8ToUTF16(text)));
-}
-
void RenderWidgetHostViewGtk::CreatePluginContainer(
gfx::PluginWindowHandle id) {
plugin_container_manager_.CreatePluginContainer(id);
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.h b/chrome/browser/renderer_host/render_widget_host_view_gtk.h
index 9f5c76d..c0e3d6f 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.h
@@ -61,7 +61,6 @@ class RenderWidgetHostViewGtk : public RenderWidgetHostView {
virtual void Destroy();
virtual void SetTooltipText(const std::wstring& tooltip_text);
virtual void SelectionChanged(const std::string& text);
- virtual void PasteFromSelectionClipboard();
virtual void ShowingContextMenu(bool showing);
virtual BackingStore* AllocBackingStore(const gfx::Size& size);
virtual void SetBackground(const SkBitmap& background);
@@ -78,12 +77,6 @@ class RenderWidgetHostViewGtk : public RenderWidgetHostView {
// Update the display cursor for the render view.
void ShowCurrentCursor();
- // When we've requested the text from the X clipboard, GTK returns it to us
- // through this callback.
- static void ReceivedSelectionText(GtkClipboard* clipboard,
- const gchar* text,
- gpointer userdata);
-
// The model object.
RenderWidgetHost* const host_;
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index ed4a525..5a21f34 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -625,30 +625,34 @@ void ResourceMessageFilter::OnClipboardWriteObjects(
// functions.
void ResourceMessageFilter::OnClipboardIsFormatAvailable(
- Clipboard::FormatType format, IPC::Message* reply) {
- const bool result = GetClipboard()->IsFormatAvailable(format);
+ Clipboard::FormatType format, Clipboard::Buffer buffer,
+ IPC::Message* reply) {
+ const bool result = GetClipboard()->IsFormatAvailable(format, buffer);
ViewHostMsg_ClipboardIsFormatAvailable::WriteReplyParams(reply, result);
Send(reply);
}
-void ResourceMessageFilter::OnClipboardReadText(IPC::Message* reply) {
+void ResourceMessageFilter::OnClipboardReadText(Clipboard::Buffer buffer,
+ IPC::Message* reply) {
string16 result;
- GetClipboard()->ReadText(&result);
+ GetClipboard()->ReadText(buffer, &result);
ViewHostMsg_ClipboardReadText::WriteReplyParams(reply, result);
Send(reply);
}
-void ResourceMessageFilter::OnClipboardReadAsciiText(IPC::Message* reply) {
+void ResourceMessageFilter::OnClipboardReadAsciiText(Clipboard::Buffer buffer,
+ IPC::Message* reply) {
std::string result;
- GetClipboard()->ReadAsciiText(&result);
+ GetClipboard()->ReadAsciiText(buffer, &result);
ViewHostMsg_ClipboardReadAsciiText::WriteReplyParams(reply, result);
Send(reply);
}
-void ResourceMessageFilter::OnClipboardReadHTML(IPC::Message* reply) {
+void ResourceMessageFilter::OnClipboardReadHTML(Clipboard::Buffer buffer,
+ IPC::Message* reply) {
std::string src_url_str;
string16 markup;
- GetClipboard()->ReadHTML(&markup, &src_url_str);
+ GetClipboard()->ReadHTML(buffer, &markup, &src_url_str);
const GURL src_url = GURL(src_url_str);
ViewHostMsg_ClipboardReadHTML::WriteReplyParams(reply, markup, src_url);
diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h
index feb1e54..4c467c6 100644
--- a/chrome/browser/renderer_host/resource_message_filter.h
+++ b/chrome/browser/renderer_host/resource_message_filter.h
@@ -171,10 +171,11 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter,
void OnClipboardWriteObjects(const Clipboard::ObjectMap& objects);
void OnClipboardIsFormatAvailable(Clipboard::FormatType format,
+ Clipboard::Buffer buffer,
IPC::Message* reply);
- void OnClipboardReadText(IPC::Message* reply);
- void OnClipboardReadAsciiText(IPC::Message* reply);
- void OnClipboardReadHTML(IPC::Message* reply);
+ void OnClipboardReadText(Clipboard::Buffer buffer, IPC::Message* reply);
+ void OnClipboardReadAsciiText(Clipboard::Buffer buffer, IPC::Message* reply);
+ void OnClipboardReadHTML(Clipboard::Buffer buffer, IPC::Message* reply);
#if !defined(OS_MACOSX)
// Not handled in the IO thread on Mac.
@@ -252,10 +253,12 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter,
void DoOnGetWindowRect(gfx::NativeViewId view, IPC::Message* reply_msg);
void DoOnGetRootWindowRect(gfx::NativeViewId view, IPC::Message* reply_msg);
void DoOnClipboardIsFormatAvailable(Clipboard::FormatType format,
+ Clipboard::Buffer buffer,
IPC::Message* reply_msg);
- void DoOnClipboardReadText(IPC::Message* reply_msg);
- void DoOnClipboardReadAsciiText(IPC::Message* reply_msg);
- void DoOnClipboardReadHTML(IPC::Message* reply_msg);
+ void DoOnClipboardReadText(Clipboard::Buffer buffer, IPC::Message* reply_msg);
+ void DoOnClipboardReadAsciiText(Clipboard::Buffer buffer,
+ IPC::Message* reply_msg);
+ void DoOnClipboardReadHTML(Clipboard::Buffer buffer, IPC::Message* reply_msg);
#endif
bool CheckBenchmarkingEnabled();
diff --git a/chrome/browser/renderer_host/resource_message_filter_gtk.cc b/chrome/browser/renderer_host/resource_message_filter_gtk.cc
index 052713c..1dd964d 100644
--- a/chrome/browser/renderer_host/resource_message_filter_gtk.cc
+++ b/chrome/browser/renderer_host/resource_message_filter_gtk.cc
@@ -102,8 +102,9 @@ void ResourceMessageFilter::DoOnGetRootWindowRect(gfx::NativeViewId view,
// Called on the UI thread.
void ResourceMessageFilter::DoOnClipboardIsFormatAvailable(
- Clipboard::FormatType format, IPC::Message* reply_msg) {
- const bool result = GetClipboard()->IsFormatAvailable(format);
+ Clipboard::FormatType format, Clipboard::Buffer buffer,
+ IPC::Message* reply_msg) {
+ const bool result = GetClipboard()->IsFormatAvailable(format, buffer);
ViewHostMsg_ClipboardIsFormatAvailable::WriteReplyParams(reply_msg, result);
@@ -113,9 +114,10 @@ void ResourceMessageFilter::DoOnClipboardIsFormatAvailable(
}
// Called on the UI thread.
-void ResourceMessageFilter::DoOnClipboardReadText(IPC::Message* reply_msg) {
+void ResourceMessageFilter::DoOnClipboardReadText(Clipboard::Buffer buffer,
+ IPC::Message* reply_msg) {
string16 result;
- GetClipboard()->ReadText(&result);
+ GetClipboard()->ReadText(buffer, &result);
ViewHostMsg_ClipboardReadText::WriteReplyParams(reply_msg, result);
@@ -126,9 +128,9 @@ void ResourceMessageFilter::DoOnClipboardReadText(IPC::Message* reply_msg) {
// Called on the UI thread.
void ResourceMessageFilter::DoOnClipboardReadAsciiText(
- IPC::Message* reply_msg) {
+ Clipboard::Buffer buffer, IPC::Message* reply_msg) {
std::string result;
- GetClipboard()->ReadAsciiText(&result);
+ GetClipboard()->ReadAsciiText(buffer, &result);
ViewHostMsg_ClipboardReadAsciiText::WriteReplyParams(reply_msg, result);
@@ -138,10 +140,11 @@ void ResourceMessageFilter::DoOnClipboardReadAsciiText(
}
// Called on the UI thread.
-void ResourceMessageFilter::DoOnClipboardReadHTML(IPC::Message* reply_msg) {
+void ResourceMessageFilter::DoOnClipboardReadHTML(Clipboard::Buffer buffer,
+ IPC::Message* reply_msg) {
std::string src_url_str;
string16 markup;
- GetClipboard()->ReadHTML(&markup, &src_url_str);
+ GetClipboard()->ReadHTML(buffer, &markup, &src_url_str);
const GURL src_url = GURL(src_url_str);
ViewHostMsg_ClipboardReadHTML::WriteReplyParams(reply_msg, markup, src_url);
@@ -177,26 +180,33 @@ void ResourceMessageFilter::OnGetRootWindowRect(gfx::NativeViewId view,
// Called on the IO thread.
void ResourceMessageFilter::OnClipboardIsFormatAvailable(
- Clipboard::FormatType format, IPC::Message* reply_msg) {
+ Clipboard::FormatType format, Clipboard::Buffer buffer,
+ IPC::Message* reply_msg) {
ui_loop()->PostTask(FROM_HERE, NewRunnableMethod(
this, &ResourceMessageFilter::DoOnClipboardIsFormatAvailable, format,
- reply_msg));
+ buffer, reply_msg));
}
// Called on the IO thread.
-void ResourceMessageFilter::OnClipboardReadText(IPC::Message* reply_msg) {
+void ResourceMessageFilter::OnClipboardReadText(Clipboard::Buffer buffer,
+ IPC::Message* reply_msg) {
ui_loop()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &ResourceMessageFilter::DoOnClipboardReadText, reply_msg));
+ this, &ResourceMessageFilter::DoOnClipboardReadText, buffer,
+ reply_msg));
}
// Called on the IO thread.
-void ResourceMessageFilter::OnClipboardReadAsciiText(IPC::Message* reply_msg) {
+void ResourceMessageFilter::OnClipboardReadAsciiText(Clipboard::Buffer buffer,
+ IPC::Message* reply_msg) {
ui_loop()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &ResourceMessageFilter::DoOnClipboardReadAsciiText, reply_msg));
+ this, &ResourceMessageFilter::DoOnClipboardReadAsciiText, buffer,
+ reply_msg));
}
// Called on the IO thread.
-void ResourceMessageFilter::OnClipboardReadHTML(IPC::Message* reply_msg) {
+void ResourceMessageFilter::OnClipboardReadHTML(Clipboard::Buffer buffer,
+ IPC::Message* reply_msg) {
ui_loop()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &ResourceMessageFilter::DoOnClipboardReadHTML, reply_msg));
+ this, &ResourceMessageFilter::DoOnClipboardReadHTML, buffer,
+ reply_msg));
}
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index adfffed..e06838b 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -10,6 +10,7 @@
#include <map>
#include "base/basictypes.h"
+#include "base/clipboard.h"
#include "base/gfx/native_widget_types.h"
#include "base/ref_counted.h"
#include "base/shared_memory.h"
@@ -2186,6 +2187,39 @@ struct ParamTraits<URLPattern> {
}
};
+template <>
+struct ParamTraits<Clipboard::Buffer> {
+ typedef Clipboard::Buffer param_type;
+ static void Write(Message* m, const param_type& p) {
+ m->WriteInt(p);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ int buffer;
+ if (!m->ReadInt(iter, &buffer) || !Clipboard::IsValidBuffer(buffer))
+ return false;
+ *p = Clipboard::FromInt(buffer);
+ return true;
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ std::wstring type;
+ switch (p) {
+ case Clipboard::BUFFER_STANDARD:
+ type = L"BUFFER_STANDARD";
+ break;
+#if defined(OS_LINUX)
+ case Clipboard::BUFFER_SELECTION:
+ type = L"BUFFER_SELECTION";
+ break;
+#endif
+ default:
+ type = L"UNKNOWN";
+ break;
+ }
+
+ LogParam(type, l);
+ }
+};
+
} // namespace IPC
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index aad21c2..22f273d 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -309,10 +309,6 @@ IPC_BEGIN_MESSAGES(View)
IPC_MESSAGE_ROUTED1(ViewMsg_Zoom,
int /* One of PageZoom::Function */)
- // Insert text in the currently focused input area.
- IPC_MESSAGE_ROUTED1(ViewMsg_InsertText,
- string16 /* text */)
-
// Change encoding of page in the renderer.
IPC_MESSAGE_ROUTED1(ViewMsg_SetPageEncoding,
std::string /*new encoding name*/)
@@ -975,10 +971,6 @@ IPC_BEGIN_MESSAGES(ViewHost)
int32 /* page_id */,
GURL /* url of the favicon */)
- // Request that the browser get the text from the selection clipboard and send
- // it back to the renderer via ViewMsg_SelectionClipboardResponse.
- IPC_MESSAGE_ROUTED0(ViewHostMsg_PasteFromSelectionClipboard)
-
// Used to tell the parent that the user right clicked on an area of the
// content area, and a context menu should be shown for it. The params
// object contains information about the node(s) that were selected when the
@@ -1050,14 +1042,18 @@ IPC_BEGIN_MESSAGES(ViewHost)
// free the shared memory used to transfer the bitmap.
IPC_SYNC_MESSAGE_CONTROL1_0(ViewHostMsg_ClipboardWriteObjectsSync,
Clipboard::ObjectMap /* objects */)
- IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_ClipboardIsFormatAvailable,
+ IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_ClipboardIsFormatAvailable,
std::string /* format */,
+ Clipboard::Buffer /* buffer */,
bool /* result */)
- IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_ClipboardReadText,
+ IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_ClipboardReadText,
+ Clipboard::Buffer /* buffer */,
string16 /* result */)
- IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_ClipboardReadAsciiText,
+ IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_ClipboardReadAsciiText,
+ Clipboard::Buffer /* buffer */,
std::string /* result */)
- IPC_SYNC_MESSAGE_CONTROL0_2(ViewHostMsg_ClipboardReadHTML,
+ IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_ClipboardReadHTML,
+ Clipboard::Buffer /* buffer */,
string16 /* markup */,
GURL /* url */)
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index cd422f2..e91936e 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -354,7 +354,6 @@ void RenderView::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind)
IPC_MESSAGE_HANDLER(ViewMsg_DeterminePageText, OnDeterminePageText)
IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom)
- IPC_MESSAGE_HANDLER(ViewMsg_InsertText, OnInsertText)
IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding)
IPC_MESSAGE_HANDLER(ViewMsg_SetupDevToolsClient, OnSetupDevToolsClient)
IPC_MESSAGE_HANDLER(ViewMsg_DownloadFavIcon, OnDownloadFavIcon)
@@ -2572,13 +2571,6 @@ void RenderView::OnZoom(int function) {
}
}
-void RenderView::OnInsertText(const string16& text) {
- WebFrame* frame = webview()->GetFocusedFrame();
- if (!frame)
- return;
- frame->insertText(text);
-}
-
void RenderView::OnSetPageEncoding(const std::string& encoding_name) {
webview()->SetPageEncoding(encoding_name);
}
@@ -2625,10 +2617,6 @@ WebDevToolsAgentDelegate* RenderView::GetWebDevToolsAgentDelegate() {
return devtools_agent_.get();
}
-void RenderView::PasteFromSelectionClipboard() {
- Send(new ViewHostMsg_PasteFromSelectionClipboard(routing_id_));
-}
-
WebFrame* RenderView::GetChildFrame(const std::wstring& xpath) const {
if (xpath.empty())
return webview()->GetMainFrame();
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 34d48a9..3274d44 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -314,7 +314,6 @@ class RenderView : public RenderWidget,
virtual void DownloadUrl(const GURL& url, const GURL& referrer);
virtual void UpdateInspectorSettings(const std::wstring& raw_settings);
virtual WebDevToolsAgentDelegate* GetWebDevToolsAgentDelegate();
- virtual void PasteFromSelectionClipboard();
virtual void ReportFindInPageMatchCount(int count, int request_id,
bool final_update);
virtual void ReportFindInPageSelection(int request_id,
@@ -540,7 +539,6 @@ class RenderView : public RenderWidget,
void OnFind(int request_id, const string16&, const WebKit::WebFindOptions&);
void OnDeterminePageText();
void OnZoom(int function);
- void OnInsertText(const string16& text);
void OnSetPageEncoding(const std::string& encoding_name);
void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url);
void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks(
diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc
index c42e8a6..2597264 100644
--- a/chrome/renderer/renderer_glue.cc
+++ b/chrome/renderer/renderer_glue.cc
@@ -174,23 +174,27 @@ Clipboard* ClipboardGetClipboard(){
return NULL;
}
-bool ClipboardIsFormatAvailable(const Clipboard::FormatType& format) {
+bool ClipboardIsFormatAvailable(const Clipboard::FormatType& format,
+ Clipboard::Buffer buffer) {
bool result;
RenderThread::current()->Send(
- new ViewHostMsg_ClipboardIsFormatAvailable(format, &result));
+ new ViewHostMsg_ClipboardIsFormatAvailable(format, buffer, &result));
return result;
}
-void ClipboardReadText(string16* result) {
- RenderThread::current()->Send(new ViewHostMsg_ClipboardReadText(result));
+void ClipboardReadText(Clipboard::Buffer buffer, string16* result) {
+ RenderThread::current()->Send(new ViewHostMsg_ClipboardReadText(buffer,
+ result));
}
-void ClipboardReadAsciiText(std::string* result) {
- RenderThread::current()->Send(new ViewHostMsg_ClipboardReadAsciiText(result));
+void ClipboardReadAsciiText(Clipboard::Buffer buffer, std::string* result) {
+ RenderThread::current()->Send(new ViewHostMsg_ClipboardReadAsciiText(buffer,
+ result));
}
-void ClipboardReadHTML(string16* markup, GURL* url) {
- RenderThread::current()->Send(new ViewHostMsg_ClipboardReadHTML(markup, url));
+void ClipboardReadHTML(Clipboard::Buffer buffer, string16* markup, GURL* url) {
+ RenderThread::current()->Send(new ViewHostMsg_ClipboardReadHTML(buffer,
+ markup, url));
}
GURL GetInspectorURL() {