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 if (scroll_delta.y() > 0 && top_controls_manager_->ContentTopOffset() == 0 && | |
jdduke (slow)
2014/10/21 16:09:10
This is probably worth a comment along the lines o
sujith
2014/10/22 14:20:15
Done.
| |
2589 (InnerViewportScrollLayer()->TotalScrollOffset().y() == | |
2590 InnerViewportScrollLayer()->MaxScrollOffset().y())) | |
2591 return false; | |
2592 | |
2588 if (InnerViewportScrollLayer()->MaxScrollOffset().y() > 0) | 2593 if (InnerViewportScrollLayer()->MaxScrollOffset().y() > 0) |
2589 return true; | 2594 return true; |
2590 | 2595 |
2591 if (OuterViewportScrollLayer() && | 2596 if (OuterViewportScrollLayer() && |
2592 OuterViewportScrollLayer()->MaxScrollOffset().y() > 0) | 2597 OuterViewportScrollLayer()->MaxScrollOffset().y() > 0) |
2593 return true; | 2598 return true; |
2594 | 2599 |
2595 return false; | 2600 return false; |
2596 } | 2601 } |
2597 | 2602 |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3473 } | 3478 } |
3474 | 3479 |
3475 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3480 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3476 std::vector<PictureLayerImpl*>::iterator it = | 3481 std::vector<PictureLayerImpl*>::iterator it = |
3477 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3482 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3478 DCHECK(it != picture_layers_.end()); | 3483 DCHECK(it != picture_layers_.end()); |
3479 picture_layers_.erase(it); | 3484 picture_layers_.erase(it); |
3480 } | 3485 } |
3481 | 3486 |
3482 } // namespace cc | 3487 } // namespace cc |
OLD | NEW |