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_
8 #include "base/basictypes.h"
9 #include "base/callback_forward.h"
10 #include "base/time/time.h"
11 #include "ui/gfx/geometry/scroll_offset.h"
12 #include "ui/gfx/geometry/size_f.h"
16 // The LayerScrollOffsetDelegate allows for the embedder to take ownership of
17 // the scroll offset of the root layer.
19 // The LayerScrollOffsetDelegate is only used on the impl thread.
20 class LayerScrollOffsetDelegate
{
22 // This is called by the compositor to notify the delegate of any change to
23 // the following parameters:
24 // |total_scroll_offset| current scroll offset of the root layer,
25 // |max_scroll_offset| total scroll offset upper bound for the root layer,
26 // |scrollable_size| root layer scrollable size,
27 // |page_scale_factor| current page scale,
28 // |min_page_scale_factor| page scale lower limit,
29 // |max_page_scale_factor| page scale upper limit.
30 virtual void UpdateRootLayerState(
31 const gfx::ScrollOffset
& total_scroll_offset
,
32 const gfx::ScrollOffset
& max_scroll_offset
,
33 const gfx::SizeF
& scrollable_size
,
34 float page_scale_factor
,
35 float min_page_scale_factor
,
36 float max_page_scale_factor
) = 0;
39 LayerScrollOffsetDelegate() {}
40 virtual ~LayerScrollOffsetDelegate() {}
43 DISALLOW_COPY_AND_ASSIGN(LayerScrollOffsetDelegate
);
48 #endif // CC_INPUT_LAYER_SCROLL_OFFSET_DELEGATE_H_