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

Unified Diff: chrome/browser/renderer_host/render_view_host.cc

Issue 6480106: Add IPCs to check web copy/cut/paste for extensions with the appropriate permission bit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: Prefix new methods with 'web'. Created 9 years, 10 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
Index: chrome/browser/renderer_host/render_view_host.cc
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index e3cc83e68e0c91f86045091f4b1edda2043e33fa..08e1b8a361801f4d516c89441c8fa5aee44b743f 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -774,6 +774,8 @@ bool RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
OnMsgRunBeforeUnloadConfirm)
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_ShowModalHTMLDialog,
OnMsgShowModalHTMLDialog)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_IsWebCopyCutEnabled, OnIsWebCopyCutEnabled)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_IsWebPasteEnabled, OnIsWebPasteEnabled)
IPC_MESSAGE_HANDLER(ViewHostMsg_StartDragging, OnMsgStartDragging)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateDragCursor, OnUpdateDragCursor)
IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
@@ -1263,6 +1265,22 @@ void RenderViewHost::PrintNodeUnderContextMenu() {
Send(new ViewMsg_PrintNodeUnderContextMenu(routing_id()));
}
+void RenderViewHost::OnIsWebCopyCutEnabled(bool* enabled) {
+ RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
+ if (view)
+ *enabled = view->IsWebCopyCutEnabled();
+ else
+ *enabled = false;
+}
+
+void RenderViewHost::OnIsWebPasteEnabled(bool* enabled) {
+ RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
+ if (view)
+ *enabled = view->IsWebPasteEnabled();
+ else
+ *enabled = false;
+}
+
void RenderViewHost::OnMsgStartDragging(
const WebDropData& drop_data,
WebDragOperationsMask drag_operations_mask,

Powered by Google App Engine
This is Rietveld 408576698