summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/download')
-rw-r--r--chrome/browser/download/download_extension_api.cc2
-rw-r--r--chrome/browser/download/download_util.cc44
-rw-r--r--chrome/browser/download/download_util.h2
3 files changed, 25 insertions, 23 deletions
diff --git a/chrome/browser/download/download_extension_api.cc b/chrome/browser/download/download_extension_api.cc
index a89332d..de5a5657 100644
--- a/chrome/browser/download/download_extension_api.cc
+++ b/chrome/browser/download/download_extension_api.cc
@@ -249,7 +249,7 @@ void DownloadFileIconExtractorImpl::OnIconLoadComplete(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
std::string url;
if (icon)
- url = web_ui_util::GetImageDataUrl(*icon->ToSkBitmap());
+ url = web_ui_util::GetImageDataUrl(*icon->ToImageSkia());
callback_.Run(url);
}
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index 4d2e3ca..1119df0 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -183,13 +183,13 @@ void GenerateFileNameFromRequest(const DownloadItem& download_item,
// Download progress painting --------------------------------------------------
-// Common bitmaps used for download progress animations. We load them once the
+// Common images used for download progress animations. We load them once the
// first time we do a progress paint, then reuse them as they are always the
// same.
-SkBitmap* g_foreground_16 = NULL;
-SkBitmap* g_background_16 = NULL;
-SkBitmap* g_foreground_32 = NULL;
-SkBitmap* g_background_32 = NULL;
+gfx::ImageSkia* g_foreground_16 = NULL;
+gfx::ImageSkia* g_background_16 = NULL;
+gfx::ImageSkia* g_foreground_32 = NULL;
+gfx::ImageSkia* g_background_32 = NULL;
void PaintDownloadProgress(gfx::Canvas* canvas,
#if defined(TOOLKIT_VIEWS)
@@ -200,22 +200,24 @@ void PaintDownloadProgress(gfx::Canvas* canvas,
int start_angle,
int percent_done,
PaintDownloadProgressSize size) {
- // Load up our common bitmaps
+ // Load up our common images
if (!g_background_16) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- g_foreground_16 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
- g_background_16 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_BACKGROUND_16);
- g_foreground_32 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
- g_background_32 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_BACKGROUND_32);
+ g_foreground_16 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
+ g_background_16 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_BACKGROUND_16);
+ g_foreground_32 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
+ g_background_32 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_BACKGROUND_32);
}
- SkBitmap* background = (size == BIG) ? g_background_32 : g_background_16;
- SkBitmap* foreground = (size == BIG) ? g_foreground_32 : g_foreground_16;
+ gfx::ImageSkia* background =
+ (size == BIG) ? g_background_32 : g_background_16;
+ gfx::ImageSkia* foreground =
+ (size == BIG) ? g_foreground_32 : g_foreground_16;
const int kProgressIconSize = (size == BIG) ? kBigProgressIconSize :
kSmallProgressIconSize;
- // We start by storing the bounds of the background and foreground bitmaps
+ // We start by storing the bounds of the background and foreground images
// so that it is easy to mirror the bounds if the UI layout is RTL.
gfx::Rect background_bounds(origin_x, origin_y,
background->width(), background->height());
@@ -298,14 +300,14 @@ void PaintDownloadComplete(gfx::Canvas* canvas,
int origin_y,
double animation_progress,
PaintDownloadProgressSize size) {
- // Load up our common bitmaps.
+ // Load up our common images.
if (!g_foreground_16) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- g_foreground_16 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
- g_foreground_32 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
+ g_foreground_16 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
+ g_foreground_32 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
}
- SkBitmap* complete = (size == BIG) ? g_foreground_32 : g_foreground_16;
+ gfx::ImageSkia* complete = (size == BIG) ? g_foreground_32 : g_foreground_16;
gfx::Rect complete_bounds(origin_x, origin_y,
complete->width(), complete->height());
@@ -330,14 +332,14 @@ void PaintDownloadInterrupted(gfx::Canvas* canvas,
int origin_y,
double animation_progress,
PaintDownloadProgressSize size) {
- // Load up our common bitmaps.
+ // Load up our common images.
if (!g_foreground_16) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- g_foreground_16 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
- g_foreground_32 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
+ g_foreground_16 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
+ g_foreground_32 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
}
- SkBitmap* complete = (size == BIG) ? g_foreground_32 : g_foreground_16;
+ gfx::ImageSkia* complete = (size == BIG) ? g_foreground_32 : g_foreground_16;
gfx::Rect complete_bounds(origin_x, origin_y,
complete->width(), complete->height());
diff --git a/chrome/browser/download/download_util.h b/chrome/browser/download/download_util.h
index 8bd4f21..11215e6 100644
--- a/chrome/browser/download/download_util.h
+++ b/chrome/browser/download/download_util.h
@@ -78,7 +78,7 @@ int GetBigProgressIconSize();
const int kSmallProgressIconSize = 39;
const int kBigProgressIconSize = 52;
-// The offset required to center the icon in the progress bitmaps.
+// The offset required to center the icon in the progress images.
int GetBigProgressIconOffset();
const int kSmallProgressIconOffset =