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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 75 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
76 switches::kRunLayoutTest)) | 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, reinterpret_cast<UINT_PTR>(sub_menu), |
| 86 L""); |
86 | 87 |
87 int index = 0; | 88 int index = 0; |
88 if (params_.media_type == WebContextMenuData::MediaTypeNone && | 89 if (params_.media_type == WebContextMenuData::MediaTypeNone && |
89 !has_link && | 90 !has_link && |
90 !has_selection && | 91 !has_selection && |
91 !params_.is_editable) { | 92 !params_.is_editable) { |
92 MakeContextMenuItem(sub_menu, | 93 MakeContextMenuItem(sub_menu, |
93 index++, | 94 index++, |
94 L"Back", | 95 L"Back", |
95 ShellContextMenuItemBackId, | 96 ShellContextMenuItemBackId, |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 web_contents_->Focus(); | 211 web_contents_->Focus(); |
211 break; | 212 break; |
212 case ShellContextMenuItemInspectId: { | 213 case ShellContextMenuItemInspectId: { |
213 ShellDevToolsFrontend::Show(web_contents_); | 214 ShellDevToolsFrontend::Show(web_contents_); |
214 break; | 215 break; |
215 } | 216 } |
216 } | 217 } |
217 } | 218 } |
218 | 219 |
219 } // namespace content | 220 } // namespace content |
OLD | NEW |