OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2110 } | 2110 } |
2111 | 2111 |
2112 void LayerTreeHostImpl::ScrollEnd() { | 2112 void LayerTreeHostImpl::ScrollEnd() { |
2113 if (top_controls_manager_) | 2113 if (top_controls_manager_) |
2114 top_controls_manager_->ScrollEnd(); | 2114 top_controls_manager_->ScrollEnd(); |
2115 ClearCurrentlyScrollingLayer(); | 2115 ClearCurrentlyScrollingLayer(); |
2116 StartScrollbarAnimation(); | 2116 StartScrollbarAnimation(); |
2117 } | 2117 } |
2118 | 2118 |
2119 InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() { | 2119 InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() { |
2120 if (active_tree_->CurrentlyScrollingLayer()) | 2120 if (!active_tree_->CurrentlyScrollingLayer()) |
2121 return ScrollStarted; | 2121 return ScrollIgnored; |
2122 | 2122 |
2123 return ScrollIgnored; | 2123 if (settings_.ignore_root_layer_flings && |
| 2124 active_tree_->CurrentlyScrollingLayer() == |
| 2125 active_tree_->RootScrollLayer()) { |
| 2126 ClearCurrentlyScrollingLayer(); |
| 2127 return ScrollIgnored; |
| 2128 } |
| 2129 |
| 2130 return ScrollStarted; |
2124 } | 2131 } |
2125 | 2132 |
2126 void LayerTreeHostImpl::NotifyCurrentFlingVelocity(gfx::Vector2dF velocity) { | 2133 void LayerTreeHostImpl::NotifyCurrentFlingVelocity(gfx::Vector2dF velocity) { |
2127 current_fling_velocity_ = velocity; | 2134 current_fling_velocity_ = velocity; |
2128 } | 2135 } |
2129 | 2136 |
2130 void LayerTreeHostImpl::PinchGestureBegin() { | 2137 void LayerTreeHostImpl::PinchGestureBegin() { |
2131 pinch_gesture_active_ = true; | 2138 pinch_gesture_active_ = true; |
2132 previous_pinch_anchor_ = gfx::Point(); | 2139 previous_pinch_anchor_ = gfx::Point(); |
2133 client_->RenewTreePriority(); | 2140 client_->RenewTreePriority(); |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2490 | 2497 |
2491 ResourceProvider::ResourceId LayerTreeHostImpl::ResourceIdForUIResource( | 2498 ResourceProvider::ResourceId LayerTreeHostImpl::ResourceIdForUIResource( |
2492 UIResourceId uid) const { | 2499 UIResourceId uid) const { |
2493 UIResourceMap::const_iterator iter = ui_resource_map_.find(uid); | 2500 UIResourceMap::const_iterator iter = ui_resource_map_.find(uid); |
2494 if (iter != ui_resource_map_.end()) | 2501 if (iter != ui_resource_map_.end()) |
2495 return iter->second; | 2502 return iter->second; |
2496 return 0; | 2503 return 0; |
2497 } | 2504 } |
2498 | 2505 |
2499 } // namespace cc | 2506 } // namespace cc |
OLD | NEW |