Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/input/top_controls_manager.h" | 5 #include "cc/input/top_controls_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "cc/animation/keyframed_animation_curve.h" | 10 #include "cc/animation/keyframed_animation_curve.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 } | 100 } |
| 101 | 101 |
| 102 gfx::Vector2dF TopControlsManager::ScrollBy( | 102 gfx::Vector2dF TopControlsManager::ScrollBy( |
| 103 const gfx::Vector2dF& pending_delta) { | 103 const gfx::Vector2dF& pending_delta) { |
| 104 if (!TopControlsHeight()) | 104 if (!TopControlsHeight()) |
| 105 return pending_delta; | 105 return pending_delta; |
| 106 | 106 |
| 107 if (pinch_gesture_active_) | 107 if (pinch_gesture_active_) |
| 108 return pending_delta; | 108 return pending_delta; |
| 109 | 109 |
| 110 if (!TopControlsHeight()) | 110 // if (!TopControlsHeight()) |
| 111 return pending_delta; | 111 // return pending_delta; |
|
bokan
2015/05/05 11:16:54
Don't comment out code, just remove it.
| |
| 112 | 112 |
| 113 if (permitted_state_ == SHOWN && pending_delta.y() > 0) | 113 if (permitted_state_ == SHOWN && pending_delta.y() > 0) |
| 114 return pending_delta; | 114 return pending_delta; |
| 115 else if (permitted_state_ == HIDDEN && pending_delta.y() < 0) | 115 else if (permitted_state_ == HIDDEN && pending_delta.y() < 0) |
| 116 return pending_delta; | 116 return pending_delta; |
| 117 | 117 |
| 118 accumulated_scroll_delta_ += pending_delta.y(); | 118 accumulated_scroll_delta_ += pending_delta.y(); |
| 119 | 119 |
| 120 float old_offset = ContentTopOffset(); | 120 float old_offset = ContentTopOffset(); |
| 121 client_->SetCurrentTopControlsShownRatio( | 121 client_->SetCurrentTopControlsShownRatio( |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 } | 237 } |
| 238 return false; | 238 return false; |
| 239 } | 239 } |
| 240 | 240 |
| 241 void TopControlsManager::ResetBaseline() { | 241 void TopControlsManager::ResetBaseline() { |
| 242 accumulated_scroll_delta_ = 0.f; | 242 accumulated_scroll_delta_ = 0.f; |
| 243 baseline_content_offset_ = ContentTopOffset(); | 243 baseline_content_offset_ = ContentTopOffset(); |
| 244 } | 244 } |
| 245 | 245 |
| 246 } // namespace cc | 246 } // namespace cc |
| OLD | NEW |