chromium/ui/views/layout/animating_layout_manager.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/views/layout/animating_layout_manager.h"

#include <algorithm>
#include <map>
#include <set>
#include <utility>
#include <vector>

#include "base/auto_reset.h"
#include "base/containers/contains.h"
#include "base/memory/raw_ptr.h"
#include "base/numerics/safe_conversions.h"
#include "base/observer_list.h"
#include "base/ranges/algorithm.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "ui/compositor/layer.h"
#include "ui/gfx/animation/animation.h"
#include "ui/gfx/animation/animation_container.h"
#include "ui/gfx/animation/multi_animation.h"
#include "ui/gfx/animation/slide_animation.h"
#include "ui/views/animation/animation_delegate_views.h"
#include "ui/views/layout/normalized_geometry.h"
#include "ui/views/layout/proposed_layout.h"
#include "ui/views/view.h"
#include "ui/views/view_class_properties.h"

namespace views {

namespace {

// Returns the ChildLayout data for the child view in the proposed layout, or
// nullptr if not found.
const ChildLayout* FindChildViewInLayout(const ProposedLayout& layout,
                                         const View* view) {}

ChildLayout* FindChildViewInLayout(ProposedLayout* layout, const View* view) {}

// Describes the type of fade, used by LayoutFadeInfo (see below).
enum class LayoutFadeType {};

// Makes a copy of the given layout with only visible child views (non-visible
// children are omitted).
ProposedLayout WithOnlyVisibleViews(const ProposedLayout layout) {}

// Returns true if the two proposed layouts have the same visible views, with
// the same parameters, in the same order.
bool HaveSameVisibleViews(const ProposedLayout& l1, const ProposedLayout& l2) {}

}  // namespace

// Holds data about a view that is fading in or out as part of an animation.
struct AnimatingLayoutManager::LayoutFadeInfo {};

// Manages the animation and various callbacks from the animation system that
// are required to update the layout during animations.
class AnimatingLayoutManager::AnimationDelegate
    : public AnimationDelegateViews {};

AnimatingLayoutManager::AnimationDelegate::AnimationDelegate(
    AnimatingLayoutManager* layout_manager)
    :{}

void AnimatingLayoutManager::AnimationDelegate::UpdateAnimationParameters() {}

void AnimatingLayoutManager::AnimationDelegate::Animate() {}

void AnimatingLayoutManager::AnimationDelegate::Reset() {}

void AnimatingLayoutManager::AnimationDelegate::MakeReadyForAnimation() {}

void AnimatingLayoutManager::AnimationDelegate::AnimationProgressed(
    const gfx::Animation* animation) {}

void AnimatingLayoutManager::AnimationDelegate::AnimationCanceled(
    const gfx::Animation* animation) {}

void AnimatingLayoutManager::AnimationDelegate::AnimationEnded(
    const gfx::Animation* animation) {}

// AnimatingLayoutManager:

AnimatingLayoutManager::AnimatingLayoutManager() = default;
AnimatingLayoutManager::~AnimatingLayoutManager() = default;

AnimatingLayoutManager& AnimatingLayoutManager::SetBoundsAnimationMode(
    BoundsAnimationMode bounds_animation_mode) {}

AnimatingLayoutManager& AnimatingLayoutManager::SetAnimationDuration(
    base::TimeDelta animation_duration) {}

AnimatingLayoutManager& AnimatingLayoutManager::SetTweenType(
    gfx::Tween::Type tween_type) {}

AnimatingLayoutManager& AnimatingLayoutManager::SetOpacityAnimationDuration(
    base::TimeDelta animation_duration) {}

AnimatingLayoutManager& AnimatingLayoutManager::SetOpacityTweenType(
    gfx::Tween::Type tween_type) {}

AnimatingLayoutManager& AnimatingLayoutManager::SetOrientation(
    LayoutOrientation orientation) {}

AnimatingLayoutManager& AnimatingLayoutManager::SetDefaultFadeMode(
    FadeInOutMode default_fade_mode) {}

void AnimatingLayoutManager::ResetLayout() {}

void AnimatingLayoutManager::FadeOut(View* child_view) {}

void AnimatingLayoutManager::FadeIn(View* child_view) {}

void AnimatingLayoutManager::AddObserver(Observer* observer) {}

void AnimatingLayoutManager::RemoveObserver(Observer* observer) {}

bool AnimatingLayoutManager::HasObserver(Observer* observer) const {}

gfx::Size AnimatingLayoutManager::GetPreferredSize(const View* host) const {}

gfx::Size AnimatingLayoutManager::GetPreferredSize(
    const View* host,
    const SizeBounds& available_size) const {}

gfx::Size AnimatingLayoutManager::GetMinimumSize(const View* host) const {}

int AnimatingLayoutManager::GetPreferredHeightForWidth(const View* host,
                                                       int width) const {}

std::vector<raw_ptr<View, VectorExperimental>>
AnimatingLayoutManager::GetChildViewsInPaintOrder(const View* host) const {}

bool AnimatingLayoutManager::OnViewRemoved(View* host, View* view) {}

void AnimatingLayoutManager::PostOrQueueAction(base::OnceClosure action) {}

FlexRule AnimatingLayoutManager::GetDefaultFlexRule() const {}

gfx::AnimationContainer*
AnimatingLayoutManager::GetAnimationContainerForTesting() {}

void AnimatingLayoutManager::EnableAnimationForTesting() {}

ProposedLayout AnimatingLayoutManager::CalculateProposedLayout(
    const SizeBounds& size_bounds) const {}

void AnimatingLayoutManager::OnInstalled(View* host) {}

bool AnimatingLayoutManager::OnViewAdded(View* host, View* view) {}

void AnimatingLayoutManager::OnLayoutChanged() {}

void AnimatingLayoutManager::LayoutImpl() {}

void AnimatingLayoutManager::EndAnimation() {}

void AnimatingLayoutManager::ResetLayoutToTargetSize() {}

void AnimatingLayoutManager::ResetLayoutToSize(const gfx::Size& target_size) {}

bool AnimatingLayoutManager::RecalculateTarget() {}

void AnimatingLayoutManager::AnimateTo(double value,
                                       double fade_in_opacity,
                                       double fade_out_opacity) {}

void AnimatingLayoutManager::NotifyIsAnimatingChanged() {}

void AnimatingLayoutManager::RunQueuedActions() {}

void AnimatingLayoutManager::PostQueuedActions() {}

void AnimatingLayoutManager::UpdateCurrentLayout(double percent,
                                                 double fade_in_opacity,
                                                 double fade_out_opacity) {}

void AnimatingLayoutManager::CalculateFadeInfos() {}

void AnimatingLayoutManager::ResolveFades() {}

ChildLayout AnimatingLayoutManager::CalculateScaleFade(
    const LayoutFadeInfo& fade_info,
    double scale_percent,
    bool scale_from_zero) const {}

ChildLayout AnimatingLayoutManager::CalculateSlideFade(
    const LayoutFadeInfo& fade_info,
    double scale_percent,
    bool slide_from_leading) const {}

ChildLayout AnimatingLayoutManager::CalculateFadeAndSlideFade(
    const LayoutFadeInfo& fade_info,
    double scale_percent,
    double opacity_value,
    bool slide_from_leading) const {}

// Returns the space in which to calculate the target layout.
gfx::Size AnimatingLayoutManager::GetAvailableTargetLayoutSize() {}

// static
gfx::Size AnimatingLayoutManager::DefaultFlexRuleImpl(
    const AnimatingLayoutManager* animating_layout,
    const View* view,
    const SizeBounds& size_bounds) {}

}  // namespace views