Index: content/shell/browser/shell_web_contents_view_delegate_win.cc |
=================================================================== |
--- content/shell/browser/shell_web_contents_view_delegate_win.cc (revision 255719) |
+++ content/shell/browser/shell_web_contents_view_delegate_win.cc (working copy) |
@@ -5,6 +5,7 @@ |
#include "content/shell/browser/shell_web_contents_view_delegate.h" |
#include "base/command_line.h" |
+#include "content/public/browser/render_frame_host.h" |
#include "content/public/browser/render_process_host.h" |
#include "content/public/browser/render_view_host.h" |
#include "content/public/browser/render_widget_host_view.h" |
@@ -190,15 +191,19 @@ |
} |
void ShellWebContentsViewDelegate::MenuItemSelected(int selection) { |
+ RenderFrameHost* frame = web_contents_->GetFocusedFrame(); |
switch (selection) { |
case ShellContextMenuItemCutId: |
- web_contents_->GetRenderViewHost()->Cut(); |
+ if (frame) |
+ frame->Cut(); |
break; |
case ShellContextMenuItemCopyId: |
- web_contents_->GetRenderViewHost()->Copy(); |
+ if (frame) |
+ frame->Copy(); |
break; |
case ShellContextMenuItemPasteId: |
- web_contents_->GetRenderViewHost()->Paste(); |
+ if (frame) |
+ frame->Paste(); |
break; |
case ShellContextMenuItemDeleteId: |
web_contents_->GetRenderViewHost()->Delete(); |