OLD | NEW |
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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 bool SetCurrentBrowserControlsShownRatio(float ratio); | 491 bool SetCurrentBrowserControlsShownRatio(float ratio); |
491 float CurrentBrowserControlsShownRatio() const { | 492 float CurrentBrowserControlsShownRatio() const { |
492 return top_controls_shown_ratio_->Current(IsActiveTree()); | 493 return top_controls_shown_ratio_->Current(IsActiveTree()); |
493 } | 494 } |
494 void set_top_controls_height(float top_controls_height); | 495 void set_top_controls_height(float top_controls_height); |
495 float top_controls_height() const { return top_controls_height_; } | 496 float top_controls_height() const { return top_controls_height_; } |
496 void PushBrowserControlsFromMainThread(float top_controls_shown_ratio); | 497 void PushBrowserControlsFromMainThread(float top_controls_shown_ratio); |
497 void set_bottom_controls_height(float bottom_controls_height); | 498 void set_bottom_controls_height(float bottom_controls_height); |
498 float bottom_controls_height() const { return bottom_controls_height_; } | 499 float bottom_controls_height() const { return bottom_controls_height_; } |
499 | 500 |
| 501 void set_scroll_boundary_behavior(const ScrollBoundaryBehavior& behavior); |
| 502 ScrollBoundaryBehavior scroll_boundary_behavior() const { |
| 503 return scroll_boundary_behavior_; |
| 504 } |
| 505 |
500 void SetPendingPageScaleAnimation( | 506 void SetPendingPageScaleAnimation( |
501 std::unique_ptr<PendingPageScaleAnimation> pending_animation); | 507 std::unique_ptr<PendingPageScaleAnimation> pending_animation); |
502 std::unique_ptr<PendingPageScaleAnimation> TakePendingPageScaleAnimation(); | 508 std::unique_ptr<PendingPageScaleAnimation> TakePendingPageScaleAnimation(); |
503 | 509 |
504 void DidUpdateScrollOffset(ElementId id); | 510 void DidUpdateScrollOffset(ElementId id); |
505 | 511 |
506 // Mark the scrollbar geometries (e.g., thumb size and position) as needing an | 512 // Mark the scrollbar geometries (e.g., thumb size and position) as needing an |
507 // update. | 513 // update. |
508 void SetScrollbarGeometriesNeedUpdate() { | 514 void SetScrollbarGeometriesNeedUpdate() { |
509 if (IsActiveTree()) { | 515 if (IsActiveTree()) { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 bool have_scroll_event_handlers_; | 657 bool have_scroll_event_handlers_; |
652 EventListenerProperties event_listener_properties_[static_cast<size_t>( | 658 EventListenerProperties event_listener_properties_[static_cast<size_t>( |
653 EventListenerClass::kNumClasses)]; | 659 EventListenerClass::kNumClasses)]; |
654 | 660 |
655 // Whether or not Blink's viewport size was shrunk by the height of the top | 661 // Whether or not Blink's viewport size was shrunk by the height of the top |
656 // controls at the time of the last layout. | 662 // controls at the time of the last layout. |
657 bool browser_controls_shrink_blink_size_; | 663 bool browser_controls_shrink_blink_size_; |
658 float top_controls_height_; | 664 float top_controls_height_; |
659 float bottom_controls_height_; | 665 float bottom_controls_height_; |
660 | 666 |
| 667 ScrollBoundaryBehavior scroll_boundary_behavior_; |
| 668 |
661 // The amount that the browser controls are shown from 0 (hidden) to 1 (fully | 669 // The amount that the browser controls are shown from 0 (hidden) to 1 (fully |
662 // shown). | 670 // shown). |
663 scoped_refptr<SyncedBrowserControls> top_controls_shown_ratio_; | 671 scoped_refptr<SyncedBrowserControls> top_controls_shown_ratio_; |
664 | 672 |
665 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 673 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
666 | 674 |
667 // Tracks the lifecycle which is used for enforcing dependencies between | 675 // Tracks the lifecycle which is used for enforcing dependencies between |
668 // lifecycle states. See: |LayerTreeLifecycle|. | 676 // lifecycle states. See: |LayerTreeLifecycle|. |
669 LayerTreeLifecycle lifecycle_; | 677 LayerTreeLifecycle lifecycle_; |
670 | 678 |
671 private: | 679 private: |
672 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 680 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
673 }; | 681 }; |
674 | 682 |
675 } // namespace cc | 683 } // namespace cc |
676 | 684 |
677 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 685 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
OLD | NEW |