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

Side by Side Diff: content/shell/browser/shell_web_contents_view_delegate_gtk.cc

Issue 130773004: Start moving context menu code to RenderFrame. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 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 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_process_host.h" 8 #include "content/public/browser/render_process_host.h"
9 #include "content/public/browser/render_view_host.h" 9 #include "content/public/browser/render_view_host.h"
10 #include "content/public/browser/render_widget_host_view.h" 10 #include "content/public/browser/render_widget_host_view.h"
(...skipping 24 matching lines...) Expand all
35 WebContents* web_contents) 35 WebContents* web_contents)
36 : web_contents_(web_contents), 36 : web_contents_(web_contents),
37 floating_(gtk_floating_container_new()) { 37 floating_(gtk_floating_container_new()) {
38 } 38 }
39 39
40 ShellWebContentsViewDelegate::~ShellWebContentsViewDelegate() { 40 ShellWebContentsViewDelegate::~ShellWebContentsViewDelegate() {
41 floating_.Destroy(); 41 floating_.Destroy();
42 } 42 }
43 43
44 void ShellWebContentsViewDelegate::ShowContextMenu( 44 void ShellWebContentsViewDelegate::ShowContextMenu(
45 RenderFrameHost* render_frame_host,
45 const ContextMenuParams& params) { 46 const ContextMenuParams& params) {
46 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) 47 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
47 return; 48 return;
48 49
49 GtkWidget* menu = gtk_menu_new(); 50 GtkWidget* menu = gtk_menu_new();
50 51
51 params_ = params; 52 params_ = params;
52 bool has_link = !params_.unfiltered_link_url.is_empty(); 53 bool has_link = !params_.unfiltered_link_url.is_empty();
53 bool has_selection = !params_.selection_text.empty(); 54 bool has_selection = !params_.selection_text.empty();
54 55
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 233
233 void ShellWebContentsViewDelegate::OnDeleteMenuActivated(GtkWidget* widget) { 234 void ShellWebContentsViewDelegate::OnDeleteMenuActivated(GtkWidget* widget) {
234 web_contents_->GetRenderViewHost()->Delete(); 235 web_contents_->GetRenderViewHost()->Delete();
235 } 236 }
236 237
237 void ShellWebContentsViewDelegate::OnInspectMenuActivated(GtkWidget* widget) { 238 void ShellWebContentsViewDelegate::OnInspectMenuActivated(GtkWidget* widget) {
238 ShellDevToolsFrontend::Show(web_contents_); 239 ShellDevToolsFrontend::Show(web_contents_);
239 } 240 }
240 241
241 } // namespace content 242 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698