| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/tab_contents/render_view_context_menu_mac.h" | 5 #include "chrome/browser/tab_contents/render_view_context_menu_mac.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #import "base/mac/scoped_sending_event.h" | 8 #import "base/mac/scoped_sending_event.h" |
| 9 #include "base/memory/scoped_nsobject.h" | 9 #include "base/memory/scoped_nsobject.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 return nil; | 43 return nil; |
| 44 } | 44 } |
| 45 | 45 |
| 46 } // namespace | 46 } // namespace |
| 47 | 47 |
| 48 // Obj-C bridge class that is the target of all items in the context menu. | 48 // Obj-C bridge class that is the target of all items in the context menu. |
| 49 // Relies on the tag being set to the command id. | 49 // Relies on the tag being set to the command id. |
| 50 | 50 |
| 51 RenderViewContextMenuMac::RenderViewContextMenuMac( | 51 RenderViewContextMenuMac::RenderViewContextMenuMac( |
| 52 WebContents* web_contents, | 52 WebContents* web_contents, |
| 53 const ContextMenuParams& params, | 53 const content::ContextMenuParams& params, |
| 54 NSView* parent_view) | 54 NSView* parent_view) |
| 55 : RenderViewContextMenu(web_contents, params), | 55 : RenderViewContextMenu(web_contents, params), |
| 56 parent_view_(parent_view) { | 56 parent_view_(parent_view) { |
| 57 } | 57 } |
| 58 | 58 |
| 59 RenderViewContextMenuMac::~RenderViewContextMenuMac() { | 59 RenderViewContextMenuMac::~RenderViewContextMenuMac() { |
| 60 } | 60 } |
| 61 | 61 |
| 62 void RenderViewContextMenuMac::PlatformInit() { | 62 void RenderViewContextMenuMac::PlatformInit() { |
| 63 InitPlatformMenu(); | 63 InitPlatformMenu(); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 command_id); | 151 command_id); |
| 152 if (!item) | 152 if (!item) |
| 153 return; | 153 return; |
| 154 | 154 |
| 155 // Update the returned NSMenuItem directly so we can update it immediately. | 155 // Update the returned NSMenuItem directly so we can update it immediately. |
| 156 [item setEnabled:enabled]; | 156 [item setEnabled:enabled]; |
| 157 [item setTitle:SysUTF16ToNSString(title)]; | 157 [item setTitle:SysUTF16ToNSString(title)]; |
| 158 [item setHidden:hidden]; | 158 [item setHidden:hidden]; |
| 159 [[item menu] itemChanged:item]; | 159 [[item menu] itemChanged:item]; |
| 160 } | 160 } |
| OLD | NEW |