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