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

Side by Side Diff: chrome/browser/download/download_util.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/download/download_util.h ('k') | chrome/browser/extensions/extension_shelf.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // Download utility implementation 5 // Download utility implementation
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "chrome/browser/download/download_util.h" 9 #include "chrome/browser/download/download_util.h"
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // Download progress painting -------------------------------------------------- 58 // Download progress painting --------------------------------------------------
59 59
60 // Common bitmaps used for download progress animations. We load them once the 60 // Common bitmaps used for download progress animations. We load them once the
61 // first time we do a progress paint, then reuse them as they are always the 61 // first time we do a progress paint, then reuse them as they are always the
62 // same. 62 // same.
63 SkBitmap* g_foreground_16 = NULL; 63 SkBitmap* g_foreground_16 = NULL;
64 SkBitmap* g_background_16 = NULL; 64 SkBitmap* g_background_16 = NULL;
65 SkBitmap* g_foreground_32 = NULL; 65 SkBitmap* g_foreground_32 = NULL;
66 SkBitmap* g_background_32 = NULL; 66 SkBitmap* g_background_32 = NULL;
67 67
68 void PaintDownloadProgress(ChromeCanvas* canvas, 68 void PaintDownloadProgress(gfx::Canvas* canvas,
69 #if defined(OS_WIN) 69 #if defined(OS_WIN)
70 views::View* containing_view, 70 views::View* containing_view,
71 #endif 71 #endif
72 int origin_x, 72 int origin_x,
73 int origin_y, 73 int origin_y,
74 int start_angle, 74 int start_angle,
75 int percent_done, 75 int percent_done,
76 PaintDownloadProgressSize size) { 76 PaintDownloadProgressSize size) {
77 // Load up our common bitmaps 77 // Load up our common bitmaps
78 if (!g_background_16) { 78 if (!g_background_16) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 canvas->drawPath(path, foreground_paint); 157 canvas->drawPath(path, foreground_paint);
158 return; 158 return;
159 } 159 }
160 160
161 canvas->DrawBitmapInt(*foreground, 161 canvas->DrawBitmapInt(*foreground,
162 foreground_bounds.x(), 162 foreground_bounds.x(),
163 foreground_bounds.y(), 163 foreground_bounds.y(),
164 foreground_paint); 164 foreground_paint);
165 } 165 }
166 166
167 void PaintDownloadComplete(ChromeCanvas* canvas, 167 void PaintDownloadComplete(gfx::Canvas* canvas,
168 #if defined(OS_WIN) 168 #if defined(OS_WIN)
169 views::View* containing_view, 169 views::View* containing_view,
170 #endif 170 #endif
171 int origin_x, 171 int origin_x,
172 int origin_y, 172 int origin_y,
173 double animation_progress, 173 double animation_progress,
174 PaintDownloadProgressSize size) { 174 PaintDownloadProgressSize size) {
175 // Load up our common bitmaps. 175 // Load up our common bitmaps.
176 if (!g_foreground_16) { 176 if (!g_foreground_16) {
177 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 177 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 scoped_refptr<BaseDragSource> drag_source(new BaseDragSource); 244 scoped_refptr<BaseDragSource> drag_source(new BaseDragSource);
245 245
246 // Run the drag and drop loop 246 // Run the drag and drop loop
247 DWORD effects; 247 DWORD effects;
248 DoDragDrop(data.get(), drag_source.get(), DROPEFFECT_COPY | DROPEFFECT_LINK, 248 DoDragDrop(data.get(), drag_source.get(), DROPEFFECT_COPY | DROPEFFECT_LINK,
249 &effects); 249 &effects);
250 } 250 }
251 #endif 251 #endif
252 252
253 } // namespace download_util 253 } // namespace download_util
OLDNEW
« no previous file with comments | « chrome/browser/download/download_util.h ('k') | chrome/browser/extensions/extension_shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698