#include "cc/layers/viewport.h"
#include <algorithm>
#include "base/check.h"
#include "base/memory/ptr_util.h"
#include "cc/input/browser_controls_offset_manager.h"
#include "cc/input/snap_selection_strategy.h"
#include "cc/trees/layer_tree_host_impl.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/scroll_node.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/vector2d_f.h"
namespace cc {
std::unique_ptr<Viewport> Viewport::Create(LayerTreeHostImpl* host_impl) { … }
Viewport::Viewport(LayerTreeHostImpl* host_impl)
: … { … }
void Viewport::Pan(const gfx::Vector2dF& delta) { … }
Viewport::ScrollResult Viewport::ScrollBy(const gfx::Vector2dF& physical_delta,
const gfx::Point& viewport_point,
bool is_direct_manipulation,
bool affect_browser_controls,
bool scroll_outer_viewport) { … }
bool Viewport::CanScroll(const ScrollNode& node,
const ScrollState& scroll_state) const { … }
void Viewport::SnapIfNeeded() { … }
gfx::Vector2dF Viewport::ComputeClampedDelta(
const gfx::Vector2dF& scroll_delta) const { … }
gfx::SizeF Viewport::GetInnerViewportSizeExcludingScrollbars() const { … }
void Viewport::ScrollByInnerFirst(const gfx::Vector2dF& delta) { … }
bool Viewport::ShouldAnimateViewport(const gfx::Vector2dF& viewport_delta,
const gfx::Vector2dF& pending_delta) { … }
Viewport::ScrollResult Viewport::ScrollAnimated(const gfx::Vector2dF& delta,
base::TimeDelta delayed_by) { … }
void Viewport::SnapPinchAnchorIfWithinMargin(const gfx::Point& anchor) { … }
void Viewport::PinchUpdate(float magnify_delta, const gfx::Point& anchor) { … }
void Viewport::PinchEnd(const gfx::Point& anchor, bool snap_to_min) { … }
bool Viewport::ShouldScroll(const ScrollNode& scroll_node) const { … }
gfx::Vector2dF Viewport::ScrollBrowserControls(const gfx::Vector2dF& delta) { … }
bool Viewport::ShouldBrowserControlsConsumeScroll(
const gfx::Vector2dF& scroll_delta) const { … }
gfx::Vector2dF Viewport::AdjustOverscroll(const gfx::Vector2dF& delta) const { … }
float Viewport::MaxUserReachableTotalScrollOffsetY() const { … }
gfx::PointF Viewport::TotalScrollOffset() const { … }
ScrollNode* Viewport::InnerScrollNode() const { … }
ScrollNode* Viewport::OuterScrollNode() const { … }
ScrollTree& Viewport::scroll_tree() const { … }
}