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

Unified Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 183923030: Almost finish moving context_menu_node_ from RenderViewImpl to RenderFrameImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync to get android fix Created 6 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 | « no previous file | chrome/browser/ui/cocoa/applescript/tab_applescript.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_context_menu/render_view_context_menu.cc
===================================================================
--- chrome/browser/renderer_context_menu/render_view_context_menu.cc (revision 255719)
+++ chrome/browser/renderer_context_menu/render_view_context_menu.cc (working copy)
@@ -1445,6 +1445,8 @@
RecordUsedItem(id);
RenderViewHost* rvh = source_web_contents_->GetRenderViewHost();
+ RenderFrameHost* render_frame_host =
+ RenderFrameHost::FromID(render_process_id_, render_frame_id_);
// Process custom actions range.
if (id >= IDC_CONTENT_CONTEXT_CUSTOM_FIRST &&
@@ -1457,8 +1459,6 @@
source_web_contents_, false, std::string());
}
#endif
- RenderFrameHost* render_frame_host =
- RenderFrameHost::FromID(render_process_id_, render_frame_id_);
if (render_frame_host)
render_frame_host->ExecuteCustomContextMenuCommand(action, context);
return;
@@ -1798,15 +1798,18 @@
break;
case IDC_CONTENT_CONTEXT_CUT:
- rvh->Cut();
+ if (render_frame_host)
+ render_frame_host->Cut();
break;
case IDC_CONTENT_CONTEXT_COPY:
- rvh->Copy();
+ if (render_frame_host)
+ render_frame_host->Copy();
break;
case IDC_CONTENT_CONTEXT_PASTE:
- rvh->Paste();
+ if (render_frame_host)
+ render_frame_host->Paste();
break;
case IDC_CONTENT_CONTEXT_PASTE_AND_MATCH_STYLE:
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/applescript/tab_applescript.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698