Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: chrome/browser/tab_contents/render_view_context_menu_mac.mm

Issue 8370033: Add a 'hidden' parameter to RenderViewContextMenuProxy::UpdateMenuItem(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "base/memory/scoped_nsobject.h" 8 #include "base/memory/scoped_nsobject.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // See the documentation on [NSPasteboard declareTypes]. 136 // See the documentation on [NSPasteboard declareTypes].
137 NSArray* toDeclare = [NSArray arrayWithObject:NSStringPboardType]; 137 NSArray* toDeclare = [NSArray arrayWithObject:NSStringPboardType];
138 [pboard declareTypes:toDeclare owner:nil]; 138 [pboard declareTypes:toDeclare owner:nil];
139 BOOL ok = [pboard setString:text forType:NSStringPboardType]; 139 BOOL ok = [pboard setString:text forType:NSStringPboardType];
140 if (ok) 140 if (ok)
141 NSPerformService(@"Look Up in Dictionary", pboard); 141 NSPerformService(@"Look Up in Dictionary", pboard);
142 } 142 }
143 143
144 void RenderViewContextMenuMac::UpdateMenuItem(int command_id, 144 void RenderViewContextMenuMac::UpdateMenuItem(int command_id,
145 bool enabled, 145 bool enabled,
146 bool hidden,
146 const string16& title) { 147 const string16& title) {
147 NSMenuItem* item = GetMenuItemByID(&menu_model_, [menuController_ menu], 148 NSMenuItem* item = GetMenuItemByID(&menu_model_, [menuController_ menu],
148 command_id); 149 command_id);
149 if (!item) 150 if (!item)
150 return; 151 return;
151 152
152 // Update the returned NSMenuItem directly so we can update it immediately. 153 // Update the returned NSMenuItem directly so we can update it immediately.
153 [item setEnabled:enabled]; 154 [item setEnabled:enabled];
154 [item setTitle:SysUTF16ToNSString(title)]; 155 [item setTitle:SysUTF16ToNSString(title)];
156 [item setHidden:hidden];
155 [[item menu] itemChanged:item]; 157 [[item menu] itemChanged:item];
156 } 158 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu_mac.h ('k') | chrome/browser/tab_contents/spelling_menu_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698