| Index: cc/trees/layer_tree_impl.h
|
| diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h
|
| index a58b645c501f023aa851751690abb91b358060ba..fef45743c2cf617a0afb7af9ae1855a66c506e6e 100644
|
| --- a/cc/trees/layer_tree_impl.h
|
| +++ b/cc/trees/layer_tree_impl.h
|
| @@ -49,6 +49,7 @@ struct RendererCapabilities;
|
| struct SelectionHandle;
|
|
|
| typedef std::vector<UIResourceRequest> UIResourceRequestQueue;
|
| +typedef SyncedProperty<AdditionGroup<float>> SyncedTopControls;
|
| typedef SyncedProperty<AdditionGroup<gfx::Vector2dF>> SyncedElasticOverscroll;
|
|
|
| class CC_EXPORT LayerTreeImpl {
|
| @@ -56,9 +57,11 @@ class CC_EXPORT LayerTreeImpl {
|
| static scoped_ptr<LayerTreeImpl> create(
|
| LayerTreeHostImpl* layer_tree_host_impl,
|
| scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor,
|
| + scoped_refptr<SyncedTopControls> top_controls_shown_ratio,
|
| scoped_refptr<SyncedElasticOverscroll> elastic_overscroll) {
|
| - return make_scoped_ptr(new LayerTreeImpl(
|
| - layer_tree_host_impl, page_scale_factor, elastic_overscroll));
|
| + return make_scoped_ptr(
|
| + new LayerTreeImpl(layer_tree_host_impl, page_scale_factor,
|
| + top_controls_shown_ratio, elastic_overscroll));
|
| }
|
| virtual ~LayerTreeImpl();
|
|
|
| @@ -185,6 +188,13 @@ class CC_EXPORT LayerTreeImpl {
|
| return elastic_overscroll_.get();
|
| }
|
|
|
| + SyncedTopControls* top_controls_shown_ratio() {
|
| + return top_controls_shown_ratio_.get();
|
| + }
|
| + const SyncedTopControls* top_controls_shown_ratio() const {
|
| + return top_controls_shown_ratio_.get();
|
| + }
|
| +
|
| // Updates draw properties and render surface layer list, as well as tile
|
| // priorities. Returns false if it was unable to update.
|
| bool UpdateDrawProperties();
|
| @@ -296,36 +306,17 @@ class CC_EXPORT LayerTreeImpl {
|
| void RegisterPictureLayerImpl(PictureLayerImpl* layer);
|
| void UnregisterPictureLayerImpl(PictureLayerImpl* layer);
|
|
|
| - void set_top_controls_shrink_blink_size(bool shrink) {
|
| - top_controls_shrink_blink_size_ = shrink;
|
| - }
|
| - void set_top_controls_height(float height) { top_controls_height_ = height; }
|
| - void set_top_controls_content_offset(float offset) {
|
| - top_controls_content_offset_ = offset;
|
| - }
|
| - void set_top_controls_delta(float delta) {
|
| - top_controls_delta_ = delta;
|
| - }
|
| - void set_sent_top_controls_delta(float sent_delta) {
|
| - sent_top_controls_delta_ = sent_delta;
|
| - }
|
| -
|
| + void set_top_controls_shrink_blink_size(bool shrink);
|
| bool top_controls_shrink_blink_size() const {
|
| return top_controls_shrink_blink_size_;
|
| }
|
| - float top_controls_height() const { return top_controls_height_; }
|
| - float top_controls_content_offset() const {
|
| - return top_controls_content_offset_;
|
| - }
|
| - float top_controls_delta() const {
|
| - return top_controls_delta_;
|
| - }
|
| - float sent_top_controls_delta() const {
|
| - return sent_top_controls_delta_;
|
| - }
|
| - float total_top_controls_content_offset() const {
|
| - return top_controls_content_offset_ + top_controls_delta_;
|
| + bool SetCurrentTopControlsShownRatio(float ratio);
|
| + float CurrentTopControlsShownRatio() const {
|
| + return top_controls_shown_ratio_->Current(IsActiveTree());
|
| }
|
| + void set_top_controls_height(float top_controls_height);
|
| + float top_controls_height() const { return top_controls_height_; }
|
| + void PushTopControlsFromMainThread(float top_controls_shown_ratio);
|
|
|
| void SetPendingPageScaleAnimation(
|
| scoped_ptr<PendingPageScaleAnimation> pending_animation);
|
| @@ -335,6 +326,7 @@ class CC_EXPORT LayerTreeImpl {
|
| explicit LayerTreeImpl(
|
| LayerTreeHostImpl* layer_tree_host_impl,
|
| scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor,
|
| + scoped_refptr<SyncedTopControls> top_controls_shown_ratio,
|
| scoped_refptr<SyncedElasticOverscroll> elastic_overscroll);
|
| void ReleaseResourcesRecursive(LayerImpl* current);
|
| float ClampPageScaleFactorToLimits(float page_scale_factor) const;
|
| @@ -345,7 +337,7 @@ class CC_EXPORT LayerTreeImpl {
|
| float max_page_scale_factor);
|
| void DidUpdatePageScale();
|
| void HideInnerViewportScrollbarsIfNearMinimumScale();
|
| -
|
| + void PushTopControls(const float* top_controls_shown_ratio);
|
| LayerTreeHostImpl* layer_tree_host_impl_;
|
| int source_frame_number_;
|
| scoped_ptr<LayerImpl> root_layer_;
|
| @@ -408,11 +400,9 @@ class CC_EXPORT LayerTreeImpl {
|
|
|
| float top_controls_height_;
|
|
|
| - // The up-to-date content offset of the top controls, i.e. the amount that the
|
| - // web contents have been shifted down from the top of the device viewport.
|
| - float top_controls_content_offset_;
|
| - float top_controls_delta_;
|
| - float sent_top_controls_delta_;
|
| + // The amount that the top controls are shown from 0 (hidden) to 1 (fully
|
| + // shown).
|
| + scoped_refptr<SyncedTopControls> top_controls_shown_ratio_;
|
|
|
| scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_;
|
|
|
|
|