blob: f5b25d69298505c1d7d3d14e4ecb3631b1cb791d [file] [log] [blame]
// Copyright 2015 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 <stdint.h>
#include "ash/ash_export.h"
#include "base/macros.h"
#include "ui/display/display.h"
namespace ash {
// Utility to perform a screen rotation with an animation.
class ASH_EXPORT ScreenRotationAnimator {
explicit ScreenRotationAnimator(int64_t display_id);
// Returns true if the screen rotation animation can be completed
// successfully. For example an animation is not possible if |display_id_|
// specifies a display::Display that is not currently active. See
bool CanAnimate() const;
// Rotates the display::Display specified by |display_id_| to the
// |new_rotation|
// orientation, for the given |source|. The rotation will also become active.
// Clients should only call |Rotate()| if |CanAnimate()| returns true.
void Rotate(display::Display::Rotation new_rotation,
display::Display::RotationSource source);
// The id of the display to rotate.
int64_t display_id_;
} // namespace ash