#include "ui/views/animation/ink_drop_impl.h"
#include <utility>
#include "base/auto_reset.h"
#include "base/functional/bind.h"
#include "base/timer/timer.h"
#include "ui/compositor/layer.h"
#include "ui/views/animation/ink_drop_highlight.h"
#include "ui/views/animation/ink_drop_host.h"
#include "ui/views/animation/ink_drop_util.h"
#include "ui/views/animation/square_ink_drop_ripple.h"
#include "ui/views/style/platform_style.h"
namespace views {
namespace {
constexpr auto kHighlightFadeInOnHoverChangeDuration = …;
constexpr auto kHighlightFadeOutOnHoverChangeDuration = …;
constexpr auto kHighlightFadeInOnFocusChangeDuration = …;
constexpr auto kHighlightFadeOutOnFocusChangeDuration = …;
constexpr auto kHighlightFadeInOnRippleHidingDuration = …;
constexpr auto kHighlightFadeOutOnRippleShowingDuration = …;
constexpr auto kHighlightFadeInOnRippleShowingDuration = …;
constexpr auto kHighlightFadeOutOnRippleHidingDuration = …;
constexpr auto kHoverFadeInAfterRippleDelay = …;
bool ShouldAnimateToHidden(InkDropState ink_drop_state) { … }
}
InkDropImpl* InkDropImpl::HighlightState::GetInkDrop() { … }
class InkDropImpl::DestroyingHighlightState
: public InkDropImpl::HighlightState { … };
class InkDropImpl::NoAutoHighlightHiddenState
: public InkDropImpl::HighlightState { … };
class InkDropImpl::NoAutoHighlightVisibleState
: public InkDropImpl::HighlightState { … };
InkDropImpl::NoAutoHighlightHiddenState::NoAutoHighlightHiddenState(
HighlightStateFactory* state_factory,
base::TimeDelta animation_duration)
: … { … }
void InkDropImpl::NoAutoHighlightHiddenState::Enter() { … }
void InkDropImpl::NoAutoHighlightHiddenState::ShowOnHoverChanged() { … }
void InkDropImpl::NoAutoHighlightHiddenState::OnHoverChanged() { … }
void InkDropImpl::NoAutoHighlightHiddenState::ShowOnFocusChanged() { … }
void InkDropImpl::NoAutoHighlightHiddenState::OnFocusChanged() { … }
void InkDropImpl::NoAutoHighlightHiddenState::HandleHoverAndFocusChangeChanges(
base::TimeDelta animation_duration) { … }
void InkDropImpl::NoAutoHighlightHiddenState::AnimationStarted(
InkDropState ink_drop_state) { … }
void InkDropImpl::NoAutoHighlightHiddenState::AnimationEnded(
InkDropState ink_drop_state,
InkDropAnimationEndedReason reason) { … }
InkDropImpl::NoAutoHighlightVisibleState::NoAutoHighlightVisibleState(
HighlightStateFactory* state_factory,
base::TimeDelta animation_duration)
: … { … }
void InkDropImpl::NoAutoHighlightVisibleState::Enter() { … }
void InkDropImpl::NoAutoHighlightVisibleState::ShowOnHoverChanged() { … }
void InkDropImpl::NoAutoHighlightVisibleState::OnHoverChanged() { … }
void InkDropImpl::NoAutoHighlightVisibleState::ShowOnFocusChanged() { … }
void InkDropImpl::NoAutoHighlightVisibleState::OnFocusChanged() { … }
void InkDropImpl::NoAutoHighlightVisibleState::HandleHoverAndFocusChangeChanges(
base::TimeDelta animation_duration) { … }
void InkDropImpl::NoAutoHighlightVisibleState::AnimationStarted(
InkDropState ink_drop_state) { … }
void InkDropImpl::NoAutoHighlightVisibleState::AnimationEnded(
InkDropState ink_drop_state,
InkDropAnimationEndedReason reason) { … }
class InkDropImpl::HideHighlightOnRippleHiddenState
: public InkDropImpl::NoAutoHighlightHiddenState { … };
class InkDropImpl::HideHighlightOnRippleVisibleState
: public InkDropImpl::NoAutoHighlightVisibleState { … };
InkDropImpl::HideHighlightOnRippleHiddenState::HideHighlightOnRippleHiddenState(
HighlightStateFactory* state_factory,
base::TimeDelta animation_duration)
: … { … }
void InkDropImpl::HideHighlightOnRippleHiddenState::ShowOnHoverChanged() { … }
void InkDropImpl::HideHighlightOnRippleHiddenState::OnHoverChanged() { … }
void InkDropImpl::HideHighlightOnRippleHiddenState::ShowOnFocusChanged() { … }
void InkDropImpl::HideHighlightOnRippleHiddenState::OnFocusChanged() { … }
void InkDropImpl::HideHighlightOnRippleHiddenState::AnimationStarted(
InkDropState ink_drop_state) { … }
void InkDropImpl::HideHighlightOnRippleHiddenState::AnimationEnded(
InkDropState ink_drop_state,
InkDropAnimationEndedReason reason) { … }
void InkDropImpl::HideHighlightOnRippleHiddenState::
StartHighlightAfterRippleTimer() { … }
void InkDropImpl::HideHighlightOnRippleHiddenState::
HighlightAfterRippleTimerFired() { … }
InkDropImpl::HideHighlightOnRippleVisibleState::
HideHighlightOnRippleVisibleState(HighlightStateFactory* state_factory,
base::TimeDelta animation_duration)
: … { … }
void InkDropImpl::HideHighlightOnRippleVisibleState::AnimationStarted(
InkDropState ink_drop_state) { … }
class InkDropImpl::ShowHighlightOnRippleHiddenState
: public InkDropImpl::NoAutoHighlightHiddenState { … };
class InkDropImpl::ShowHighlightOnRippleVisibleState
: public InkDropImpl::NoAutoHighlightVisibleState { … };
InkDropImpl::ShowHighlightOnRippleHiddenState::ShowHighlightOnRippleHiddenState(
HighlightStateFactory* state_factory,
base::TimeDelta animation_duration)
: … { … }
void InkDropImpl::ShowHighlightOnRippleHiddenState::AnimationStarted(
InkDropState ink_drop_state) { … }
InkDropImpl::ShowHighlightOnRippleVisibleState::
ShowHighlightOnRippleVisibleState(HighlightStateFactory* state_factory,
base::TimeDelta animation_duration)
: … { … }
void InkDropImpl::ShowHighlightOnRippleVisibleState::ShowOnHoverChanged() { … }
void InkDropImpl::ShowHighlightOnRippleVisibleState::OnHoverChanged() { … }
void InkDropImpl::ShowHighlightOnRippleVisibleState::ShowOnFocusChanged() { … }
void InkDropImpl::ShowHighlightOnRippleVisibleState::OnFocusChanged() { … }
void InkDropImpl::ShowHighlightOnRippleVisibleState::AnimationStarted(
InkDropState ink_drop_state) { … }
InkDropImpl::HighlightStateFactory::HighlightStateFactory(
InkDropImpl::AutoHighlightMode highlight_mode,
InkDropImpl* ink_drop)
: … { … }
std::unique_ptr<InkDropImpl::HighlightState>
InkDropImpl::HighlightStateFactory::CreateStartState() { … }
std::unique_ptr<InkDropImpl::HighlightState>
InkDropImpl::HighlightStateFactory::CreateHiddenState(
base::TimeDelta animation_duration) { … }
std::unique_ptr<InkDropImpl::HighlightState>
InkDropImpl::HighlightStateFactory::CreateVisibleState(
base::TimeDelta animation_duration) { … }
InkDropImpl::InkDropImpl(InkDropHost* ink_drop_host,
const gfx::Size& host_size,
AutoHighlightMode auto_highlight_mode)
: … { … }
InkDropImpl::~InkDropImpl() { … }
void InkDropImpl::HostSizeChanged(const gfx::Size& new_size) { … }
void InkDropImpl::HostViewThemeChanged() { … }
void InkDropImpl::HostTransformChanged(const gfx::Transform& new_transform) { … }
InkDropState InkDropImpl::GetTargetInkDropState() const { … }
void InkDropImpl::AnimateToState(InkDropState ink_drop_state) { … }
void InkDropImpl::SetHoverHighlightFadeDuration(base::TimeDelta duration) { … }
void InkDropImpl::UseDefaultHoverHighlightFadeDuration() { … }
void InkDropImpl::SnapToActivated() { … }
void InkDropImpl::SnapToHidden() { … }
void InkDropImpl::SetHovered(bool is_hovered) { … }
void InkDropImpl::SetFocused(bool is_focused) { … }
bool InkDropImpl::IsHighlightFadingInOrVisible() const { … }
void InkDropImpl::SetShowHighlightOnHover(bool show_highlight_on_hover) { … }
void InkDropImpl::SetShowHighlightOnFocus(bool show_highlight_on_focus) { … }
void InkDropImpl::DestroyHiddenTargetedAnimations() { … }
void InkDropImpl::CreateInkDropRipple() { … }
void InkDropImpl::DestroyInkDropRipple() { … }
void InkDropImpl::CreateInkDropHighlight() { … }
void InkDropImpl::DestroyInkDropHighlight() { … }
void InkDropImpl::AddRootLayerToHostIfNeeded() { … }
void InkDropImpl::RemoveRootLayerFromHostIfNeeded() { … }
void InkDropImpl::AnimationStarted(InkDropState ink_drop_state) { … }
void InkDropImpl::AnimationEnded(InkDropState ink_drop_state,
InkDropAnimationEndedReason reason) { … }
void InkDropImpl::AnimationStarted(
InkDropHighlight::AnimationType animation_type) { … }
void InkDropImpl::AnimationEnded(InkDropHighlight::AnimationType animation_type,
InkDropAnimationEndedReason reason) { … }
void InkDropImpl::SetHighlight(bool should_highlight,
base::TimeDelta animation_duration) { … }
bool InkDropImpl::ShouldHighlight() const { … }
bool InkDropImpl::ShouldHighlightBasedOnFocus() const { … }
void InkDropImpl::SetHighlightState(
std::unique_ptr<HighlightState> highlight_state) { … }
void InkDropImpl::ExitHighlightState() { … }
void InkDropImpl::RecreateRippleAndHighlight() { … }
}