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