diff options
Diffstat (limited to 'chrome/browser/download')
-rw-r--r-- | chrome/browser/download/download_util.cc | 23 | ||||
-rw-r--r-- | chrome/browser/download/download_util.h | 7 |
2 files changed, 28 insertions, 2 deletions
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index a166958..f9040b3 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -11,6 +11,8 @@ #include "base/base_drag_source.h" #include "base/file_util.h" #include "base/gfx/image_operations.h" +#include "base/string_util.h" +#include "chrome/app/locales/locale_settings.h" #include "chrome/app/theme/theme_resources.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/download/download_manager.h" @@ -389,6 +391,27 @@ void PaintDownloadComplete(ChromeCanvas* canvas, canvas->restore(); } +// Load a language dependent height so that the dangerous download confirmation +// message doesn't overlap with the download link label. +int GetBigProgressIconSize() { + static int big_progress_icon_size = 0; + if (big_progress_icon_size == 0) { + std::wstring locale_size_str = + l10n_util::GetString(IDS_DOWNLOAD_BIG_PROGRESS_SIZE); + bool rc = StringToInt(locale_size_str, &big_progress_icon_size); + if (!rc || big_progress_icon_size < kBigProgressIconSize) { + NOTREACHED(); + big_progress_icon_size = kBigProgressIconSize; + } + } + + return big_progress_icon_size; +} + +int GetBigProgressIconOffset() { + return (GetBigProgressIconSize() - kBigIconSize) / 2; +} + // Download dragging void DragDownload(const DownloadItem* download, SkBitmap* icon) { DCHECK(download); diff --git a/chrome/browser/download/download_util.h b/chrome/browser/download/download_util.h index aa52946..08ba93a 100644 --- a/chrome/browser/download/download_util.h +++ b/chrome/browser/download/download_util.h @@ -136,14 +136,17 @@ const int kProgressRateMs = 150; const int kSmallIconSize = 16; const int kBigIconSize = 32; -// Our progress halo around the icon +// Our progress halo around the icon. +int GetBigProgressIconSize(); + const int kSmallProgressIconSize = 39; const int kBigProgressIconSize = 52; // The offset required to center the icon in the progress bitmaps. +int GetBigProgressIconOffset(); + const int kSmallProgressIconOffset = (kSmallProgressIconSize - kSmallIconSize) / 2; -const int kBigProgressIconOffset = (kBigProgressIconSize - kBigIconSize) / 2; enum PaintDownloadProgressSize { SMALL = 0, |