| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/cocoa/tab_contents/render_view_context_menu_mac.h" | 5 #include "chrome/browser/ui/cocoa/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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 } | 43 } |
| 44 return nil; | 44 return nil; |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 // Obj-C bridge class that is the target of all items in the context menu. | 49 // Obj-C bridge class that is the target of all items in the context menu. |
| 50 // Relies on the tag being set to the command id. | 50 // Relies on the tag being set to the command id. |
| 51 | 51 |
| 52 RenderViewContextMenuMac::RenderViewContextMenuMac( | 52 RenderViewContextMenuMac::RenderViewContextMenuMac( |
| 53 WebContents* web_contents, | 53 content::RenderFrameHost* render_frame_host, |
| 54 const content::ContextMenuParams& params, | 54 const content::ContextMenuParams& params, |
| 55 NSView* parent_view) | 55 NSView* parent_view) |
| 56 : RenderViewContextMenu(web_contents, params), | 56 : RenderViewContextMenu(render_frame_host, params), |
| 57 speech_submenu_model_(this), | 57 speech_submenu_model_(this), |
| 58 bidi_submenu_model_(this), | 58 bidi_submenu_model_(this), |
| 59 parent_view_(parent_view) { | 59 parent_view_(parent_view) { |
| 60 } | 60 } |
| 61 | 61 |
| 62 RenderViewContextMenuMac::~RenderViewContextMenuMac() { | 62 RenderViewContextMenuMac::~RenderViewContextMenuMac() { |
| 63 } | 63 } |
| 64 | 64 |
| 65 void RenderViewContextMenuMac::PlatformInit() { | 65 void RenderViewContextMenuMac::PlatformInit() { |
| 66 InitPlatformMenu(); | 66 InitPlatformMenu(); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 command_id); | 270 command_id); |
| 271 if (!item) | 271 if (!item) |
| 272 return; | 272 return; |
| 273 | 273 |
| 274 // Update the returned NSMenuItem directly so we can update it immediately. | 274 // Update the returned NSMenuItem directly so we can update it immediately. |
| 275 [item setEnabled:enabled]; | 275 [item setEnabled:enabled]; |
| 276 [item setTitle:SysUTF16ToNSString(title)]; | 276 [item setTitle:SysUTF16ToNSString(title)]; |
| 277 [item setHidden:hidden]; | 277 [item setHidden:hidden]; |
| 278 [[item menu] itemChanged:item]; | 278 [[item menu] itemChanged:item]; |
| 279 } | 279 } |
| OLD | NEW |