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 20 matching lines...) Expand all Loading... |
31 ShellContextMenuItemDeleteId, | 31 ShellContextMenuItemDeleteId, |
32 ShellContextMenuItemOpenLinkId, | 32 ShellContextMenuItemOpenLinkId, |
33 ShellContextMenuItemBackId, | 33 ShellContextMenuItemBackId, |
34 ShellContextMenuItemForwardId, | 34 ShellContextMenuItemForwardId, |
35 ShellContextMenuItemReloadId, | 35 ShellContextMenuItemReloadId, |
36 ShellContextMenuItemInspectId | 36 ShellContextMenuItemInspectId |
37 }; | 37 }; |
38 | 38 |
39 void MakeContextMenuItem(HMENU menu, | 39 void MakeContextMenuItem(HMENU menu, |
40 int menu_index, | 40 int menu_index, |
41 LPTSTR text, | 41 LPCTSTR text, |
42 UINT id, | 42 UINT id, |
43 bool enabled) { | 43 bool enabled) { |
44 MENUITEMINFO mii = {0}; | 44 MENUITEMINFO mii = {0}; |
45 mii.cbSize = sizeof(mii); | 45 mii.cbSize = sizeof(mii); |
46 mii.fMask = MIIM_FTYPE | MIIM_ID | MIIM_DATA | MIIM_STRING | MIIM_STATE; | 46 mii.fMask = MIIM_FTYPE | MIIM_ID | MIIM_DATA | MIIM_STRING | MIIM_STATE; |
47 mii.fState = enabled ? MFS_ENABLED : (MF_DISABLED | MFS_GRAYED); | 47 mii.fState = enabled ? MFS_ENABLED : (MF_DISABLED | MFS_GRAYED); |
48 mii.fType = MFT_STRING; | 48 mii.fType = MFT_STRING; |
49 mii.wID = id; | 49 mii.wID = id; |
50 mii.dwTypeData = text; | 50 mii.dwTypeData = const_cast<LPTSTR>(text); |
51 | 51 |
52 InsertMenuItem(menu, menu_index, TRUE, &mii); | 52 InsertMenuItem(menu, menu_index, TRUE, &mii); |
53 } | 53 } |
54 | 54 |
55 } // namespace | 55 } // namespace |
56 | 56 |
57 namespace content { | 57 namespace content { |
58 | 58 |
59 WebContentsViewDelegate* CreateShellWebContentsViewDelegate( | 59 WebContentsViewDelegate* CreateShellWebContentsViewDelegate( |
60 WebContents* web_contents) { | 60 WebContents* web_contents) { |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 return false; | 246 return false; |
247 } | 247 } |
248 | 248 |
249 void ShellWebContentsViewDelegate::TakeFocus(bool reverse) { | 249 void ShellWebContentsViewDelegate::TakeFocus(bool reverse) { |
250 } | 250 } |
251 | 251 |
252 void ShellWebContentsViewDelegate::SizeChanged(const gfx::Size& size) { | 252 void ShellWebContentsViewDelegate::SizeChanged(const gfx::Size& size) { |
253 } | 253 } |
254 | 254 |
255 } // namespace content | 255 } // namespace content |
OLD | NEW |