blob: 895d36d74908247cd3b2a984ed9d168a05a99180 [file] [log] [blame]
// Copyright 2013 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 "base/basictypes.h"
#include "ui/gfx/vector2d_f.h"
namespace cc {
// The LayerScrollOffsetDelegate allows for the embedder to take ownership of
// the scroll offset of the root layer.
// The LayerScrollOffsetDelegate is only used on the impl thread.
class LayerScrollOffsetDelegate {
// This is called by the compositor when the scroll offset of the layer would
// have otherwise changed.
virtual void SetTotalScrollOffset(gfx::Vector2dF new_value) = 0;
// This is called by the compositor to query the current scroll offset of the
// layer.
// There is no requirement that the return values of this method are
// stable in time (two subsequent calls may yield different results).
// The return value is not required to be related to the values passed in to
// the SetTotalScrollOffset method in any way.
virtual gfx::Vector2dF GetTotalScrollOffset() = 0;
LayerScrollOffsetDelegate() {}
virtual ~LayerScrollOffsetDelegate() {}
} // namespace cc