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

Issue 8953037: Aura needs event translation for Mac (Closed)

Created:
9 years ago by dhollowa
Modified:
9 years ago
CC:
chromium-reviews, Paweł Hajdan Jr., yusukes+watch_chromium.org, penghuang+watch_chromium.org, James Su, brettw-cc_chromium.org
Visibility:
Public.

Description

Aura needs event translation for Mac Implments translation code from NSEvent to aura::Event. BUG=107633 TEST=EventsMacTest.* R=ben@chromium.org, thakis@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=115084

Patch Set 1 #

Total comments: 16

Patch Set 2 : Address Nico's comments #2. #

Total comments: 4

Patch Set 3 : Address Nico's comment #5. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+851 lines, -33 lines) Patch
M base/event_types.h View 1 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm View 1 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/cocoa/event_utils_unittest.mm View 1 2 chunks +33 lines, -25 lines 0 comments Download
A ui/base/cocoa/events_mac.mm View 1 chunk +182 lines, -0 lines 0 comments Download
A ui/base/cocoa/events_mac_unittest.mm View 1 1 chunk +298 lines, -0 lines 0 comments Download
M ui/base/events.h View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M ui/base/keycodes/keyboard_code_conversion_mac.h View 1 chunk +7 lines, -2 lines 0 comments Download
M ui/base/keycodes/keyboard_code_conversion_mac.mm View 2 chunks +265 lines, -0 lines 0 comments Download
M ui/base/test/cocoa_test_event_utils.h View 1 2 chunks +10 lines, -1 line 0 comments Download
M ui/base/test/cocoa_test_event_utils.mm View 1 2 chunks +38 lines, -1 line 0 comments Download
M ui/ui.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M ui/ui_unittests.gypi View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
dhollowa
9 years ago (2011-12-19 18:17:15 UTC) #1
Nico
http://codereview.chromium.org/8953037/diff/1/base/event_types.h File base/event_types.h (right): http://codereview.chromium.org/8953037/diff/1/base/event_types.h#newcode23 base/event_types.h:23: #import <AppKit/NSEvent.h> isn't "@class NSEvent;" enough? http://codereview.chromium.org/8953037/diff/1/base/event_types.h#newcode41 base/event_types.h:41: typedef ...
9 years ago (2011-12-19 20:54:48 UTC) #2
Ben Goodger (Google)
http://codereview.chromium.org/8953037/diff/1/base/event_types.h File base/event_types.h (right): http://codereview.chromium.org/8953037/diff/1/base/event_types.h#newcode41 base/event_types.h:41: typedef void* NativeEvent; On 2011/12/19 20:54:49, Nico wrote: > ...
9 years ago (2011-12-19 21:04:55 UTC) #3
dhollowa
http://codereview.chromium.org/8953037/diff/1/ui/base/cocoa/events_mac.mm File ui/base/cocoa/events_mac.mm (right): http://codereview.chromium.org/8953037/diff/1/ui/base/cocoa/events_mac.mm#newcode90 ui/base/cocoa/events_mac.mm:90: event_flags = event_flags | EF_LEFT_BUTTON_DOWN; I agree this is ...
9 years ago (2011-12-19 23:19:11 UTC) #4
Nico
LGTM. One comment nit, and one observation below. http://codereview.chromium.org/8953037/diff/1/ui/base/cocoa/events_mac.mm File ui/base/cocoa/events_mac.mm (right): http://codereview.chromium.org/8953037/diff/1/ui/base/cocoa/events_mac.mm#newcode129 ui/base/cocoa/events_mac.mm:129: bool ...
9 years ago (2011-12-19 23:30:28 UTC) #5
Ben Goodger (Google)
LGTM also, from a "integration" perspective.
9 years ago (2011-12-19 23:52:03 UTC) #6
dhollowa
9 years ago (2011-12-20 00:05:33 UTC) #7
http://codereview.chromium.org/8953037/diff/2003/ui/base/events.h
File ui/base/events.h (right):

http://codereview.chromium.org/8953037/diff/2003/ui/base/events.h#newcode84
ui/base/events.h:84: // |Point| has the origin at top-left.
On 2011/12/19 23:30:28, Nico wrote:
> top-left of what?

Done.  The "what" is platform-specific so I've provided pointers to the
pertinent code and mappings.

http://codereview.chromium.org/8953037/diff/2003/ui/base/keycodes/keyboard_co...
File ui/base/keycodes/keyboard_code_conversion_mac.mm (right):

http://codereview.chromium.org/8953037/diff/2003/ui/base/keycodes/keyboard_co...
ui/base/keycodes/keyboard_code_conversion_mac.mm:537: KeyboardCode
KeyboardCodeFromNSEvent(NSEvent* event) {
VKEY_UNKNOWN is returned for key codes >= 0x80 if the event type is not key up
or down, yes.  This is intended.

On 2011/12/19 23:30:28, Nico wrote:
> As far as I understand, this will return "undefined" for all non key codes >
> 0x127. I guess that's ok for the use case?

Powered by Google App Engine
This is Rietveld 408576698