Chromium Code Reviews| Index: ui/views/controls/scrollbar/scroll_bar_views.h |
| diff --git a/ui/views/controls/scrollbar/native_scroll_bar_views.h b/ui/views/controls/scrollbar/scroll_bar_views.h |
| similarity index 57% |
| rename from ui/views/controls/scrollbar/native_scroll_bar_views.h |
| rename to ui/views/controls/scrollbar/scroll_bar_views.h |
| index d09f60de07ddec6e9dbe738a7870da61dcd785bb..ac7523a2926f9337f4d7bbf8657aa86d8e5200ca 100644 |
| --- a/ui/views/controls/scrollbar/native_scroll_bar_views.h |
| +++ b/ui/views/controls/scrollbar/scroll_bar_views.h |
| @@ -2,8 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_VIEWS_H_ |
| -#define UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_VIEWS_H_ |
| +#ifndef UI_VIEWS_CONTROLS_SCROLLBAR_SCROLL_BAR_VIEWS_H_ |
| +#define UI_VIEWS_CONTROLS_SCROLLBAR_SCROLL_BAR_VIEWS_H_ |
| #include "base/compiler_specific.h" |
| #include "base/macros.h" |
| @@ -11,7 +11,6 @@ |
| #include "ui/native_theme/native_theme.h" |
| #include "ui/views/controls/button/button.h" |
| #include "ui/views/controls/scrollbar/base_scroll_bar.h" |
| -#include "ui/views/controls/scrollbar/native_scroll_bar_wrapper.h" |
| #include "ui/views/view.h" |
| namespace gfx { |
| @@ -20,20 +19,19 @@ class Canvas; |
| namespace views { |
| -class NativeScrollBar; |
| - |
| // Views implementation for the scrollbar. |
| -class VIEWS_EXPORT NativeScrollBarViews : public BaseScrollBar, |
| - public ButtonListener, |
| - public NativeScrollBarWrapper { |
| +class VIEWS_EXPORT ScrollBarViews : public BaseScrollBar, |
|
sky
2016/11/07 16:22:55
optional: name this ScrollBar (the Views name is n
Evan Stade
2016/11/07 17:10:00
yea, this name isn't great, but ScrollBar is alrea
|
| + public ButtonListener { |
| public: |
| static const char kViewClassName[]; |
| // Creates new scrollbar, either horizontal or vertical. |
| - explicit NativeScrollBarViews(NativeScrollBar* native_scroll_bar); |
| - ~NativeScrollBarViews() override; |
| + explicit ScrollBarViews(bool horizontal); |
| + ~ScrollBarViews() override; |
| - private: |
| + static int GetVerticalScrollBarWidth(const ui::NativeTheme* theme); |
| + |
| + protected: |
| // View overrides: |
| void Layout() override; |
| void OnPaint(gfx::Canvas* canvas) override; |
| @@ -43,25 +41,14 @@ class VIEWS_EXPORT NativeScrollBarViews : public BaseScrollBar, |
| // ScrollBar overrides: |
| int GetLayoutSize() const override; |
| - // BaseScrollBar overrides: |
| - void ScrollToPosition(int position) override; |
| - int GetScrollIncrement(bool is_page, bool is_positive) override; |
| - |
| // BaseButton::ButtonListener overrides: |
| void ButtonPressed(Button* sender, const ui::Event& event) override; |
| - // NativeScrollBarWrapper overrides: |
| - int GetPosition() const override; |
| - View* GetView() override; |
| - void Update(int viewport_size, int content_size, int current_pos) override; |
| - |
| // Returns the area for the track. This is the area of the scrollbar minus |
| // the size of the arrow buttons. |
| gfx::Rect GetTrackBounds() const override; |
| - // The NativeScrollBar we are bound to. |
| - NativeScrollBar* native_scroll_bar_; |
| - |
| + private: |
| // The scroll bar buttons (Up/Down, Left/Right). |
| Button* prev_button_; |
| Button* next_button_; |
| @@ -70,9 +57,9 @@ class VIEWS_EXPORT NativeScrollBarViews : public BaseScrollBar, |
| ui::NativeTheme::Part part_; |
| ui::NativeTheme::State state_; |
| - DISALLOW_COPY_AND_ASSIGN(NativeScrollBarViews); |
| + DISALLOW_COPY_AND_ASSIGN(ScrollBarViews); |
| }; |
| } // namespace views |
| -#endif // UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_VIEWS_H_ |
| +#endif // UI_VIEWS_CONTROLS_SCROLLBAR_SCROLL_BAR_VIEWS_H_ |