| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WIN_H_ | 5 #ifndef UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_WIN_H_ |
| 6 #define UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_WIN_H_ | 6 #define UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_WIN_H_ |
| 7 | 7 |
| 8 #include "ui/views/controls/native_control_win.h" | 8 #include "ui/views/controls/native_control_win.h" |
| 9 #include "ui/views/controls/scrollbar/native_scroll_bar_wrapper.h" | 9 #include "ui/views/controls/scrollbar/native_scroll_bar_wrapper.h" |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // Create new scrollbar, either horizontal or vertical. | 27 // Create new scrollbar, either horizontal or vertical. |
| 28 explicit NativeScrollBarWin(NativeScrollBar* native_scroll_bar); | 28 explicit NativeScrollBarWin(NativeScrollBar* native_scroll_bar); |
| 29 virtual ~NativeScrollBarWin(); | 29 virtual ~NativeScrollBarWin(); |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 // Overridden from View for layout purpose. | 32 // Overridden from View for layout purpose. |
| 33 virtual void Layout(); | 33 virtual void Layout(); |
| 34 virtual gfx::Size GetPreferredSize(); | 34 virtual gfx::Size GetPreferredSize(); |
| 35 | 35 |
| 36 // Overridden from View for keyboard UI purpose. | 36 // Overridden from View for keyboard UI purpose. |
| 37 virtual bool OnKeyPressed(const KeyEvent& event); | 37 virtual bool OnKeyPressed(const ui::KeyEvent& event); |
| 38 virtual bool OnMouseWheel(const MouseWheelEvent& e); | 38 virtual bool OnMouseWheel(const MouseWheelEvent& e); |
| 39 | 39 |
| 40 // Overridden from NativeControlWin. | 40 // Overridden from NativeControlWin. |
| 41 virtual void CreateNativeControl(); | 41 virtual void CreateNativeControl(); |
| 42 | 42 |
| 43 // Overridden from ScrollBarWrapper. | 43 // Overridden from ScrollBarWrapper. |
| 44 virtual int GetPosition() const; | 44 virtual int GetPosition() const; |
| 45 virtual View* GetView(); | 45 virtual View* GetView(); |
| 46 virtual void Update(int viewport_size, int content_size, int current_pos); | 46 virtual void Update(int viewport_size, int content_size, int current_pos); |
| 47 | 47 |
| 48 // The NativeScrollBar we are bound to. | 48 // The NativeScrollBar we are bound to. |
| 49 NativeScrollBar* native_scroll_bar_; | 49 NativeScrollBar* native_scroll_bar_; |
| 50 | 50 |
| 51 // sb_container_ is a custom hwnd that we use to wrap the real | 51 // sb_container_ is a custom hwnd that we use to wrap the real |
| 52 // windows scrollbar. We need to do this to get the scroll events | 52 // windows scrollbar. We need to do this to get the scroll events |
| 53 // without having to do anything special in the high level hwnd. | 53 // without having to do anything special in the high level hwnd. |
| 54 scoped_ptr<ScrollBarContainer> sb_container_; | 54 scoped_ptr<ScrollBarContainer> sb_container_; |
| 55 | 55 |
| 56 // Last scrollbar state we wrote to the scrollbar. We keep it here, so we can | 56 // Last scrollbar state we wrote to the scrollbar. We keep it here, so we can |
| 57 // reinitialize the scrollbar to its previous state in case it gets hidden and | 57 // reinitialize the scrollbar to its previous state in case it gets hidden and |
| 58 // recreated. | 58 // recreated. |
| 59 SCROLLINFO scroll_info_; | 59 SCROLLINFO scroll_info_; |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(NativeScrollBarWin); | 61 DISALLOW_COPY_AND_ASSIGN(NativeScrollBarWin); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace views | 64 } // namespace views |
| 65 | 65 |
| 66 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_WIN_H_ | 66 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_WIN_H_ |
| OLD | NEW |