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

Side by Side Diff: ui/views/animation/ink_drop_impl.cc

Issue 2001843002: Use ink drop hover for focus states on toolbar buttons and location (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/animation/ink_drop_impl.h ('k') | ui/views/animation/test/test_ink_drop_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/animation/ink_drop_impl.h" 5 #include "ui/views/animation/ink_drop_impl.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/timer/timer.h" 8 #include "base/timer/timer.h"
9 #include "ui/compositor/layer.h" 9 #include "ui/compositor/layer.h"
10 #include "ui/views/animation/ink_drop_host.h" 10 #include "ui/views/animation/ink_drop_host.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 void InkDropImpl::SetHovered(bool is_hovered) { 103 void InkDropImpl::SetHovered(bool is_hovered) {
104 is_hovered_ = is_hovered; 104 is_hovered_ = is_hovered;
105 SetHoveredInternal(is_hovered, 105 SetHoveredInternal(is_hovered,
106 is_hovered ? base::TimeDelta::FromMilliseconds( 106 is_hovered ? base::TimeDelta::FromMilliseconds(
107 kHoverFadeInFromUserInputDurationInMs) 107 kHoverFadeInFromUserInputDurationInMs)
108 : base::TimeDelta::FromMilliseconds( 108 : base::TimeDelta::FromMilliseconds(
109 kHoverFadeOutFromUserInputDurationInMs), 109 kHoverFadeOutFromUserInputDurationInMs),
110 false); 110 false);
111 } 111 }
112 112
113 void InkDropImpl::SnapToHovered(bool is_hovered) {
Evan Stade 2016/05/24 18:47:18 I specifically avoided turning |is_hovered_| into
114 is_hovered_ = is_hovered;
115 SetHoveredInternal(is_hovered, base::TimeDelta(), false);
116 }
117
113 void InkDropImpl::DestroyHiddenTargetedAnimations() { 118 void InkDropImpl::DestroyHiddenTargetedAnimations() {
114 if (ink_drop_ripple_ && 119 if (ink_drop_ripple_ &&
115 (ink_drop_ripple_->target_ink_drop_state() == InkDropState::HIDDEN || 120 (ink_drop_ripple_->target_ink_drop_state() == InkDropState::HIDDEN ||
116 ShouldAnimateToHidden(ink_drop_ripple_->target_ink_drop_state()))) { 121 ShouldAnimateToHidden(ink_drop_ripple_->target_ink_drop_state()))) {
117 DestroyInkDropRipple(); 122 DestroyInkDropRipple();
118 } 123 }
119 } 124 }
120 125
121 void InkDropImpl::CreateInkDropRipple() { 126 void InkDropImpl::CreateInkDropRipple() {
122 DestroyInkDropRipple(); 127 DestroyInkDropRipple();
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 } 249 }
245 250
246 void InkDropImpl::HoverAfterRippleTimerFired() { 251 void InkDropImpl::HoverAfterRippleTimerFired() {
247 SetHoveredInternal(true, base::TimeDelta::FromMilliseconds( 252 SetHoveredInternal(true, base::TimeDelta::FromMilliseconds(
248 kHoverFadeInAfterRippleDurationInMs), 253 kHoverFadeInAfterRippleDurationInMs),
249 true); 254 true);
250 hover_after_ripple_timer_.reset(); 255 hover_after_ripple_timer_.reset();
251 } 256 }
252 257
253 } // namespace views 258 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/ink_drop_impl.h ('k') | ui/views/animation/test/test_ink_drop_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698