| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_NATIVE_SCROLL_BAR_VIEWS_H_ | 5 #ifndef UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_VIEWS_H_ |
| 6 #define UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_VIEWS_H_ | 6 #define UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_VIEWS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ui/gfx/native_theme.h" | 10 #include "ui/gfx/native_theme.h" |
| 11 #include "ui/gfx/point.h" | 11 #include "ui/gfx/point.h" |
| 12 #include "ui/views/controls/button/button.h" | 12 #include "ui/views/controls/button/button.h" |
| 13 #include "ui/views/controls/scrollbar/base_scroll_bar.h" | 13 #include "ui/views/controls/scrollbar/base_scroll_bar.h" |
| 14 #include "ui/views/controls/scrollbar/native_scroll_bar_wrapper.h" | 14 #include "ui/views/controls/scrollbar/native_scroll_bar_wrapper.h" |
| 15 #include "ui/views/view.h" | 15 #include "ui/views/view.h" |
| 16 | 16 |
| 17 namespace gfx { | 17 namespace gfx { |
| 18 class Canvas; | 18 class CanvasSkia; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace views { | 21 namespace views { |
| 22 | 22 |
| 23 class NativeScrollBar; | 23 class NativeScrollBar; |
| 24 | 24 |
| 25 // Views implementation for the scrollbar. | 25 // Views implementation for the scrollbar. |
| 26 class VIEWS_EXPORT NativeScrollBarViews : public BaseScrollBar, | 26 class VIEWS_EXPORT NativeScrollBarViews : public BaseScrollBar, |
| 27 public ButtonListener, | 27 public ButtonListener, |
| 28 public NativeScrollBarWrapper { | 28 public NativeScrollBarWrapper { |
| 29 public: | 29 public: |
| 30 static const char kViewClassName[]; | 30 static const char kViewClassName[]; |
| 31 | 31 |
| 32 // Creates new scrollbar, either horizontal or vertical. | 32 // Creates new scrollbar, either horizontal or vertical. |
| 33 explicit NativeScrollBarViews(NativeScrollBar* native_scroll_bar); | 33 explicit NativeScrollBarViews(NativeScrollBar* native_scroll_bar); |
| 34 virtual ~NativeScrollBarViews(); | 34 virtual ~NativeScrollBarViews(); |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 // View overrides: | 37 // View overrides: |
| 38 virtual void Layout() OVERRIDE; | 38 virtual void Layout() OVERRIDE; |
| 39 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 39 virtual void OnPaint(gfx::CanvasSkia* canvas) OVERRIDE; |
| 40 virtual gfx::Size GetPreferredSize() OVERRIDE; | 40 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 41 virtual std::string GetClassName() const OVERRIDE; | 41 virtual std::string GetClassName() const OVERRIDE; |
| 42 | 42 |
| 43 // ScrollBar overrides: | 43 // ScrollBar overrides: |
| 44 virtual int GetLayoutSize() const OVERRIDE; | 44 virtual int GetLayoutSize() const OVERRIDE; |
| 45 | 45 |
| 46 // BaseScrollBar overrides: | 46 // BaseScrollBar overrides: |
| 47 virtual void ScrollToPosition(int position) OVERRIDE; | 47 virtual void ScrollToPosition(int position) OVERRIDE; |
| 48 virtual int GetScrollIncrement(bool is_page, bool is_positive) OVERRIDE; | 48 virtual int GetScrollIncrement(bool is_page, bool is_positive) OVERRIDE; |
| 49 | 49 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 72 gfx::NativeTheme::ExtraParams params_; | 72 gfx::NativeTheme::ExtraParams params_; |
| 73 gfx::NativeTheme::Part part_; | 73 gfx::NativeTheme::Part part_; |
| 74 gfx::NativeTheme::State state_; | 74 gfx::NativeTheme::State state_; |
| 75 | 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(NativeScrollBarViews); | 76 DISALLOW_COPY_AND_ASSIGN(NativeScrollBarViews); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 } // namespace views | 79 } // namespace views |
| 80 | 80 |
| 81 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_VIEWS_H_ | 81 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_VIEWS_H_ |
| OLD | NEW |