Explicitly use Cmd+w for "Close Window" in apps. (Mac)
commit35063fc43f8403523f1a2170774c93212b61a3a0
authorjackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 10 Jan 2014 09:11:55 +0000 (10 09:11 +0000)
committerjackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 10 Jan 2014 09:11:55 +0000 (10 09:11 +0000)
tree878286e7d4bccb81858a20091829408040329a9b
parentece777aed5f1b000467b9202abd193baf146319b
Explicitly use Cmd+w for "Close Window" in apps. (Mac)

Previously, the "Close Window" item is copied from Chrome's "File" menu.
However, the key equivalent of this item changes between Cmd+Shift+w and
Cmd+w depending on whether a tabbed window has focus. This happens in
-[AppControllerMac adjustCloseWindowMenuItemKeyEquivalent:].

This causes a bug when the item in the app's menu does not match the one
in Chrome's. OSX will remove the keyboard shortcut for any items that have
a matching title but different key equivalents.

In this CL, the key equivalent is always set to Cmd+w in the app's menu. The "Close Window" item in Chrome will be changed to Cmd+w when an app
window gains focus. Duplicate items are allowed to share a key equivalent
if their titles match.

BUG=302117

Review URL: https://codereview.chromium.org/130673002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244133 0039d316-1c4b-4281-b951-d872f2087c98
chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm