Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: ui/views/controls/scrollbar/bitmap_scroll_bar.cc

Issue 9332006: ui/gfx: Make the first version of Canvas::TileImageInt take a gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: put back the Peter's nits Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/bubble/bubble_border.cc ('k') | ui/views/painter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "ui/views/controls/scrollbar/bitmap_scroll_bar.h" 5 #include "ui/views/controls/scrollbar/bitmap_scroll_bar.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 } else if (!thumb->visible()) { 285 } else if (!thumb->visible()) {
286 thumb->SetVisible(true); 286 thumb->SetVisible(true);
287 } 287 }
288 } 288 }
289 289
290 /////////////////////////////////////////////////////////////////////////////// 290 ///////////////////////////////////////////////////////////////////////////////
291 // BitmapScrollBar, View implementation: 291 // BitmapScrollBar, View implementation:
292 292
293 void BitmapScrollBar::OnPaint(gfx::Canvas* canvas) { 293 void BitmapScrollBar::OnPaint(gfx::Canvas* canvas) {
294 // Paint the track. 294 // Paint the track.
295 gfx::Rect track_bounds = GetTrackBounds();
296 canvas->TileImageInt(*images_[THUMB_TRACK][GetThumbTrackState()], 295 canvas->TileImageInt(*images_[THUMB_TRACK][GetThumbTrackState()],
297 track_bounds.x(), track_bounds.y(), 296 GetTrackBounds());
298 track_bounds.width(), track_bounds.height());
299 } 297 }
300 298
301 /////////////////////////////////////////////////////////////////////////////// 299 ///////////////////////////////////////////////////////////////////////////////
302 // BitmapScrollBar, ButtonListener implementation: 300 // BitmapScrollBar, ButtonListener implementation:
303 301
304 void BitmapScrollBar::ButtonPressed(Button* sender, const views::Event& event) { 302 void BitmapScrollBar::ButtonPressed(Button* sender, const views::Event& event) {
305 if (sender == prev_button_) { 303 if (sender == prev_button_) {
306 ScrollByAmount(SCROLL_PREV_LINE); 304 ScrollByAmount(SCROLL_PREV_LINE);
307 } else if (sender == next_button_) { 305 } else if (sender == next_button_) {
308 ScrollByAmount(SCROLL_NEXT_LINE); 306 ScrollByAmount(SCROLL_NEXT_LINE);
309 } 307 }
310 } 308 }
311 309
312 } // namespace views 310 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_border.cc ('k') | ui/views/painter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698