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 #include "chrome/views/bitmap_scroll_bar.h" | 5 #include "chrome/views/bitmap_scroll_bar.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "chrome/common/gfx/chrome_canvas.h" | 8 #include "chrome/common/gfx/chrome_canvas.h" |
9 #include "chrome/common/l10n_util.h" | 9 #include "chrome/common/l10n_util.h" |
10 #include "chrome/views/menu.h" | 10 #include "chrome/views/menu.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 214 |
215 // Returns the bitmap that is tiled in the background of the thumb between | 215 // Returns the bitmap that is tiled in the background of the thumb between |
216 // the start and the end caps. | 216 // the start and the end caps. |
217 SkBitmap* background_bitmap() const { | 217 SkBitmap* background_bitmap() const { |
218 return scroll_bar_->images_[BitmapScrollBar::THUMB_MIDDLE][state_]; | 218 return scroll_bar_->images_[BitmapScrollBar::THUMB_MIDDLE][state_]; |
219 } | 219 } |
220 | 220 |
221 // Returns the bitmap that is rendered in the middle of the thumb | 221 // Returns the bitmap that is rendered in the middle of the thumb |
222 // transparently over the background bitmap. | 222 // transparently over the background bitmap. |
223 SkBitmap* grippy_bitmap() const { | 223 SkBitmap* grippy_bitmap() const { |
224 return scroll_bar_->images_[BitmapScrollBar::THUMB_GRIPPY][BaseButton::BS_NO
RMAL]; | 224 return scroll_bar_->images_[BitmapScrollBar::THUMB_GRIPPY] |
| 225 [BaseButton::BS_NORMAL]; |
225 } | 226 } |
226 | 227 |
227 // Update our state and schedule a repaint when the mouse moves over us. | 228 // Update our state and schedule a repaint when the mouse moves over us. |
228 void SetState(BaseButton::ButtonState state) { | 229 void SetState(BaseButton::ButtonState state) { |
229 state_ = state; | 230 state_ = state; |
230 SchedulePaint(); | 231 SchedulePaint(); |
231 } | 232 } |
232 | 233 |
233 // The BitmapScrollBar that owns us. | 234 // The BitmapScrollBar that owns us. |
234 BitmapScrollBar* scroll_bar_; | 235 BitmapScrollBar* scroll_bar_; |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 return (thumb_position * contents_size_) / GetTrackSize(); | 696 return (thumb_position * contents_size_) / GetTrackSize(); |
696 } | 697 } |
697 | 698 |
698 void BitmapScrollBar::SetThumbTrackState(BaseButton::ButtonState state) { | 699 void BitmapScrollBar::SetThumbTrackState(BaseButton::ButtonState state) { |
699 thumb_track_state_ = state; | 700 thumb_track_state_ = state; |
700 SchedulePaint(); | 701 SchedulePaint(); |
701 } | 702 } |
702 | 703 |
703 } // namespace views | 704 } // namespace views |
704 | 705 |
OLD | NEW |