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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2106753004: Introduce bottom controls to CC and let it respond to scrolling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: content-offset -> top-controls-shown renaming and respond to bokan's comments Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 053ae8028000cff6ff1c0d18d8a862866f76b094..fd883afe11f0bbfc58f518c3ac80bb30cf15f3f2 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1582,10 +1582,14 @@ CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const {
metadata.root_layer_size = active_tree_->ScrollableSize();
metadata.min_page_scale_factor = active_tree_->min_page_scale_factor();
metadata.max_page_scale_factor = active_tree_->max_page_scale_factor();
- metadata.location_bar_offset =
+ metadata.top_bar_translate =
gfx::Vector2dF(0.f, top_controls_manager_->ControlsTopOffset());
- metadata.location_bar_content_translation =
+ metadata.top_bar_shown =
gfx::Vector2dF(0.f, top_controls_manager_->ContentTopOffset());
+ metadata.bottom_bar_translate =
+ gfx::Vector2dF(0.f, top_controls_manager_->ControlsBottomOffset());
+ metadata.bottom_bar_shown =
+ gfx::Vector2dF(0.f, top_controls_manager_->ContentBottomOffset());
metadata.root_background_color = active_tree_->background_color();
active_tree_->GetViewportSelection(&metadata.selection);
@@ -1893,6 +1897,12 @@ void LayerTreeHostImpl::UpdateViewportContainerSizes() {
: 0.f;
float delta_from_top_controls =
top_controls_layout_height - top_controls_manager_->ContentTopOffset();
+ float bottom_controls_layout_height =
+ active_tree_->top_controls_shrink_blink_size()
+ ? active_tree_->bottom_controls_height()
+ : 0.f;
+ delta_from_top_controls += bottom_controls_layout_height -
+ top_controls_manager_->ContentBottomOffset();
// Adjust the viewport layers by shrinking/expanding the container to account
// for changes in the size (e.g. top controls) since the last resize from
@@ -2447,6 +2457,10 @@ float LayerTreeHostImpl::TopControlsHeight() const {
return active_tree_->top_controls_height();
}
+float LayerTreeHostImpl::BottomControlsHeight() const {
+ return active_tree_->bottom_controls_height();
+}
+
void LayerTreeHostImpl::SetCurrentTopControlsShownRatio(float ratio) {
if (active_tree_->SetCurrentTopControlsShownRatio(ratio))
DidChangeTopControlsPosition();

Powered by Google App Engine
This is Rietveld 408576698