1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_INPUT_LAYER_SCROLL_OFFSET_DELEGATE_H_
6 #define CC_INPUT_LAYER_SCROLL_OFFSET_DELEGATE_H_
10 // The LayerScrollOffsetDelegate allows for the embedder to take ownership of
11 // the scroll offset of the root layer.
13 // The LayerScrollOffsetDelegate is only used on the impl thread.
14 class LayerScrollOffsetDelegate
{
16 // This is called by the compositor when the scroll offset of the layer would
17 // have otherwise changed.
18 virtual void SetTotalScrollOffset(gfx::Vector2dF new_value
) = 0;
20 // This is called by the compositor to query the current scroll offset of the
22 // There is no requirement that the return values of this method are
23 // stable in time (two subsequent calls may yield different results).
24 // The return value is not required to be related to the values passed in to
25 // the SetTotalScrollOffset method in any way.
26 virtual gfx::Vector2dF
GetTotalScrollOffset() = 0;
29 LayerScrollOffsetDelegate() {}
30 virtual ~LayerScrollOffsetDelegate() {}
33 DISALLOW_COPY_AND_ASSIGN(LayerScrollOffsetDelegate
);
38 #endif // CC_INPUT_LAYER_SCROLL_OFFSET_DELEGATE_H_