OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_INPUT_LAYER_SCROLL_OFFSET_DELEGATE_H_ | 5 #ifndef CC_INPUT_LAYER_SCROLL_OFFSET_DELEGATE_H_ |
6 #define CC_INPUT_LAYER_SCROLL_OFFSET_DELEGATE_H_ | 6 #define CC_INPUT_LAYER_SCROLL_OFFSET_DELEGATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback_forward.h" | |
10 #include "base/time/time.h" | |
9 #include "ui/gfx/geometry/scroll_offset.h" | 11 #include "ui/gfx/geometry/scroll_offset.h" |
10 #include "ui/gfx/geometry/size_f.h" | 12 #include "ui/gfx/geometry/size_f.h" |
11 | 13 |
12 namespace cc { | 14 namespace cc { |
13 | 15 |
14 // The LayerScrollOffsetDelegate allows for the embedder to take ownership of | 16 // The LayerScrollOffsetDelegate allows for the embedder to take ownership of |
15 // the scroll offset of the root layer. | 17 // the scroll offset of the root layer. |
16 // | 18 // |
17 // The LayerScrollOffsetDelegate is only used on the impl thread. | 19 // The LayerScrollOffsetDelegate is only used on the impl thread. |
18 class LayerScrollOffsetDelegate { | 20 class LayerScrollOffsetDelegate { |
(...skipping 18 matching lines...) Expand all Loading... | |
37 virtual void UpdateRootLayerState( | 39 virtual void UpdateRootLayerState( |
38 const gfx::ScrollOffset& total_scroll_offset, | 40 const gfx::ScrollOffset& total_scroll_offset, |
39 const gfx::ScrollOffset& max_scroll_offset, | 41 const gfx::ScrollOffset& max_scroll_offset, |
40 const gfx::SizeF& scrollable_size, | 42 const gfx::SizeF& scrollable_size, |
41 float page_scale_factor, | 43 float page_scale_factor, |
42 float min_page_scale_factor, | 44 float min_page_scale_factor, |
43 float max_page_scale_factor) = 0; | 45 float max_page_scale_factor) = 0; |
44 | 46 |
45 // This is called by the compositor to check whether a delegate-managed fling | 47 // This is called by the compositor to check whether a delegate-managed fling |
46 // is active or not. | 48 // is active or not. |
47 virtual bool IsExternalFlingActive() const = 0; | 49 // TODO(jdduke): Remove? |
aelias_OOO_until_Jul13
2015/05/09 03:32:05
Seems we can't yet because of the other smooth scr
hush (inactive)
2015/05/12 19:08:45
Right. We will still need to keep it until we can
| |
50 virtual bool IsExternalScrollActive() const = 0; | |
51 | |
52 // This is called by the compositor when a fling hitting the root layer | |
53 // requires a scheduled animation update. | |
54 typedef base::Callback<void(base::TimeTicks)> AnimationCallback; | |
55 virtual void SetNeedsAnimate(const AnimationCallback& animation) = 0; | |
48 | 56 |
49 protected: | 57 protected: |
50 LayerScrollOffsetDelegate() {} | 58 LayerScrollOffsetDelegate() {} |
51 virtual ~LayerScrollOffsetDelegate() {} | 59 virtual ~LayerScrollOffsetDelegate() {} |
52 | 60 |
53 private: | 61 private: |
54 DISALLOW_COPY_AND_ASSIGN(LayerScrollOffsetDelegate); | 62 DISALLOW_COPY_AND_ASSIGN(LayerScrollOffsetDelegate); |
55 }; | 63 }; |
56 | 64 |
57 } // namespace cc | 65 } // namespace cc |
58 | 66 |
59 #endif // CC_INPUT_LAYER_SCROLL_OFFSET_DELEGATE_H_ | 67 #endif // CC_INPUT_LAYER_SCROLL_OFFSET_DELEGATE_H_ |
OLD | NEW |