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

Issue 152643007: mac: Create a static mapping of accelerators in the main menu. (Closed)

Created:
6 years, 10 months ago by erikchen
Modified:
6 years, 10 months ago
Reviewers:
Robert Sesek, sky, garykac
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@acc_list
Visibility:
Public.

Description

mac: Create a static mapping of accelerators in the main menu. This change allows for two new functionalities: 1. Compare a mac accelerator with an extension accelerator. 2. Determine whether an accelerator is a standard main-menu accelerator without a dynamic query of the main menu. Accelerators generated from the extension manifest use cross-platform key_codes/modifiers. Previously, there was no canonical way to get an accelerator from the mac main menu. There was a mapping of accelerators from the toolbar menu, but those accelerators only included mac key_codes/modifiers, and not cross-platform key_codes/modifiers. This CL creates a static mapping of all accelerators used in the main menu and toolbar menu. The mapping includes the command_id, the cross-platform key_code, and the Cocoa modifiers. The cross-platform modifiers and the Cocoa keyEquivalent are generated on demand. BUG=342484 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=250793

Patch Set 1 : Another self-review. #

Total comments: 55

Patch Set 2 : Draft - not ready for review. #

Patch Set 3 : Draft - not ready for review. #

Patch Set 4 : Draft - not ready for review. #

Patch Set 5 : More style fixes. #

Patch Set 6 : Minor fix: Fix compile error on mac_rel. #

Total comments: 12

Patch Set 7 : Style comments from rsesek. #

Patch Set 8 : More style. #

Patch Set 9 : Yet more capitalization of cocoa. #

Total comments: 4

Patch Set 10 : Indent error. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+317 lines, -44 lines) Patch
M chrome/browser/ui/cocoa/accelerators_cocoa.h View 1 2 3 4 5 6 7 8 9 3 chunks +18 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/accelerators_cocoa.mm View 1 2 3 4 5 6 7 2 chunks +151 lines, -29 lines 0 comments Download
A chrome/browser/ui/cocoa/accelerators_cocoa_browsertest.mm View 1 2 3 4 5 6 1 chunk +133 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M ui/base/accelerators/platform_accelerator_cocoa.h View 1 chunk +3 lines, -0 lines 0 comments Download
M ui/base/cocoa/cocoa_event_utils.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download
M ui/base/cocoa/cocoa_event_utils.mm View 1 2 3 4 5 6 1 chunk +6 lines, -1 line 0 comments Download
M ui/events/keycodes/keyboard_code_conversion_mac.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M ui/events/keycodes/keyboard_code_conversion_mac.mm View 1 chunk +0 lines, -12 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
erikchen
https://codereview.chromium.org/152643007/diff/50001/ui/events/keycodes/keyboard_code_conversion_mac.mm File ui/events/keycodes/keyboard_code_conversion_mac.mm (left): https://codereview.chromium.org/152643007/diff/50001/ui/events/keycodes/keyboard_code_conversion_mac.mm#oldcode524 ui/events/keycodes/keyboard_code_conversion_mac.mm:524: // Control characters. This code is not used in ...
6 years, 10 months ago (2014-02-11 05:09:21 UTC) #1
Robert Sesek
Mostly style stuff. Nice test coverage! https://codereview.chromium.org/152643007/diff/50001/chrome/browser/ui/cocoa/accelerators_cocoa.h File chrome/browser/ui/cocoa/accelerators_cocoa.h (right): https://codereview.chromium.org/152643007/diff/50001/chrome/browser/ui/cocoa/accelerators_cocoa.h#newcode8 chrome/browser/ui/cocoa/accelerators_cocoa.h:8: #import <Cocoa/Cocoa.h> nit: ...
6 years, 10 months ago (2014-02-11 16:19:48 UTC) #2
erikchen
Thank you for the fast response time, and thorough review! PTAL https://codereview.chromium.org/152643007/diff/50001/chrome/browser/ui/cocoa/accelerators_cocoa.h File chrome/browser/ui/cocoa/accelerators_cocoa.h (right): ...
6 years, 10 months ago (2014-02-11 19:42:26 UTC) #3
Robert Sesek
https://codereview.chromium.org/152643007/diff/50001/chrome/browser/ui/cocoa/accelerators_cocoa.mm File chrome/browser/ui/cocoa/accelerators_cocoa.mm (right): https://codereview.chromium.org/152643007/diff/50001/chrome/browser/ui/cocoa/accelerators_cocoa.mm#newcode123 chrome/browser/ui/cocoa/accelerators_cocoa.mm:123: int xpModifiers = xpModifiersFromCocoaModifiers(entry.modifiers); On 2014/02/11 19:42:27, erikchen1 wrote: ...
6 years, 10 months ago (2014-02-11 22:18:16 UTC) #4
erikchen
PTAL https://codereview.chromium.org/152643007/diff/50001/chrome/browser/ui/cocoa/accelerators_cocoa.mm File chrome/browser/ui/cocoa/accelerators_cocoa.mm (right): https://codereview.chromium.org/152643007/diff/50001/chrome/browser/ui/cocoa/accelerators_cocoa.mm#newcode123 chrome/browser/ui/cocoa/accelerators_cocoa.mm:123: int xpModifiers = xpModifiersFromCocoaModifiers(entry.modifiers); refactored completed. On 2014/02/11 ...
6 years, 10 months ago (2014-02-11 23:16:28 UTC) #5
Robert Sesek
LGTM https://codereview.chromium.org/152643007/diff/500001/chrome/browser/ui/cocoa/accelerators_cocoa.h File chrome/browser/ui/cocoa/accelerators_cocoa.h (right): https://codereview.chromium.org/152643007/diff/500001/chrome/browser/ui/cocoa/accelerators_cocoa.h#newcode44 chrome/browser/ui/cocoa/accelerators_cocoa.h:44: NSString* key_equivalent, NSUInteger modifiers) const; nit: indent 2 ...
6 years, 10 months ago (2014-02-11 23:21:24 UTC) #6
erikchen
rsesek: Can I get a lgtm on "ui/*" ? thakis is the only Cocoa owner, ...
6 years, 10 months ago (2014-02-11 23:34:07 UTC) #7
Robert Sesek
slgtm for everything, and OWNERS approval for everything that I'm capable. But I don't top-level ...
6 years, 10 months ago (2014-02-12 01:25:02 UTC) #8
erikchen
sky@, looking for a rubber stamp of "ui/base/accelerators/platform_accelerator_cocoa.h" thakis is OOO, and it's just a ...
6 years, 10 months ago (2014-02-12 01:59:35 UTC) #9
sky
ui/base/accelerators/platform_accelerator_cocoa.h LGTM
6 years, 10 months ago (2014-02-12 14:13:09 UTC) #10
garykac
LGTM for keyboard_code_conversion_mac.mm
6 years, 10 months ago (2014-02-12 18:14:59 UTC) #11
erikchen
The CQ bit was checked by erikchen@chromium.org
6 years, 10 months ago (2014-02-12 18:15:20 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikchen@chromium.org/152643007/550001
6 years, 10 months ago (2014-02-12 18:15:50 UTC) #13
commit-bot: I haz the power
6 years, 10 months ago (2014-02-12 21:18:08 UTC) #14
Message was sent while issue was closed.
Change committed as 250793

Powered by Google App Engine
This is Rietveld 408576698