Roll src/third_party/skia d32087a:1052f51
[chromium-blink-merge.git] / ui / views / controls / scrollbar / overlay_scroll_bar.h
blob6c7e4365fdd1613edd5b21673a2c961c7f3ac8b2
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
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_CONTROLS_SCROLLBAR_OVERLAY_SCROLL_BAR_H_
6 #define UI_VIEWS_CONTROLS_SCROLLBAR_OVERLAY_SCROLL_BAR_H_
8 #include "ui/gfx/animation/slide_animation.h"
9 #include "ui/views/controls/scrollbar/base_scroll_bar.h"
11 namespace views {
13 // The transparent scrollbar which overlays its contents.
14 class VIEWS_EXPORT OverlayScrollBar : public BaseScrollBar {
15 public:
16 explicit OverlayScrollBar(bool horizontal);
17 ~OverlayScrollBar() override;
19 protected:
20 // BaseScrollBar overrides:
21 gfx::Rect GetTrackBounds() const override;
22 void OnGestureEvent(ui::GestureEvent* event) override;
24 // ScrollBar overrides:
25 int GetLayoutSize() const override;
26 int GetContentOverlapSize() const override;
27 void OnMouseEnteredScrollView(const ui::MouseEvent& event) override;
28 void OnMouseExitedScrollView(const ui::MouseEvent& event) override;
30 // View overrides:
31 gfx::Size GetPreferredSize() const override;
32 void Layout() override;
33 void OnPaint(gfx::Canvas* canvas) override;
35 private:
36 gfx::SlideAnimation animation_;
37 DISALLOW_COPY_AND_ASSIGN(OverlayScrollBar);
40 } // namespace views
42 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_OVERLAY_SCROLL_BAR_H_