| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |