| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. | 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. |
| 6 | 6 |
| 7 #include "chrome/browser/download/download_shelf.h" | 7 #include "chrome/browser/download/download_shelf.h" |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 | 10 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 SkIntToScalar(bounds.x() + image_size), | 133 SkIntToScalar(bounds.x() + image_size), |
| 134 SkIntToScalar(bounds.y() + image_size)); | 134 SkIntToScalar(bounds.y() + image_size)); |
| 135 SkPath path; | 135 SkPath path; |
| 136 path.arcTo(oval, | 136 path.arcTo(oval, |
| 137 SkFloatToScalar(start_pos), | 137 SkFloatToScalar(start_pos), |
| 138 SkFloatToScalar(sweep_angle), false); | 138 SkFloatToScalar(sweep_angle), false); |
| 139 path.lineTo(SkIntToScalar(bounds.x() + image_size / 2), | 139 path.lineTo(SkIntToScalar(bounds.x() + image_size / 2), |
| 140 SkIntToScalar(bounds.y() + image_size / 2)); | 140 SkIntToScalar(bounds.y() + image_size / 2)); |
| 141 | 141 |
| 142 // gfx::Canvas::ClipPath does not provide for anti-aliasing. | 142 // gfx::Canvas::ClipPath does not provide for anti-aliasing. |
| 143 canvas->sk_canvas()->clipPath(path, SkRegion::kIntersect_Op, true); | 143 canvas->sk_canvas()->clipPath(path, kIntersect_SkClipOp, true); |
| 144 } | 144 } |
| 145 | 145 |
| 146 canvas->DrawImageInt(foreground_image, | 146 canvas->DrawImageInt(foreground_image, |
| 147 bounds.x(), | 147 bounds.x(), |
| 148 bounds.y()); | 148 bounds.y()); |
| 149 canvas->Restore(); | 149 canvas->Restore(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 // static | 152 // static |
| 153 void DownloadShelf::PaintDownloadProgress( | 153 void DownloadShelf::PaintDownloadProgress( |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 content::DownloadManager* download_manager = GetDownloadManager(); | 355 content::DownloadManager* download_manager = GetDownloadManager(); |
| 356 if (!download_manager) | 356 if (!download_manager) |
| 357 return; | 357 return; |
| 358 | 358 |
| 359 DownloadItem* download = download_manager->GetDownload(download_id); | 359 DownloadItem* download = download_manager->GetDownload(download_id); |
| 360 if (!download) | 360 if (!download) |
| 361 return; | 361 return; |
| 362 | 362 |
| 363 ShowDownload(download); | 363 ShowDownload(download); |
| 364 } | 364 } |
| OLD | NEW |