| 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 "cc/input/top_controls_manager.h" | 9 #include "cc/input/top_controls_manager.h" |
| 9 #include "cc/trees/layer_tree_host_impl.h" | 10 #include "cc/trees/layer_tree_host_impl.h" |
| 10 #include "cc/trees/layer_tree_impl.h" | 11 #include "cc/trees/layer_tree_impl.h" |
| 11 #include "ui/gfx/geometry/vector2d_conversions.h" | 12 #include "ui/gfx/geometry/vector2d_conversions.h" |
| 12 #include "ui/gfx/geometry/vector2d_f.h" | 13 #include "ui/gfx/geometry/vector2d_f.h" |
| 13 | 14 |
| 14 namespace cc { | 15 namespace cc { |
| 15 | 16 |
| 16 // static | 17 // static |
| 17 scoped_ptr<Viewport> Viewport::Create( | 18 std::unique_ptr<Viewport> Viewport::Create(LayerTreeHostImpl* host_impl) { |
| 18 LayerTreeHostImpl* host_impl) { | 19 return base::WrapUnique(new Viewport(host_impl)); |
| 19 return make_scoped_ptr(new Viewport(host_impl)); | |
| 20 } | 20 } |
| 21 | 21 |
| 22 Viewport::Viewport(LayerTreeHostImpl* host_impl) | 22 Viewport::Viewport(LayerTreeHostImpl* host_impl) |
| 23 : host_impl_(host_impl) | 23 : host_impl_(host_impl) |
| 24 , pinch_zoom_active_(false) { | 24 , pinch_zoom_active_(false) { |
| 25 DCHECK(host_impl_); | 25 DCHECK(host_impl_); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void Viewport::Pan(const gfx::Vector2dF& delta) { | 28 void Viewport::Pan(const gfx::Vector2dF& delta) { |
| 29 gfx::Vector2dF pending_delta = delta; | 29 gfx::Vector2dF pending_delta = delta; |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 233 |
| 234 LayerImpl* Viewport::InnerScrollLayer() const { | 234 LayerImpl* Viewport::InnerScrollLayer() const { |
| 235 return host_impl_->InnerViewportScrollLayer(); | 235 return host_impl_->InnerViewportScrollLayer(); |
| 236 } | 236 } |
| 237 | 237 |
| 238 LayerImpl* Viewport::OuterScrollLayer() const { | 238 LayerImpl* Viewport::OuterScrollLayer() const { |
| 239 return host_impl_->OuterViewportScrollLayer(); | 239 return host_impl_->OuterViewportScrollLayer(); |
| 240 } | 240 } |
| 241 | 241 |
| 242 } // namespace cc | 242 } // namespace cc |
| OLD | NEW |