| 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 "ui/views/controls/scrollbar/overlay_scroll_bar.h" | 5 #include "ui/views/controls/scrollbar/overlay_scroll_bar.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "cc/paint/paint_flags.h" | 8 #include "cc/paint/paint_flags.h" |
| 9 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
| 10 #include "ui/compositor/scoped_layer_animation_settings.h" | 10 #include "ui/compositor/scoped_layer_animation_settings.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 if (GetWidget()) | 103 if (GetWidget()) |
| 104 scroll_bar_->StartHideCountdown(); | 104 scroll_bar_->StartHideCountdown(); |
| 105 } else { | 105 } else { |
| 106 layer()->SetTransform(gfx::Transform()); | 106 layer()->SetTransform(gfx::Transform()); |
| 107 layer()->SetOpacity(kThumbHoverAlpha); | 107 layer()->SetOpacity(kThumbHoverAlpha); |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 | 110 |
| 111 OverlayScrollBar::OverlayScrollBar(bool horizontal) | 111 OverlayScrollBar::OverlayScrollBar(bool horizontal) |
| 112 : BaseScrollBar(horizontal), hide_timer_(false, false) { | 112 : BaseScrollBar(horizontal), hide_timer_(false, false) { |
| 113 auto thumb = new Thumb(this); | 113 auto* thumb = new Thumb(this); |
| 114 SetThumb(thumb); | 114 SetThumb(thumb); |
| 115 thumb->Init(); | 115 thumb->Init(); |
| 116 set_notify_enter_exit_on_child(true); | 116 set_notify_enter_exit_on_child(true); |
| 117 SetPaintToLayer(); | 117 SetPaintToLayer(); |
| 118 layer()->SetMasksToBounds(true); | 118 layer()->SetMasksToBounds(true); |
| 119 layer()->SetFillsBoundsOpaquely(false); | 119 layer()->SetFillsBoundsOpaquely(false); |
| 120 } | 120 } |
| 121 | 121 |
| 122 OverlayScrollBar::~OverlayScrollBar() {} | 122 OverlayScrollBar::~OverlayScrollBar() {} |
| 123 | 123 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 171 |
| 172 void OverlayScrollBar::StartHideCountdown() { | 172 void OverlayScrollBar::StartHideCountdown() { |
| 173 if (IsMouseHovered()) | 173 if (IsMouseHovered()) |
| 174 return; | 174 return; |
| 175 hide_timer_.Start( | 175 hide_timer_.Start( |
| 176 FROM_HERE, base::TimeDelta::FromSeconds(1), | 176 FROM_HERE, base::TimeDelta::FromSeconds(1), |
| 177 base::Bind(&OverlayScrollBar::Hide, base::Unretained(this))); | 177 base::Bind(&OverlayScrollBar::Hide, base::Unretained(this))); |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace views | 180 } // namespace views |
| OLD | NEW |