| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |