| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_VIEWS_BITMAP_SCROLL_BAR_H__ | 5 #ifndef CHROME_VIEWS_BITMAP_SCROLL_BAR_H__ |
| 6 #define CHROME_VIEWS_BITMAP_SCROLL_BAR_H__ | 6 #define CHROME_VIEWS_BITMAP_SCROLL_BAR_H__ |
| 7 | 7 |
| 8 #include "chrome/views/button.h" | 8 #include "chrome/views/button.h" |
| 9 #include "chrome/views/menu.h" | 9 #include "chrome/views/menu.h" |
| 10 #include "chrome/views/repeat_controller.h" | 10 #include "chrome/views/repeat_controller.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 public Menu::Delegate { | 38 public Menu::Delegate { |
| 39 public: | 39 public: |
| 40 BitmapScrollBar(bool horizontal, bool show_scroll_buttons); | 40 BitmapScrollBar(bool horizontal, bool show_scroll_buttons); |
| 41 virtual ~BitmapScrollBar() { } | 41 virtual ~BitmapScrollBar() { } |
| 42 | 42 |
| 43 // Get the bounds of the "track" area that the thumb is free to slide within. | 43 // Get the bounds of the "track" area that the thumb is free to slide within. |
| 44 gfx::Rect GetTrackBounds() const; | 44 gfx::Rect GetTrackBounds() const; |
| 45 | 45 |
| 46 // A list of parts that the user may supply bitmaps for. | 46 // A list of parts that the user may supply bitmaps for. |
| 47 enum ScrollBarPart { | 47 enum ScrollBarPart { |
| 48 PREV_BUTTON = 0, // The button used to represent scrolling up/left by 1 l
ine. | 48 // The button used to represent scrolling up/left by 1 line. |
| 49 NEXT_BUTTON, // The button used to represent scrolling down/right by
1 line. | 49 PREV_BUTTON = 0, |
| 50 // IMPORTANT: The code assumes the prev and next | 50 // The button used to represent scrolling down/right by 1 line. |
| 51 // buttons have equal width and equal height. | 51 // IMPORTANT: The code assumes the prev and next |
| 52 THUMB_START_CAP, // The top/left segment of the thumb on the scrollbar. | 52 // buttons have equal width and equal height. |
| 53 THUMB_MIDDLE, // The tiled background image of the thumb. | 53 NEXT_BUTTON, |
| 54 THUMB_END_CAP, // The bottom/right segment of the thumb on the scrollba
r. | 54 // The top/left segment of the thumb on the scrollbar. |
| 55 THUMB_GRIPPY, // The grippy that is rendered in the center of the thum
b. | 55 THUMB_START_CAP, |
| 56 THUMB_TRACK, // The tiled background image of the thumb track. | 56 // The tiled background image of the thumb. |
| 57 THUMB_MIDDLE, |
| 58 // The bottom/right segment of the thumb on the scrollbar. |
| 59 THUMB_END_CAP, |
| 60 // The grippy that is rendered in the center of the thumb. |
| 61 THUMB_GRIPPY, |
| 62 // The tiled background image of the thumb track. |
| 63 THUMB_TRACK, |
| 57 PART_COUNT | 64 PART_COUNT |
| 58 }; | 65 }; |
| 59 | 66 |
| 60 // Sets the bitmap to be rendered for the specified part and state. | 67 // Sets the bitmap to be rendered for the specified part and state. |
| 61 void SetImage(ScrollBarPart part, | 68 void SetImage(ScrollBarPart part, |
| 62 BaseButton::ButtonState state, | 69 BaseButton::ButtonState state, |
| 63 SkBitmap* bitmap); | 70 SkBitmap* bitmap); |
| 64 | 71 |
| 65 // An enumeration of different amounts of incremental scroll, representing | 72 // An enumeration of different amounts of incremental scroll, representing |
| 66 // events sent from different parts of the UI/keyboard. | 73 // events sent from different parts of the UI/keyboard. |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 // True if the scroll buttons at each end of the scroll bar should be shown. | 184 // True if the scroll buttons at each end of the scroll bar should be shown. |
| 178 bool show_scroll_buttons_; | 185 bool show_scroll_buttons_; |
| 179 | 186 |
| 180 DISALLOW_EVIL_CONSTRUCTORS(BitmapScrollBar); | 187 DISALLOW_EVIL_CONSTRUCTORS(BitmapScrollBar); |
| 181 }; | 188 }; |
| 182 | 189 |
| 183 } // namespace views | 190 } // namespace views |
| 184 | 191 |
| 185 #endif // #ifndef CHROME_VIEWS_BITMAP_SCROLL_BAR_H__ | 192 #endif // #ifndef CHROME_VIEWS_BITMAP_SCROLL_BAR_H__ |
| 186 | 193 |
| OLD | NEW |