diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-03 18:53:04 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-03 18:53:04 +0000 |
commit | 165cade916e74dc8a4ed9666fe1447885e1f2a2d (patch) | |
tree | 6833121931dc561bb22759e904a74a2e23de23ff /chrome/browser | |
parent | e61e4e1555e695840579e7d6c7787f4ce288d57b (diff) | |
download | chromium_src-165cade916e74dc8a4ed9666fe1447885e1f2a2d.zip chromium_src-165cade916e74dc8a4ed9666fe1447885e1f2a2d.tar.gz chromium_src-165cade916e74dc8a4ed9666fe1447885e1f2a2d.tar.bz2 |
Mac: fix Text Encoding menu/submenu
(1) Clicking on the Text Encoding menu item should display the submenu, not try to execute a nonexistent command.
(2) The Text Encoding menu item shouldn't be disabled, but instead the submenu's contents (so that the submenu is always visible). See Apple's HIG:
<http://developer.apple.com/mac/library/DOCUMENTATION/UserExperience/Conceptual/AppleHIGuidelines/XHIGMenus/XHIGMenus.html#//apple_ref/doc/uid/TP30000356-TPXREF122>.
Changes to MainMenu.xib: disconnected |-commandDispatch:| from the Text Encoding menu item.
BUG=25957,26593
TEST=Check that the Text Encoding submenu is always available, with its contents disabled on the NTP (for example) and enabled (and working) on a normal web page. Check that clicking (and releasing) on the Text Encoding menu item itself shows the submenu.
Review URL: http://codereview.chromium.org/345050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30836 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/cocoa/browser_window_controller.mm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm index 3c8df3b..42d35dd 100644 --- a/chrome/browser/cocoa/browser_window_controller.mm +++ b/chrome/browser/cocoa/browser_window_controller.mm @@ -579,6 +579,15 @@ willPositionSheet:(NSWindow*)sheet case IDC_FULLSCREEN: enable &= [self supportsFullscreen]; break; + default: + // Special handling for the contents of the Text Encoding submenu. On + // Mac OS, instead of enabling/disabling the top-level menu item, we + // enable/disable the submenu's contents (per Apple's HIG). + EncodingMenuController encoding_controller; + if (encoding_controller.DoesCommandBelongToEncodingMenu(tag)) { + enable &= browser_->command_updater()->IsCommandEnabled( + IDC_ENCODING_MENU) ? YES : NO; + } } // If the item is toggleable, find its toggle state and |