| 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/layers/layer.h" | 8 #include "cc/layers/layer.h" |
| 9 #include "ui/gfx/rect_conversions.h" | 9 #include "ui/gfx/rect_conversions.h" |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 | 60 |
| 61 void ScrollbarLayerImplBase::SetVerticalAdjust(float vertical_adjust) { | 61 void ScrollbarLayerImplBase::SetVerticalAdjust(float vertical_adjust) { |
| 62 if (vertical_adjust_ == vertical_adjust) | 62 if (vertical_adjust_ == vertical_adjust) |
| 63 return; | 63 return; |
| 64 vertical_adjust_ = vertical_adjust; | 64 vertical_adjust_ = vertical_adjust; |
| 65 NoteLayerPropertyChanged(); | 65 NoteLayerPropertyChanged(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void ScrollbarLayerImplBase::SetVisibleToTotalLengthRatio(float ratio) { | 68 void ScrollbarLayerImplBase::SetVisibleToTotalLengthRatio(float ratio) { |
| 69 if (!IsThumbResizable()) |
| 70 return; |
| 71 |
| 69 if (visible_to_total_length_ratio_ == ratio) | 72 if (visible_to_total_length_ratio_ == ratio) |
| 70 return; | 73 return; |
| 71 visible_to_total_length_ratio_ = ratio; | 74 visible_to_total_length_ratio_ = ratio; |
| 72 NoteLayerPropertyChanged(); | 75 NoteLayerPropertyChanged(); |
| 73 } | 76 } |
| 74 | 77 |
| 75 void ScrollbarLayerImplBase::SetThumbThicknessScaleFactor(float factor) { | 78 void ScrollbarLayerImplBase::SetThumbThicknessScaleFactor(float factor) { |
| 76 if (thumb_thickness_scale_factor_ == factor) | 79 if (thumb_thickness_scale_factor_ == factor) |
| 77 return; | 80 return; |
| 78 thumb_thickness_scale_factor_ = factor; | 81 thumb_thickness_scale_factor_ = factor; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 : thumb_thickness_adjustment, | 171 : thumb_thickness_adjustment, |
| 169 thumb_offset, | 172 thumb_offset, |
| 170 thumb_thickness - thumb_thickness_adjustment, | 173 thumb_thickness - thumb_thickness_adjustment, |
| 171 thumb_length); | 174 thumb_length); |
| 172 } | 175 } |
| 173 | 176 |
| 174 return ScrollbarLayerRectToContentRect(thumb_rect); | 177 return ScrollbarLayerRectToContentRect(thumb_rect); |
| 175 } | 178 } |
| 176 | 179 |
| 177 } // namespace cc | 180 } // namespace cc |
| OLD | NEW |