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

Side by Side Diff: chrome/browser/ui/views/download/download_shelf_view.cc

Issue 8359029: ui/gfx: Convert Canvas::DrawFocusRect() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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
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 "chrome/browser/ui/views/download/download_shelf_view.h" 5 #include "chrome/browser/ui/views/download/download_shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 156 }
157 157
158 void DownloadShelfView::OnPaint(gfx::Canvas* canvas) { 158 void DownloadShelfView::OnPaint(gfx::Canvas* canvas) {
159 OnPaintBackground(canvas); 159 OnPaintBackground(canvas);
160 OnPaintBorder(canvas); 160 OnPaintBorder(canvas);
161 161
162 // Draw the focus rect here, since it's outside the bounds of the item. 162 // Draw the focus rect here, since it's outside the bounds of the item.
163 for (size_t i = 0; i < download_views_.size(); ++i) { 163 for (size_t i = 0; i < download_views_.size(); ++i) {
164 if (download_views_[i]->HasFocus()) { 164 if (download_views_[i]->HasFocus()) {
165 gfx::Rect r = GetFocusRectBounds(download_views_[i]); 165 gfx::Rect r = GetFocusRectBounds(download_views_[i]);
166 canvas->DrawFocusRect(r.x(), r.y(), r.width(), r.height() - 1); 166 canvas->DrawFocusRect(gfx::Rect(r.x(), r.y(), r.width(), r.height() - 1));
Peter Kasting 2011/10/24 22:15:13 Nit: Longer, but less verbose: r.Inset(0, 0, 0, 1
tfarina 2011/10/25 02:04:53 Done.
167 break; 167 break;
168 } 168 }
169 } 169 }
170 } 170 }
171 171
172 void DownloadShelfView::OnPaintBorder(gfx::Canvas* canvas) { 172 void DownloadShelfView::OnPaintBorder(gfx::Canvas* canvas) {
173 canvas->FillRectInt(kBorderColor, 0, 0, width(), 1); 173 canvas->FillRectInt(kBorderColor, 0, 0, width(), 1);
174 } 174 }
175 175
176 void DownloadShelfView::OpenedDownload(DownloadItemView* view) { 176 void DownloadShelfView::OpenedDownload(DownloadItemView* view) {
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 const DownloadItemView* download_item_view) { 458 const DownloadItemView* download_item_view) {
459 gfx::Rect bounds = download_item_view->bounds(); 459 gfx::Rect bounds = download_item_view->bounds();
460 460
461 #if defined(TOOLKIT_VIEWS) 461 #if defined(TOOLKIT_VIEWS)
462 bounds.set_height(bounds.height() - 1); 462 bounds.set_height(bounds.height() - 1);
463 bounds.Offset(0, 3); 463 bounds.Offset(0, 3);
464 #endif 464 #endif
465 465
466 return bounds; 466 return bounds;
467 } 467 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698