Chromium Code Reviews| 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 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 2552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2563 } | 2563 } |
| 2564 | 2564 |
| 2565 bool LayerTreeHostImpl::ShouldTopControlsConsumeScroll( | 2565 bool LayerTreeHostImpl::ShouldTopControlsConsumeScroll( |
| 2566 const gfx::Vector2dF& scroll_delta) const { | 2566 const gfx::Vector2dF& scroll_delta) const { |
| 2567 DCHECK(CurrentlyScrollingLayer()); | 2567 DCHECK(CurrentlyScrollingLayer()); |
| 2568 | 2568 |
| 2569 if (!top_controls_manager_) | 2569 if (!top_controls_manager_) |
| 2570 return false; | 2570 return false; |
| 2571 | 2571 |
| 2572 // Always consume if it's in the direction to show the top controls. | 2572 // Always consume if it's in the direction to show the top controls. |
| 2573 if (scroll_delta.y() < 0) | 2573 if (scroll_delta.y() != 0) |
|
aelias_OOO_until_Jul13
2014/12/02 19:55:02
This fix isn't correct as it will hide the top con
elisabets
2014/12/05 13:30:26
Ah, so the CurrentlyScrollingLayer is the <scrolla
| |
| 2574 return true; | 2574 return true; |
| 2575 | 2575 |
| 2576 if (CurrentlyScrollingLayer() != InnerViewportScrollLayer() && | 2576 if (CurrentlyScrollingLayer() != InnerViewportScrollLayer() && |
| 2577 CurrentlyScrollingLayer() != OuterViewportScrollLayer()) | 2577 CurrentlyScrollingLayer() != OuterViewportScrollLayer()) |
| 2578 return false; | 2578 return false; |
| 2579 | 2579 |
| 2580 if (active_tree()->TotalScrollOffset().y() < | 2580 if (active_tree()->TotalScrollOffset().y() < |
| 2581 active_tree()->TotalMaxScrollOffset().y()) | 2581 active_tree()->TotalMaxScrollOffset().y()) |
| 2582 return true; | 2582 return true; |
| 2583 | 2583 |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3486 } | 3486 } |
| 3487 | 3487 |
| 3488 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3488 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3489 std::vector<PictureLayerImpl*>::iterator it = | 3489 std::vector<PictureLayerImpl*>::iterator it = |
| 3490 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3490 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3491 DCHECK(it != picture_layers_.end()); | 3491 DCHECK(it != picture_layers_.end()); |
| 3492 picture_layers_.erase(it); | 3492 picture_layers_.erase(it); |
| 3493 } | 3493 } |
| 3494 | 3494 |
| 3495 } // namespace cc | 3495 } // namespace cc |
| OLD | NEW |