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

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

Issue 113443: ChromeCanvas->gfx::Canvas (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « chrome/browser/views/download_shelf_view.h ('k') | chrome/browser/views/find_bar_view.h » ('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) 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/browser/views/download_shelf_view.h" 5 #include "chrome/browser/views/download_shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/gfx/chrome_canvas.h" 9 #include "app/gfx/canvas.h"
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
11 #include "app/resource_bundle.h" 11 #include "app/resource_bundle.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "chrome/browser/download/download_item_model.h" 13 #include "chrome/browser/download/download_item_model.h"
14 #include "chrome/browser/download/download_manager.h" 14 #include "chrome/browser/download/download_manager.h"
15 #include "chrome/browser/tab_contents/navigation_entry.h" 15 #include "chrome/browser/tab_contents/navigation_entry.h"
16 #include "chrome/browser/tab_contents/tab_contents.h" 16 #include "chrome/browser/tab_contents/tab_contents.h"
17 #include "chrome/browser/views/download_item_view.h" 17 #include "chrome/browser/views/download_item_view.h"
18 #include "grit/generated_resources.h" 18 #include "grit/generated_resources.h"
19 #include "grit/theme_resources.h" 19 #include "grit/theme_resources.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 DCHECK(i != download_views_.end()); 140 DCHECK(i != download_views_.end());
141 download_views_.erase(i); 141 download_views_.erase(i);
142 RemoveChildView(view); 142 RemoveChildView(view);
143 delete view; 143 delete view;
144 if (download_views_.empty()) 144 if (download_views_.empty())
145 tab_contents_->SetDownloadShelfVisible(false); 145 tab_contents_->SetDownloadShelfVisible(false);
146 Layout(); 146 Layout();
147 SchedulePaint(); 147 SchedulePaint();
148 } 148 }
149 149
150 void DownloadShelfView::Paint(ChromeCanvas* canvas) { 150 void DownloadShelfView::Paint(gfx::Canvas* canvas) {
151 PaintBackground(canvas); 151 PaintBackground(canvas);
152 PaintBorder(canvas); 152 PaintBorder(canvas);
153 } 153 }
154 154
155 void DownloadShelfView::PaintBorder(ChromeCanvas* canvas) { 155 void DownloadShelfView::PaintBorder(gfx::Canvas* canvas) {
156 canvas->FillRectInt(kBorderColor, 0, 0, width(), 1); 156 canvas->FillRectInt(kBorderColor, 0, 0, width(), 1);
157 } 157 }
158 158
159 gfx::Size DownloadShelfView::GetPreferredSize() { 159 gfx::Size DownloadShelfView::GetPreferredSize() {
160 gfx::Size prefsize(kRightPadding + kLeftPadding + kCloseAndLinkPadding, 0); 160 gfx::Size prefsize(kRightPadding + kLeftPadding + kCloseAndLinkPadding, 0);
161 AdjustSize(close_button_, &prefsize); 161 AdjustSize(close_button_, &prefsize);
162 AdjustSize(show_all_view_, &prefsize); 162 AdjustSize(show_all_view_, &prefsize);
163 // Add one download view to the preferred size. 163 // Add one download view to the preferred size.
164 if (download_views_.size() > 0) { 164 if (download_views_.size() > 0) {
165 AdjustSize(*download_views_.begin(), &prefsize); 165 AdjustSize(*download_views_.begin(), &prefsize);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 ShowAllDownloads(); 262 ShowAllDownloads();
263 } 263 }
264 264
265 void DownloadShelfView::ButtonPressed(views::Button* button) { 265 void DownloadShelfView::ButtonPressed(views::Button* button) {
266 shelf_animation_->Hide(); 266 shelf_animation_->Hide();
267 } 267 }
268 268
269 bool DownloadShelfView::IsShowing() const { 269 bool DownloadShelfView::IsShowing() const {
270 return shelf_animation_->IsShowing(); 270 return shelf_animation_->IsShowing();
271 } 271 }
OLDNEW
« no previous file with comments | « chrome/browser/views/download_shelf_view.h ('k') | chrome/browser/views/find_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698