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

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

Issue 8405002: ui/gfx: Convert Canvas::FillRectInt() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: save some vertical space, interactive_ui_tests are fixed by Peter's fix Created 9 years, 1 month 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"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "chrome/browser/download/download_item_model.h" 12 #include "chrome/browser/download/download_item_model.h"
13 #include "chrome/browser/themes/theme_service.h" 13 #include "chrome/browser/themes/theme_service.h"
14 #include "chrome/browser/ui/browser.h" 14 #include "chrome/browser/ui/browser.h"
15 #include "chrome/browser/ui/view_ids.h" 15 #include "chrome/browser/ui/view_ids.h"
16 #include "chrome/browser/ui/views/download/download_item_view.h" 16 #include "chrome/browser/ui/views/download/download_item_view.h"
17 #include "chrome/browser/ui/views/frame/browser_view.h" 17 #include "chrome/browser/ui/views/frame/browser_view.h"
18 #include "content/browser/download/download_item.h" 18 #include "content/browser/download/download_item.h"
19 #include "content/browser/download/download_manager.h"
19 #include "content/browser/download/download_stats.h" 20 #include "content/browser/download/download_stats.h"
20 #include "content/browser/download/download_manager.h"
21 #include "content/browser/tab_contents/navigation_entry.h" 21 #include "content/browser/tab_contents/navigation_entry.h"
22 #include "grit/generated_resources.h" 22 #include "grit/generated_resources.h"
23 #include "grit/theme_resources.h" 23 #include "grit/theme_resources.h"
24 #include "grit/theme_resources_standard.h" 24 #include "grit/theme_resources_standard.h"
25 #include "ui/base/animation/slide_animation.h" 25 #include "ui/base/animation/slide_animation.h"
26 #include "ui/base/l10n/l10n_util.h" 26 #include "ui/base/l10n/l10n_util.h"
27 #include "ui/base/resource/resource_bundle.h" 27 #include "ui/base/resource/resource_bundle.h"
28 #include "ui/gfx/canvas.h" 28 #include "ui/gfx/canvas.h"
29 #include "views/background.h" 29 #include "views/background.h"
30 #include "views/controls/button/image_button.h" 30 #include "views/controls/button/image_button.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 r.Inset(0, 0, 0, 1); 166 r.Inset(0, 0, 0, 1);
167 canvas->DrawFocusRect(r); 167 canvas->DrawFocusRect(r);
168 break; 168 break;
169 } 169 }
170 } 170 }
171 } 171 }
172 172
173 void DownloadShelfView::OnPaintBorder(gfx::Canvas* canvas) { 173 void DownloadShelfView::OnPaintBorder(gfx::Canvas* canvas) {
174 canvas->FillRectInt(kBorderColor, 0, 0, width(), 1); 174 canvas->FillRect(kBorderColor, gfx::Rect(0, 0, width(), 1));
175 } 175 }
176 176
177 void DownloadShelfView::OpenedDownload(DownloadItemView* view) { 177 void DownloadShelfView::OpenedDownload(DownloadItemView* view) {
178 if (CanAutoClose()) 178 if (CanAutoClose())
179 mouse_watcher_.Start(); 179 mouse_watcher_.Start();
180 } 180 }
181 181
182 gfx::Size DownloadShelfView::GetPreferredSize() { 182 gfx::Size DownloadShelfView::GetPreferredSize() {
183 gfx::Size prefsize(kRightPadding + kLeftPadding + kCloseAndLinkPadding, 0); 183 gfx::Size prefsize(kRightPadding + kLeftPadding + kCloseAndLinkPadding, 0);
184 AdjustSize(close_button_, &prefsize); 184 AdjustSize(close_button_, &prefsize);
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 const DownloadItemView* download_item_view) { 459 const DownloadItemView* download_item_view) {
460 gfx::Rect bounds = download_item_view->bounds(); 460 gfx::Rect bounds = download_item_view->bounds();
461 461
462 #if defined(TOOLKIT_VIEWS) 462 #if defined(TOOLKIT_VIEWS)
463 bounds.set_height(bounds.height() - 1); 463 bounds.set_height(bounds.height() - 1);
464 bounds.Offset(0, 3); 464 bounds.Offset(0, 3);
465 #endif 465 #endif
466 466
467 return bounds; 467 return bounds;
468 } 468 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/detachable_toolbar_view.cc ('k') | chrome/browser/ui/views/first_run_search_engine_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698