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 2567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2578 return false; | 2578 return false; |
2579 | 2579 |
2580 // Always consume if it's in the direction to show the top controls. | 2580 // Always consume if it's in the direction to show the top controls. |
2581 if (scroll_delta.y() < 0) | 2581 if (scroll_delta.y() < 0) |
2582 return true; | 2582 return true; |
2583 | 2583 |
2584 if (CurrentlyScrollingLayer() != InnerViewportScrollLayer() && | 2584 if (CurrentlyScrollingLayer() != InnerViewportScrollLayer() && |
2585 CurrentlyScrollingLayer() != OuterViewportScrollLayer()) | 2585 CurrentlyScrollingLayer() != OuterViewportScrollLayer()) |
2586 return false; | 2586 return false; |
2587 | 2587 |
2588 // Avoid confusing top controls bookkeeping with positive overscroll deltas. | |
2589 if (scroll_delta.y() > 0 && top_controls_manager_->ContentTopOffset() == 0 && | |
2590 (InnerViewportScrollLayer()->TotalScrollOffset().y() == | |
aelias_OOO_until_Jul13
2014/10/22 18:40:47
This should check OuterViewportScrollLayer as well
sujith
2014/10/23 06:57:10
Done.
| |
2591 InnerViewportScrollLayer()->MaxScrollOffset().y())) | |
2592 return false; | |
2593 | |
2588 if (InnerViewportScrollLayer()->MaxScrollOffset().y() > 0) | 2594 if (InnerViewportScrollLayer()->MaxScrollOffset().y() > 0) |
2589 return true; | 2595 return true; |
2590 | 2596 |
2591 if (OuterViewportScrollLayer() && | 2597 if (OuterViewportScrollLayer() && |
2592 OuterViewportScrollLayer()->MaxScrollOffset().y() > 0) | 2598 OuterViewportScrollLayer()->MaxScrollOffset().y() > 0) |
2593 return true; | 2599 return true; |
2594 | 2600 |
2595 return false; | 2601 return false; |
2596 } | 2602 } |
2597 | 2603 |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3473 } | 3479 } |
3474 | 3480 |
3475 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3481 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3476 std::vector<PictureLayerImpl*>::iterator it = | 3482 std::vector<PictureLayerImpl*>::iterator it = |
3477 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3483 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3478 DCHECK(it != picture_layers_.end()); | 3484 DCHECK(it != picture_layers_.end()); |
3479 picture_layers_.erase(it); | 3485 picture_layers_.erase(it); |
3480 } | 3486 } |
3481 | 3487 |
3482 } // namespace cc | 3488 } // namespace cc |
OLD | NEW |