Chromium Code Reviews
DescriptionAdded a 'show highlight on ripple' mode to the InkDropImpl.
Depends on WIP: https://codereview.chromium.org/2473483013/ to fix the failing test:
InkDropImplHideAutoHighlightTest.DeactivatedAnimationSkippedWhenFocused_0
Currently the InkDropImpl implements 2 highlight modes:
1. Based only off of hover/focus state.
2. Hide the ripple when a ripple is visible in addition to the hover/focus
states. This is used by the toolbar buttons, e.g. Back, Forward, etc.
This CL adds a 3rd highlight mode:
3. Show the highlight when the ripple is visible in addition to the hover/focus
states. This will be used by buttons in the system menu as well as the
bookmark row buttons.
There are 2 major problems with the existing implementation:
1. InkDropHostView's were allowed to decide when a highlight is to be shown
instead of the InkDropImpl making the decision. The main mechanism used to
implement this was via CustomButton::ShouldShowInkDropHighlight(). This is
problematic since the InkDropImpl will now request an InkDropHighlight
instance even when the host view is not hovered/focused.
2. The InkDropImpl was informed of the highlighting strategy via a property of
the InkDropRipple, namely InkDropRipple::OverridesHighlight(). This was used
as a workaround since the overrides of InkDropHostView did not have an
opportunity to configure InkDropImpl properties.
There are 3 major aspects to this change:
1. Add an overrideable InkDropHost::CreateInkDrop() method to allow subclasses
to configure the InkDropImpl instance.
2. Remove CustomButton::ShouldShowInkDropHighlight(),
InkDropHostView::ShouldShowInkDropForFocus(), and
InkDropRipple::OverridesHighlight() and replace them with
InkDropHost::CreateInkDrop() overrides that configure the InkDropImpl as
desired.
3. Refactor InkDropImpl to support the new highlight mode using a state machine.
Follow-up work:
- Remove safe guards for null return values from
InkDropHost::CreateInkDropHighlight()
- Implement a better mechanism to inject the desired type/configuration of the
ink drop to the host view.
BUG=649734
TEST=views_unittests, ash_unittests
Committed: https://crrev.com/ca8b19cd01cfb691bfa31e4605f4204dd8da8aab
Cr-Commit-Position: refs/heads/master@{#430490}
Patch Set 1 #Patch Set 2 : Fixed compiler errors. #Patch Set 3 : Deleted unnecessary includes and some commented code. #Patch Set 4 : Fixed compile errors. #
Total comments: 22
Patch Set 5 : Snapshot of test re-work before merge with master. #Patch Set 6 : Merge branch 'master' into ink_drop_highlight_mode #Patch Set 7 : Addressed review comments + added recursive SetHighlightState() guard. #Patch Set 8 : Snapshot of polish work before a merge with master. #Patch Set 9 : Merge branch 'master' into ink_drop_highlight_mode #Patch Set 10 : Snapshot of work before merge with master. #Patch Set 11 : Merge branch 'master' into ink_drop_highlight_mode #Patch Set 12 : Polish and tests #Patch Set 13 : Removed TODO's from InkDropImplHideAutoHighlightTest.DeactivatedAnimationSkippedWhenFocused. #Patch Set 14 : Merge branch 'master' into ink_drop_highlight_mode #Patch Set 15 : Merge branch 'master' into ink_drop_highlight_mode #Patch Set 16 : Fixed InkDropHostView::GetInkDrop() to use CreateInkDrop(). #Messages
Total messages: 57 (43 generated)
|