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

Side by Side Diff: content/shell/browser/shell_web_contents_view_delegate_gtk.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/browser/shell_web_contents_view_delegate.h" 5 #include "content/shell/browser/shell_web_contents_view_delegate.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/public/browser/render_frame_host.h"
8 #include "content/public/browser/render_process_host.h" 9 #include "content/public/browser/render_process_host.h"
9 #include "content/public/browser/render_view_host.h" 10 #include "content/public/browser/render_view_host.h"
10 #include "content/public/browser/render_widget_host_view.h" 11 #include "content/public/browser/render_widget_host_view.h"
11 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
12 #include "content/public/browser/web_contents_view.h" 13 #include "content/public/browser/web_contents_view.h"
13 #include "content/public/common/context_menu_params.h" 14 #include "content/public/common/context_menu_params.h"
14 #include "content/shell/browser/shell.h" 15 #include "content/shell/browser/shell.h"
15 #include "content/shell/browser/shell_browser_context.h" 16 #include "content/shell/browser/shell_browser_context.h"
16 #include "content/shell/browser/shell_browser_main_parts.h" 17 #include "content/shell/browser/shell_browser_main_parts.h"
17 #include "content/shell/browser/shell_content_browser_client.h" 18 #include "content/shell/browser/shell_content_browser_client.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 ShellBrowserContext* browser_context = 214 ShellBrowserContext* browser_context =
214 ShellContentBrowserClient::Get()->browser_context(); 215 ShellContentBrowserClient::Get()->browser_context();
215 Shell::CreateNewWindow(browser_context, 216 Shell::CreateNewWindow(browser_context,
216 params_.link_url, 217 params_.link_url,
217 NULL, 218 NULL,
218 MSG_ROUTING_NONE, 219 MSG_ROUTING_NONE,
219 gfx::Size()); 220 gfx::Size());
220 } 221 }
221 222
222 void ShellWebContentsViewDelegate::OnCutMenuActivated(GtkWidget* widget) { 223 void ShellWebContentsViewDelegate::OnCutMenuActivated(GtkWidget* widget) {
223 web_contents_->GetRenderViewHost()->Cut(); 224 RenderFrameHost* frame = web_contents_->GetFocusedFrame();
225 if (frame)
226 frame->Cut();
224 } 227 }
225 228
226 void ShellWebContentsViewDelegate::OnCopyMenuActivated(GtkWidget* widget) { 229 void ShellWebContentsViewDelegate::OnCopyMenuActivated(GtkWidget* widget) {
227 web_contents_->GetRenderViewHost()->Copy(); 230 RenderFrameHost* frame = web_contents_->GetFocusedFrame();
231 if (frame)
232 frame->Copy();
228 } 233 }
229 234
230 void ShellWebContentsViewDelegate::OnPasteMenuActivated(GtkWidget* widget) { 235 void ShellWebContentsViewDelegate::OnPasteMenuActivated(GtkWidget* widget) {
231 web_contents_->GetRenderViewHost()->Paste(); 236 RenderFrameHost* frame = web_contents_->GetFocusedFrame();
237 if (frame)
238 frame->Paste();
232 } 239 }
233 240
234 void ShellWebContentsViewDelegate::OnDeleteMenuActivated(GtkWidget* widget) { 241 void ShellWebContentsViewDelegate::OnDeleteMenuActivated(GtkWidget* widget) {
235 web_contents_->GetRenderViewHost()->Delete(); 242 web_contents_->GetRenderViewHost()->Delete();
236 } 243 }
237 244
238 void ShellWebContentsViewDelegate::OnInspectMenuActivated(GtkWidget* widget) { 245 void ShellWebContentsViewDelegate::OnInspectMenuActivated(GtkWidget* widget) {
239 ShellDevToolsFrontend::Show(web_contents_); 246 ShellDevToolsFrontend::Show(web_contents_);
240 } 247 }
241 248
242 } // namespace content 249 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | content/shell/browser/shell_web_contents_view_delegate_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698