Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Side by Side Diff: cc/trees/layer_tree_impl.h

Issue 2884423003: Use scroll-boundary-behavior to control overscroll-refresh/glow on android. (Closed)
Patch Set: rebase and update comments Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_TREES_LAYER_TREE_IMPL_H_ 5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_
6 #define CC_TREES_LAYER_TREE_IMPL_H_ 6 #define CC_TREES_LAYER_TREE_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 #include <unordered_map> 11 #include <unordered_map>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ptr_util.h" 15 #include "base/memory/ptr_util.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "cc/base/synced_property.h" 17 #include "cc/base/synced_property.h"
18 #include "cc/input/event_listener_properties.h" 18 #include "cc/input/event_listener_properties.h"
19 #include "cc/input/layer_selection_bound.h" 19 #include "cc/input/layer_selection_bound.h"
20 #include "cc/input/scroll_boundary_behavior.h"
20 #include "cc/layers/layer_impl.h" 21 #include "cc/layers/layer_impl.h"
21 #include "cc/layers/layer_list_iterator.h" 22 #include "cc/layers/layer_list_iterator.h"
22 #include "cc/output/swap_promise.h" 23 #include "cc/output/swap_promise.h"
23 #include "cc/resources/ui_resource_client.h" 24 #include "cc/resources/ui_resource_client.h"
24 #include "cc/trees/layer_tree_host_impl.h" 25 #include "cc/trees/layer_tree_host_impl.h"
25 #include "cc/trees/property_tree.h" 26 #include "cc/trees/property_tree.h"
26 #include "components/viz/common/frame_sinks/begin_frame_args.h" 27 #include "components/viz/common/frame_sinks/begin_frame_args.h"
27 28
28 namespace base { 29 namespace base {
29 namespace trace_event { 30 namespace trace_event {
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 bool SetCurrentBrowserControlsShownRatio(float ratio); 490 bool SetCurrentBrowserControlsShownRatio(float ratio);
490 float CurrentBrowserControlsShownRatio() const { 491 float CurrentBrowserControlsShownRatio() const {
491 return top_controls_shown_ratio_->Current(IsActiveTree()); 492 return top_controls_shown_ratio_->Current(IsActiveTree());
492 } 493 }
493 void set_top_controls_height(float top_controls_height); 494 void set_top_controls_height(float top_controls_height);
494 float top_controls_height() const { return top_controls_height_; } 495 float top_controls_height() const { return top_controls_height_; }
495 void PushBrowserControlsFromMainThread(float top_controls_shown_ratio); 496 void PushBrowserControlsFromMainThread(float top_controls_shown_ratio);
496 void set_bottom_controls_height(float bottom_controls_height); 497 void set_bottom_controls_height(float bottom_controls_height);
497 float bottom_controls_height() const { return bottom_controls_height_; } 498 float bottom_controls_height() const { return bottom_controls_height_; }
498 499
500 void set_scroll_boundary_behavior(const ScrollBoundaryBehavior& behavior);
501 ScrollBoundaryBehavior scroll_boundary_behavior() const {
502 return scroll_boundary_behavior_;
503 }
504
499 void SetPendingPageScaleAnimation( 505 void SetPendingPageScaleAnimation(
500 std::unique_ptr<PendingPageScaleAnimation> pending_animation); 506 std::unique_ptr<PendingPageScaleAnimation> pending_animation);
501 std::unique_ptr<PendingPageScaleAnimation> TakePendingPageScaleAnimation(); 507 std::unique_ptr<PendingPageScaleAnimation> TakePendingPageScaleAnimation();
502 508
503 void DidUpdateScrollOffset(ElementId id); 509 void DidUpdateScrollOffset(ElementId id);
504 510
505 // Mark the scrollbar geometries (e.g., thumb size and position) as needing an 511 // Mark the scrollbar geometries (e.g., thumb size and position) as needing an
506 // update. 512 // update.
507 void SetScrollbarGeometriesNeedUpdate() { 513 void SetScrollbarGeometriesNeedUpdate() {
508 if (IsActiveTree()) { 514 if (IsActiveTree()) {
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 bool have_scroll_event_handlers_; 656 bool have_scroll_event_handlers_;
651 EventListenerProperties event_listener_properties_[static_cast<size_t>( 657 EventListenerProperties event_listener_properties_[static_cast<size_t>(
652 EventListenerClass::kNumClasses)]; 658 EventListenerClass::kNumClasses)];
653 659
654 // Whether or not Blink's viewport size was shrunk by the height of the top 660 // Whether or not Blink's viewport size was shrunk by the height of the top
655 // controls at the time of the last layout. 661 // controls at the time of the last layout.
656 bool browser_controls_shrink_blink_size_; 662 bool browser_controls_shrink_blink_size_;
657 float top_controls_height_; 663 float top_controls_height_;
658 float bottom_controls_height_; 664 float bottom_controls_height_;
659 665
666 ScrollBoundaryBehavior scroll_boundary_behavior_;
667
660 // The amount that the browser controls are shown from 0 (hidden) to 1 (fully 668 // The amount that the browser controls are shown from 0 (hidden) to 1 (fully
661 // shown). 669 // shown).
662 scoped_refptr<SyncedBrowserControls> top_controls_shown_ratio_; 670 scoped_refptr<SyncedBrowserControls> top_controls_shown_ratio_;
663 671
664 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; 672 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_;
665 673
666 // Tracks the lifecycle which is used for enforcing dependencies between 674 // Tracks the lifecycle which is used for enforcing dependencies between
667 // lifecycle states. See: |LayerTreeLifecycle|. 675 // lifecycle states. See: |LayerTreeLifecycle|.
668 LayerTreeLifecycle lifecycle_; 676 LayerTreeLifecycle lifecycle_;
669 677
670 private: 678 private:
671 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); 679 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl);
672 }; 680 };
673 681
674 } // namespace cc 682 } // namespace cc
675 683
676 #endif // CC_TREES_LAYER_TREE_IMPL_H_ 684 #endif // CC_TREES_LAYER_TREE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698