blob: 61c9d13db30682ec21a5661acd61b26a0d323a73 [file] [log] [blame]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <memory>
#include "ash/ash_export.h"
#include "base/macros.h"
namespace base {
class TimeDelta;
namespace ash {
class HomeScreenController;
// Helper class to schedule Home Screen view animations.
class ASH_EXPORT HomeScreenPresenter {
// The type of transition that should be applied to home screen view in
// reaction to overview session ending or starting.
enum class TransitionType {
// Resets home screen scale to 1.0 (i.e. move the view into fullscreen
// bounds).
// Changes opacity to 1.0.
// Scales home screen down by a predetermined amount from the fullscreen
// bounds (keeping the view centered in the original bounds). Changes
// opacity to 0.0.
explicit HomeScreenPresenter(HomeScreenController* controller);
// Schedules animation for the home screen when overview mode starts or ends.
void ScheduleOverviewModeAnimation(TransitionType transition, bool animate);
// Updates the home screen state to match the final state for |transition|.
// If |animation_duration| is 0, the update will be immediate, otherwise the
// update will be animated.
void SetFinalHomeTransformForTransition(TransitionType transition,
base::TimeDelta animation_duration);
HomeScreenController* controller_;
} // namespace ash