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