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

Side by Side Diff: cc/layers/viewport.cc

Issue 2365793002: Fix scroll chaining for non-descendants of root scroller. (Closed)
Patch Set: Rebase and remove hack Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "cc/layers/viewport.h" 5 #include "cc/layers/viewport.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "cc/input/top_controls_manager.h" 9 #include "cc/input/top_controls_manager.h"
10 #include "cc/trees/layer_tree_host_impl.h" 10 #include "cc/trees/layer_tree_host_impl.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 Pan(move); 189 Pan(move);
190 } 190 }
191 191
192 void Viewport::PinchEnd() { 192 void Viewport::PinchEnd() {
193 pinch_anchor_adjustment_ = gfx::Vector2d(); 193 pinch_anchor_adjustment_ = gfx::Vector2d();
194 pinch_zoom_active_ = false; 194 pinch_zoom_active_ = false;
195 } 195 }
196 196
197 LayerImpl* Viewport::MainScrollLayer() const { 197 LayerImpl* Viewport::MainScrollLayer() const {
198 return InnerScrollLayer(); 198 return OuterScrollLayer();
199 } 199 }
200 200
201 gfx::Vector2dF Viewport::ScrollTopControls(const gfx::Vector2dF& delta) { 201 gfx::Vector2dF Viewport::ScrollTopControls(const gfx::Vector2dF& delta) {
202 gfx::Vector2dF excess_delta = 202 gfx::Vector2dF excess_delta =
203 host_impl_->top_controls_manager()->ScrollBy(delta); 203 host_impl_->top_controls_manager()->ScrollBy(delta);
204 204
205 return delta - excess_delta; 205 return delta - excess_delta;
206 } 206 }
207 207
208 bool Viewport::ShouldTopControlsConsumeScroll( 208 bool Viewport::ShouldTopControlsConsumeScroll(
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 255
256 LayerImpl* Viewport::InnerScrollLayer() const { 256 LayerImpl* Viewport::InnerScrollLayer() const {
257 return host_impl_->InnerViewportScrollLayer(); 257 return host_impl_->InnerViewportScrollLayer();
258 } 258 }
259 259
260 LayerImpl* Viewport::OuterScrollLayer() const { 260 LayerImpl* Viewport::OuterScrollLayer() const {
261 return host_impl_->OuterViewportScrollLayer(); 261 return host_impl_->OuterViewportScrollLayer();
262 } 262 }
263 263
264 } // namespace cc 264 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698