| 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_frame_host.h" | 8 #include "content/public/browser/render_frame_host.h" |
| 9 #include "content/public/browser/render_process_host.h" | 9 #include "content/public/browser/render_process_host.h" |
| 10 #include "content/public/browser/render_view_host.h" | 10 #include "content/public/browser/render_view_host.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 : web_contents_(web_contents) { | 66 : web_contents_(web_contents) { |
| 67 } | 67 } |
| 68 | 68 |
| 69 ShellWebContentsViewDelegate::~ShellWebContentsViewDelegate() { | 69 ShellWebContentsViewDelegate::~ShellWebContentsViewDelegate() { |
| 70 } | 70 } |
| 71 | 71 |
| 72 void ShellWebContentsViewDelegate::ShowContextMenu( | 72 void ShellWebContentsViewDelegate::ShowContextMenu( |
| 73 RenderFrameHost* render_frame_host, | 73 RenderFrameHost* render_frame_host, |
| 74 const ContextMenuParams& params) { | 74 const ContextMenuParams& params) { |
| 75 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 75 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 76 switches::kDumpRenderTree)) | 76 switches::kRunLayoutTest)) |
| 77 return; | 77 return; |
| 78 | 78 |
| 79 params_ = params; | 79 params_ = params; |
| 80 bool has_link = !params_.unfiltered_link_url.is_empty(); | 80 bool has_link = !params_.unfiltered_link_url.is_empty(); |
| 81 bool has_selection = !params_.selection_text.empty(); | 81 bool has_selection = !params_.selection_text.empty(); |
| 82 | 82 |
| 83 HMENU menu = CreateMenu(); | 83 HMENU menu = CreateMenu(); |
| 84 HMENU sub_menu = CreatePopupMenu(); | 84 HMENU sub_menu = CreatePopupMenu(); |
| 85 AppendMenu(menu, MF_STRING | MF_POPUP, (UINT)sub_menu, L""); | 85 AppendMenu(menu, MF_STRING | MF_POPUP, (UINT)sub_menu, L""); |
| 86 | 86 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 web_contents_->Focus(); | 226 web_contents_->Focus(); |
| 227 break; | 227 break; |
| 228 case ShellContextMenuItemInspectId: { | 228 case ShellContextMenuItemInspectId: { |
| 229 ShellDevToolsFrontend::Show(web_contents_); | 229 ShellDevToolsFrontend::Show(web_contents_); |
| 230 break; | 230 break; |
| 231 } | 231 } |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace content | 235 } // namespace content |
| OLD | NEW |