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

Issue 639893003: Unify MenuButton Pushed state logic (Closed)

Created:
6 years, 2 months ago by jonross
Modified:
6 years, 2 months ago
Reviewers:
flackr, sky
CC:
chromium-reviews, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Unify MenuButton Pushed state logic CustomButton uses ShouldEnterPushedState to determine visual state changes. This uses IsTriggerableEvent, only transitioning to pushed if an activation will occur. MenuButton has both an pushed state, showing the menu, as well as triggerable actions which do not show the menu. This change organizes the logic for activating the menu via ShouldEnterPushedState, separating it for menus from IsTriggerableEvent. TEST=MenuButtonTest.ActivateDropDownOnMouseClick, MenuButtonTest.ActivateDropDownOnGestureTap, MenuButtonTest.DraggableMenuButtonActivatesOnRelease BUG=398404 Committed: https://crrev.com/48bb4848bf961d8e1b744ac6b4d8275d425279fc Cr-Commit-Position: refs/heads/master@{#301015}

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Total comments: 6

Patch Set 4 : Add drag test #

Patch Set 5 : Drag Drop Unittest #

Total comments: 22

Patch Set 6 : Update Formatting #

Unified diffs Side-by-side diffs Delta from patch set Stats (+238 lines, -66 lines) Patch
M ui/views/controls/button/menu_button.h View 1 2 3 4 5 1 chunk +16 lines, -13 lines 0 comments Download
M ui/views/controls/button/menu_button.cc View 1 2 3 4 5 3 chunks +30 lines, -21 lines 0 comments Download
M ui/views/controls/button/menu_button_unittest.cc View 1 2 3 4 5 9 chunks +192 lines, -32 lines 0 comments Download

Messages

Total messages: 18 (3 generated)
jonross
Hey Rob, Can you take a first look at this change? Centralizing the pushed state ...
6 years, 2 months ago (2014-10-09 20:37:07 UTC) #2
flackr
Can you add to this review the change that this simplifies making? i.e. the active ...
6 years, 2 months ago (2014-10-14 14:11:06 UTC) #3
jonross
https://codereview.chromium.org/639893003/diff/1/ui/views/controls/button/menu_button.cc File ui/views/controls/button/menu_button.cc (right): https://codereview.chromium.org/639893003/diff/1/ui/views/controls/button/menu_button.cc#newcode289 ui/views/controls/button/menu_button.cc:289: GetDragOperations(mouseev.location()) == ui::DragDropTypes::DRAG_NONE) { On 2014/10/14 14:11:06, flackr wrote: ...
6 years, 2 months ago (2014-10-14 16:00:48 UTC) #4
flackr
lgtm with nit https://codereview.chromium.org/639893003/diff/60001/ui/views/controls/button/menu_button.cc File ui/views/controls/button/menu_button.cc (right): https://codereview.chromium.org/639893003/diff/60001/ui/views/controls/button/menu_button.cc#newcode174 ui/views/controls/button/menu_button.cc:174: if (state() != STATE_DISABLED && ShouldEnterPushedState(event) ...
6 years, 2 months ago (2014-10-14 19:23:09 UTC) #6
jonross
Sky could you provide an owners review for MenuButton? I have merged the activation logic ...
6 years, 2 months ago (2014-10-14 19:48:01 UTC) #7
sky
How about test coverage too? https://codereview.chromium.org/639893003/diff/80001/ui/views/controls/button/menu_button.cc File ui/views/controls/button/menu_button.cc (right): https://codereview.chromium.org/639893003/diff/80001/ui/views/controls/button/menu_button.cc#newcode277 ui/views/controls/button/menu_button.cc:277: if (state() == STATE_DISABLED) ...
6 years, 2 months ago (2014-10-14 20:05:06 UTC) #8
jonross
I've added a new test case for MenuButtons can can be dragged. MenuButtonTest.DraggableMenuButtonActivatesOnRelease I've noted ...
6 years, 2 months ago (2014-10-14 21:42:17 UTC) #9
sky
Let me know when you've resolved everything and want me to take another look. On ...
6 years, 2 months ago (2014-10-14 22:58:27 UTC) #10
jonross
I've added a test for drag and drop. Could you take another look? Thanks.
6 years, 2 months ago (2014-10-23 15:55:12 UTC) #11
sky
https://codereview.chromium.org/639893003/diff/120001/ui/views/controls/button/menu_button_unittest.cc File ui/views/controls/button/menu_button_unittest.cc (right): https://codereview.chromium.org/639893003/diff/120001/ui/views/controls/button/menu_button_unittest.cc#newcode119 ui/views/controls/button/menu_button_unittest.cc:119: : last_source_(NULL), NULL->nullptr https://codereview.chromium.org/639893003/diff/120001/ui/views/controls/button/menu_button_unittest.cc#newcode144 ui/views/controls/button/menu_button_unittest.cc:144: virtual ~TestDragController() {} no ...
6 years, 2 months ago (2014-10-23 17:25:31 UTC) #12
jonross
https://codereview.chromium.org/639893003/diff/120001/ui/views/controls/button/menu_button_unittest.cc File ui/views/controls/button/menu_button_unittest.cc (right): https://codereview.chromium.org/639893003/diff/120001/ui/views/controls/button/menu_button_unittest.cc#newcode119 ui/views/controls/button/menu_button_unittest.cc:119: : last_source_(NULL), On 2014/10/23 17:25:31, sky wrote: > NULL->nullptr ...
6 years, 2 months ago (2014-10-23 22:18:01 UTC) #13
sky
LGTM
6 years, 2 months ago (2014-10-23 23:53:05 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/639893003/140001
6 years, 2 months ago (2014-10-24 00:23:07 UTC) #16
commit-bot: I haz the power
Committed patchset #6 (id:140001)
6 years, 2 months ago (2014-10-24 01:17:12 UTC) #17
commit-bot: I haz the power
6 years, 2 months ago (2014-10-24 01:17:48 UTC) #18
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/48bb4848bf961d8e1b744ac6b4d8275d425279fc
Cr-Commit-Position: refs/heads/master@{#301015}

Powered by Google App Engine
This is Rietveld 408576698