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 #include "base/mac/scoped_nsobject.h" | |
9 #import "base/mac/scoped_sending_event.h" | 8 #import "base/mac/scoped_sending_event.h" |
10 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
11 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
12 #include "chrome/app/chrome_command_ids.h" | 11 #include "chrome/app/chrome_command_ids.h" |
13 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 12 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
14 #include "content/public/browser/render_view_host.h" | 13 #include "content/public/browser/render_view_host.h" |
15 #include "content/public/browser/render_widget_host_view.h" | 14 #include "content/public/browser/render_widget_host_view.h" |
16 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
17 #import "ui/base/cocoa/menu_controller.h" | 16 #import "ui/base/cocoa/menu_controller.h" |
18 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 command_id); | 278 command_id); |
280 if (!item) | 279 if (!item) |
281 return; | 280 return; |
282 | 281 |
283 // Update the returned NSMenuItem directly so we can update it immediately. | 282 // Update the returned NSMenuItem directly so we can update it immediately. |
284 [item setEnabled:enabled]; | 283 [item setEnabled:enabled]; |
285 [item setTitle:SysUTF16ToNSString(title)]; | 284 [item setTitle:SysUTF16ToNSString(title)]; |
286 [item setHidden:hidden]; | 285 [item setHidden:hidden]; |
287 [[item menu] itemChanged:item]; | 286 [[item menu] itemChanged:item]; |
288 } | 287 } |
OLD | NEW |