| 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 #ifndef UI_VIEWS_CONTROLS_SCROLLBAR_OVERLAY_SCROLL_BAR_H_ | 5 #ifndef UI_VIEWS_CONTROLS_SCROLLBAR_OVERLAY_SCROLL_BAR_H_ |
| 6 #define UI_VIEWS_CONTROLS_SCROLLBAR_OVERLAY_SCROLL_BAR_H_ | 6 #define UI_VIEWS_CONTROLS_SCROLLBAR_OVERLAY_SCROLL_BAR_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/views/controls/scrollbar/base_scroll_bar.h" | 9 #include "ui/views/controls/scrollbar/base_scroll_bar.h" |
| 10 #include "ui/views/controls/scrollbar/base_scroll_bar_thumb.h" | 10 #include "ui/views/controls/scrollbar/base_scroll_bar_thumb.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 void Layout() override; | 29 void Layout() override; |
| 30 void OnMouseEntered(const ui::MouseEvent& event) override; | 30 void OnMouseEntered(const ui::MouseEvent& event) override; |
| 31 void OnMouseExited(const ui::MouseEvent& event) override; | 31 void OnMouseExited(const ui::MouseEvent& event) override; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 class Thumb : public BaseScrollBarThumb { | 34 class Thumb : public BaseScrollBarThumb { |
| 35 public: | 35 public: |
| 36 explicit Thumb(OverlayScrollBar* scroll_bar); | 36 explicit Thumb(OverlayScrollBar* scroll_bar); |
| 37 ~Thumb() override; | 37 ~Thumb() override; |
| 38 | 38 |
| 39 void Init(); |
| 40 |
| 39 protected: | 41 protected: |
| 40 // BaseScrollBarThumb: | 42 // BaseScrollBarThumb: |
| 41 gfx::Size GetPreferredSize() const override; | 43 gfx::Size GetPreferredSize() const override; |
| 42 void OnPaint(gfx::Canvas* canvas) override; | 44 void OnPaint(gfx::Canvas* canvas) override; |
| 43 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; | 45 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; |
| 44 void OnStateChanged() override; | 46 void OnStateChanged() override; |
| 45 | 47 |
| 46 private: | 48 private: |
| 47 OverlayScrollBar* scroll_bar_; | 49 OverlayScrollBar* scroll_bar_; |
| 48 | 50 |
| 49 DISALLOW_COPY_AND_ASSIGN(Thumb); | 51 DISALLOW_COPY_AND_ASSIGN(Thumb); |
| 50 }; | 52 }; |
| 51 friend class Thumb; | 53 friend class Thumb; |
| 52 | 54 |
| 53 // Shows this (effectively, the thumb) without delay. | 55 // Shows this (effectively, the thumb) without delay. |
| 54 void Show(); | 56 void Show(); |
| 55 // Hides this with a delay. | 57 // Hides this with a delay. |
| 56 void Hide(); | 58 void Hide(); |
| 57 // Starts a countdown that hides this when it fires. | 59 // Starts a countdown that hides this when it fires. |
| 58 void StartHideCountdown(); | 60 void StartHideCountdown(); |
| 59 | 61 |
| 60 base::Timer hide_timer_; | 62 base::Timer hide_timer_; |
| 61 | 63 |
| 62 DISALLOW_COPY_AND_ASSIGN(OverlayScrollBar); | 64 DISALLOW_COPY_AND_ASSIGN(OverlayScrollBar); |
| 63 }; | 65 }; |
| 64 | 66 |
| 65 } // namespace views | 67 } // namespace views |
| 66 | 68 |
| 67 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_OVERLAY_SCROLL_BAR_H_ | 69 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_OVERLAY_SCROLL_BAR_H_ |
| OLD | NEW |