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

Issue 2033433006: MacViews: Modify insertText handlers to correctly handle space key and simplify menu event dispatch. (Closed)

Created:
4 years, 6 months ago by karandeepb
Modified:
4 years, 6 months ago
Reviewers:
tapted, sky
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, tdresser+watch_chromium.org, tfarina, extensions-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MacViews: Modify insertText handlers to correctly handle space key and simplify menu event dispatch. Currently, Space key events are not being passed down the view hierarchy, since no ui::KeyEvent is being generated for them. This CL modifies insertText: to generate a synthetic ui::KeyEvent for character events. This allows us to correctly handle the space (and possibly other) keys. Since we no longer call insertText:replacementRange: from insertText:, crbug.com/617110 is also fixed. Also, this CL removes all menu event handling from insertText:replacementRange: since it is only invoked in case of a valid inputContext. Also, this CL adds keyUp: to BridgedContentView, so that key-up events are passed to the Views hierarchy. Also checked that this causes no views_unittests regressions and that enabled interactive_ui_tests in: -menu_controller_interactive_uitest.cc -menu_item_view_interactive_uitest.cc -menu_model_adapter_test.cc -menu_view_drag_and_drop_test.cc still work correctly. BUG=607429, 617110 Committed: https://crrev.com/5c38e137d2b39cc17c828ddfb783e1842e7dd76f Cr-Commit-Position: refs/heads/master@{#400918}

Patch Set 1 #

Total comments: 3

Patch Set 2 : #

Total comments: 15

Patch Set 3 : Address review comments. #

Patch Set 4 : Migrate key event logic from MenuKeyEventHandler to MenuController. #

Patch Set 5 : Rebase #

Patch Set 6 : Split changes in ui_controls_mac.mm #

Patch Set 7 : Changes to comments. #

Total comments: 4

Patch Set 8 : Address review comments. #

Total comments: 2

Patch Set 9 : Fix trybot failures. Format code. #

Patch Set 10 : Rebase and Remove patchset dependency #

Patch Set 11 : Fix failing interactive_ui_tests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+122 lines, -125 lines) Patch
M ui/views/cocoa/bridged_content_view.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/cocoa/bridged_content_view.mm View 1 2 3 4 5 6 7 8 9 10 9 chunks +56 lines, -54 lines 0 comments Download
M ui/views/controls/button/custom_button_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +22 lines, -0 lines 0 comments Download
M ui/views/controls/menu/menu_controller.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -4 lines 0 comments Download
M ui/views/controls/menu/menu_controller.cc View 1 2 3 4 5 6 7 8 9 1 chunk +40 lines, -13 lines 0 comments Download
M ui/views/controls/menu/menu_key_event_handler.cc View 1 2 3 2 chunks +1 line, -52 lines 0 comments Download

Messages

Total messages: 37 (22 generated)
karandeepb
PTAL Trent. Will add tests subsequently, if you think the approach is correct. https://codereview.chromium.org/2033433006/diff/80001/ui/views/cocoa/bridged_content_view.mm File ...
4 years, 6 months ago (2016-06-06 02:04:42 UTC) #8
tapted
This approach looks pretty good, but we should do the ui_controls_mac change first. https://codereview.chromium.org/2033433006/diff/80001/ui/views/cocoa/bridged_content_view.mm File ...
4 years, 6 months ago (2016-06-06 04:44:05 UTC) #11
karandeepb
PTAL Trent. Thanks. https://codereview.chromium.org/2033433006/diff/100001/ui/base/test/ui_controls_mac.mm File ui/base/test/ui_controls_mac.mm (left): https://codereview.chromium.org/2033433006/diff/100001/ui/base/test/ui_controls_mac.mm#oldcode19 ui/base/test/ui_controls_mac.mm:19: // immediately. This lets us run ...
4 years, 6 months ago (2016-06-06 11:21:10 UTC) #14
tapted
Hm - if this is fixing http://crbug.com/607429 I think we need a regression test for ...
4 years, 6 months ago (2016-06-07 01:23:29 UTC) #15
karandeepb
PTAL Trent. Have added a test which fails on the current master for MacViews. http://crbug.com/607429 ...
4 years, 6 months ago (2016-06-07 04:13:46 UTC) #16
tapted
looks like aura platforms aren't happy with the test, looks good otherwise :) https://codereview.chromium.org/2033433006/diff/230001/ui/views/controls/button/custom_button_unittest.cc File ...
4 years, 6 months ago (2016-06-07 04:59:35 UTC) #17
karandeepb
PTAL Trent. Didn't investigate much but ui::EventGenerator doesn't seem to work for key events on ...
4 years, 6 months ago (2016-06-07 08:39:29 UTC) #22
tapted
lgtm, although I'm assuming there will be views_unittests regressions without https://codereview.chromium.org/2035393002, so let's wait for ...
4 years, 6 months ago (2016-06-07 09:05:41 UTC) #23
karandeepb
PTAL sky@ for ui/views/controls review.
4 years, 6 months ago (2016-06-07 15:43:45 UTC) #25
sky
LGTM
4 years, 6 months ago (2016-06-07 17:39:17 UTC) #26
karandeepb
PTAL Trent. I have removed the dependency on the patchset https://codereview.chromium.org/2035393002#ps1 and added a workaround ...
4 years, 6 months ago (2016-06-21 07:31:31 UTC) #29
tapted
On 2016/06/21 07:31:31, karandeepb wrote: > PTAL Trent. I have removed the dependency on the ...
4 years, 6 months ago (2016-06-21 07:46:46 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2033433006/390001
4 years, 6 months ago (2016-06-21 07:48:53 UTC) #33
commit-bot: I haz the power
Committed patchset #11 (id:390001)
4 years, 6 months ago (2016-06-21 07:52:56 UTC) #35
commit-bot: I haz the power
4 years, 6 months ago (2016-06-21 07:56:03 UTC) #37
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/5c38e137d2b39cc17c828ddfb783e1842e7dd76f
Cr-Commit-Position: refs/heads/master@{#400918}

Powered by Google App Engine
This is Rietveld 408576698