| 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/layers/scrollbar_layer_impl_base.h" | 5 #include "cc/layers/scrollbar_layer_impl_base.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include "cc/trees/layer_tree_impl.h" | 8 #include "cc/trees/layer_tree_impl.h" |
| 9 #include "ui/gfx/rect_conversions.h" | 9 #include "ui/gfx/rect_conversions.h" |
| 10 | 10 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 return ScrollbarLayerRectToContentRect(thumb_rect); | 242 return ScrollbarLayerRectToContentRect(thumb_rect); |
| 243 } | 243 } |
| 244 | 244 |
| 245 void ScrollbarLayerImplBase::ScrollbarParametersDidChange() { | 245 void ScrollbarLayerImplBase::ScrollbarParametersDidChange() { |
| 246 if (!clip_layer_ || !scroll_layer_) | 246 if (!clip_layer_ || !scroll_layer_) |
| 247 return; | 247 return; |
| 248 | 248 |
| 249 scroll_layer_->SetScrollbarPosition(this, clip_layer_); | 249 scroll_layer_->SetScrollbarPosition(this, clip_layer_); |
| 250 } | 250 } |
| 251 | 251 |
| 252 bool ScrollbarLayerImplBase::ScrollbarNeedsUpdate( |
| 253 float vertical_adjust, |
| 254 float current_pos, |
| 255 int maximum, |
| 256 float visible_to_total_length_ratio) { |
| 257 if ((vertical_adjust != vertical_adjust_) || (current_pos != current_pos_) || |
| 258 (maximum != maximum_) || |
| 259 (visible_to_total_length_ratio != visible_to_total_length_ratio_)) |
| 260 return true; |
| 261 return false; |
| 262 } |
| 263 |
| 252 } // namespace cc | 264 } // namespace cc |
| OLD | NEW |