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, (UINT_PTR)sub_menu, L""); |
Will Harris
2015/11/10 18:05:14
nit: do not use C-style cast here.
brucedawson
2015/11/10 18:43:26
I thought I could get grandfathered in :-)
| |
86 | 86 |
87 int index = 0; | 87 int index = 0; |
88 if (params_.media_type == WebContextMenuData::MediaTypeNone && | 88 if (params_.media_type == WebContextMenuData::MediaTypeNone && |
89 !has_link && | 89 !has_link && |
90 !has_selection && | 90 !has_selection && |
91 !params_.is_editable) { | 91 !params_.is_editable) { |
92 MakeContextMenuItem(sub_menu, | 92 MakeContextMenuItem(sub_menu, |
93 index++, | 93 index++, |
94 L"Back", | 94 L"Back", |
95 ShellContextMenuItemBackId, | 95 ShellContextMenuItemBackId, |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 web_contents_->Focus(); | 210 web_contents_->Focus(); |
211 break; | 211 break; |
212 case ShellContextMenuItemInspectId: { | 212 case ShellContextMenuItemInspectId: { |
213 ShellDevToolsFrontend::Show(web_contents_); | 213 ShellDevToolsFrontend::Show(web_contents_); |
214 break; | 214 break; |
215 } | 215 } |
216 } | 216 } |
217 } | 217 } |
218 | 218 |
219 } // namespace content | 219 } // namespace content |
OLD | NEW |