summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-31 21:11:41 +0000
committerpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-31 21:11:41 +0000
commit454dcb8ded0800384d70a126e61939e1178e922d (patch)
treefeb19fd2bd2b0c2355ffaa22522f6392c4774c02 /chrome
parent6e2ef010f76be1ea7c5c45b17a375af68f8dd947 (diff)
downloadchromium_src-454dcb8ded0800384d70a126e61939e1178e922d.zip
chromium_src-454dcb8ded0800384d70a126e61939e1178e922d.tar.gz
chromium_src-454dcb8ded0800384d70a126e61939e1178e922d.tar.bz2
Fix a bug where languages that have a long string for the
dangerous download warning cause an overlap with the label for that download's URL. We now use a locale-specific pixel value which changes the height of each download's view on the download page so that this overlap no longer happens. BUG=3824 (http://code.google.com/p/chromium/issues/detail?id=3824) Review URL: http://codereview.chromium.org/8933 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4323 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/locales/locale_settings.h3
-rw-r--r--chrome/app/resources/locale_settings_ar.rc1
-rw-r--r--chrome/app/resources/locale_settings_bg.rc1
-rw-r--r--chrome/app/resources/locale_settings_ca.rc1
-rw-r--r--chrome/app/resources/locale_settings_cs.rc1
-rw-r--r--chrome/app/resources/locale_settings_da.rc1
-rw-r--r--chrome/app/resources/locale_settings_de.rc1
-rw-r--r--chrome/app/resources/locale_settings_el.rc1
-rw-r--r--chrome/app/resources/locale_settings_en-GB.rc1
-rw-r--r--chrome/app/resources/locale_settings_en-US.rc1
-rw-r--r--chrome/app/resources/locale_settings_es-419.rc1
-rw-r--r--chrome/app/resources/locale_settings_es.rc1
-rw-r--r--chrome/app/resources/locale_settings_et.rc1
-rw-r--r--chrome/app/resources/locale_settings_fi.rc1
-rw-r--r--chrome/app/resources/locale_settings_fil.rc1
-rw-r--r--chrome/app/resources/locale_settings_fr.rc1
-rw-r--r--chrome/app/resources/locale_settings_he.rc1
-rw-r--r--chrome/app/resources/locale_settings_hi.rc1
-rw-r--r--chrome/app/resources/locale_settings_hr.rc1
-rw-r--r--chrome/app/resources/locale_settings_hu.rc1
-rw-r--r--chrome/app/resources/locale_settings_id.rc1
-rw-r--r--chrome/app/resources/locale_settings_it.rc1
-rw-r--r--chrome/app/resources/locale_settings_ja.rc1
-rw-r--r--chrome/app/resources/locale_settings_ko.rc1
-rw-r--r--chrome/app/resources/locale_settings_lt.rc1
-rw-r--r--chrome/app/resources/locale_settings_lv.rc1
-rw-r--r--chrome/app/resources/locale_settings_nb.rc1
-rw-r--r--chrome/app/resources/locale_settings_nl.rc1
-rw-r--r--chrome/app/resources/locale_settings_pl.rc1
-rw-r--r--chrome/app/resources/locale_settings_pt-BR.rc1
-rw-r--r--chrome/app/resources/locale_settings_pt-PT.rc1
-rw-r--r--chrome/app/resources/locale_settings_ro.rc1
-rw-r--r--chrome/app/resources/locale_settings_ru.rc1
-rw-r--r--chrome/app/resources/locale_settings_sk.rc1
-rw-r--r--chrome/app/resources/locale_settings_sl.rc1
-rw-r--r--chrome/app/resources/locale_settings_sr.rc1
-rw-r--r--chrome/app/resources/locale_settings_sv.rc1
-rw-r--r--chrome/app/resources/locale_settings_th.rc1
-rw-r--r--chrome/app/resources/locale_settings_tr.rc1
-rw-r--r--chrome/app/resources/locale_settings_uk.rc1
-rw-r--r--chrome/app/resources/locale_settings_vi.rc1
-rw-r--r--chrome/app/resources/locale_settings_zh-CN.rc1
-rw-r--r--chrome/app/resources/locale_settings_zh-TW.rc1
-rw-r--r--chrome/browser/download/download_util.cc23
-rw-r--r--chrome/browser/download/download_util.h7
-rw-r--r--chrome/browser/views/download_tab_view.cc162
-rw-r--r--chrome/browser/views/download_tab_view.h7
47 files changed, 165 insertions, 79 deletions
diff --git a/chrome/app/locales/locale_settings.h b/chrome/app/locales/locale_settings.h
index 66478df..09f5d53 100644
--- a/chrome/app/locales/locale_settings.h
+++ b/chrome/app/locales/locale_settings.h
@@ -169,3 +169,6 @@
// (See above).
#define IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS 1062
#define IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES 1063
+
+// The language dependent download view size.
+#define IDS_DOWNLOAD_BIG_PROGRESS_SIZE 1064
diff --git a/chrome/app/resources/locale_settings_ar.rc b/chrome/app/resources/locale_settings_ar.rc
index 6bbad24..e807f58 100644
--- a/chrome/app/resources/locale_settings_ar.rc
+++ b/chrome/app/resources/locale_settings_ar.rc
@@ -63,6 +63,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=ar"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_bg.rc b/chrome/app/resources/locale_settings_bg.rc
index f76d8dd..8a5d4c6 100644
--- a/chrome/app/resources/locale_settings_bg.rc
+++ b/chrome/app/resources/locale_settings_bg.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=bg"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_ca.rc b/chrome/app/resources/locale_settings_ca.rc
index 3e76ab1..a3b7a23 100644
--- a/chrome/app/resources/locale_settings_ca.rc
+++ b/chrome/app/resources/locale_settings_ca.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=ca"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_cs.rc b/chrome/app/resources/locale_settings_cs.rc
index 12bb5ce..94ad9eb 100644
--- a/chrome/app/resources/locale_settings_cs.rc
+++ b/chrome/app/resources/locale_settings_cs.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=cs"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_da.rc b/chrome/app/resources/locale_settings_da.rc
index 5580239..1a00a789 100644
--- a/chrome/app/resources/locale_settings_da.rc
+++ b/chrome/app/resources/locale_settings_da.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=da"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_de.rc b/chrome/app/resources/locale_settings_de.rc
index 8458ee8..276770c 100644
--- a/chrome/app/resources/locale_settings_de.rc
+++ b/chrome/app/resources/locale_settings_de.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=de"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_el.rc b/chrome/app/resources/locale_settings_el.rc
index 73510a4..108f51f 100644
--- a/chrome/app/resources/locale_settings_el.rc
+++ b/chrome/app/resources/locale_settings_el.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=el"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_en-GB.rc b/chrome/app/resources/locale_settings_en-GB.rc
index aeef168..2820111 100644
--- a/chrome/app/resources/locale_settings_en-GB.rc
+++ b/chrome/app/resources/locale_settings_en-GB.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=en-GB"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_en-US.rc b/chrome/app/resources/locale_settings_en-US.rc
index 765ad25..88116ab 100644
--- a/chrome/app/resources/locale_settings_en-US.rc
+++ b/chrome/app/resources/locale_settings_en-US.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=en-US"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_es-419.rc b/chrome/app/resources/locale_settings_es-419.rc
index 210b5dd..36ecd31 100644
--- a/chrome/app/resources/locale_settings_es-419.rc
+++ b/chrome/app/resources/locale_settings_es-419.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=es-419"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_es.rc b/chrome/app/resources/locale_settings_es.rc
index f6fd956..7fbda2b 100644
--- a/chrome/app/resources/locale_settings_es.rc
+++ b/chrome/app/resources/locale_settings_es.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=es"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_et.rc b/chrome/app/resources/locale_settings_et.rc
index a9aacbc..df5c474 100644
--- a/chrome/app/resources/locale_settings_et.rc
+++ b/chrome/app/resources/locale_settings_et.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=et"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_fi.rc b/chrome/app/resources/locale_settings_fi.rc
index 7c0d2c7..2de2d58d 100644
--- a/chrome/app/resources/locale_settings_fi.rc
+++ b/chrome/app/resources/locale_settings_fi.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=fi"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_fil.rc b/chrome/app/resources/locale_settings_fil.rc
index 343e403..78730dd 100644
--- a/chrome/app/resources/locale_settings_fil.rc
+++ b/chrome/app/resources/locale_settings_fil.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=fil"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_fr.rc b/chrome/app/resources/locale_settings_fr.rc
index ccc1e58..06528e8 100644
--- a/chrome/app/resources/locale_settings_fr.rc
+++ b/chrome/app/resources/locale_settings_fr.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=fr"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_he.rc b/chrome/app/resources/locale_settings_he.rc
index 9d1f390..3835671 100644
--- a/chrome/app/resources/locale_settings_he.rc
+++ b/chrome/app/resources/locale_settings_he.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=he"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_hi.rc b/chrome/app/resources/locale_settings_hi.rc
index 26b6113..b52b597 100644
--- a/chrome/app/resources/locale_settings_hi.rc
+++ b/chrome/app/resources/locale_settings_hi.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=hi"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_hr.rc b/chrome/app/resources/locale_settings_hr.rc
index e154d08..f4156e0 100644
--- a/chrome/app/resources/locale_settings_hr.rc
+++ b/chrome/app/resources/locale_settings_hr.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=hr"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_hu.rc b/chrome/app/resources/locale_settings_hu.rc
index 4c84a3e..c07ec97 100644
--- a/chrome/app/resources/locale_settings_hu.rc
+++ b/chrome/app/resources/locale_settings_hu.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=hu"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_id.rc b/chrome/app/resources/locale_settings_id.rc
index 1253c26..d6cf2b3 100644
--- a/chrome/app/resources/locale_settings_id.rc
+++ b/chrome/app/resources/locale_settings_id.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=id"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_it.rc b/chrome/app/resources/locale_settings_it.rc
index 3f1af0b..f10ac25 100644
--- a/chrome/app/resources/locale_settings_it.rc
+++ b/chrome/app/resources/locale_settings_it.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=it"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_ja.rc b/chrome/app/resources/locale_settings_ja.rc
index d39aea2..f45517c 100644
--- a/chrome/app/resources/locale_settings_ja.rc
+++ b/chrome/app/resources/locale_settings_ja.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=ja"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_ko.rc b/chrome/app/resources/locale_settings_ko.rc
index a1cdbf6..278f03e 100644
--- a/chrome/app/resources/locale_settings_ko.rc
+++ b/chrome/app/resources/locale_settings_ko.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=ko"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_lt.rc b/chrome/app/resources/locale_settings_lt.rc
index f3c4aa1..0de1903 100644
--- a/chrome/app/resources/locale_settings_lt.rc
+++ b/chrome/app/resources/locale_settings_lt.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=lt"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_lv.rc b/chrome/app/resources/locale_settings_lv.rc
index c712df4..8e1c3f3 100644
--- a/chrome/app/resources/locale_settings_lv.rc
+++ b/chrome/app/resources/locale_settings_lv.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=lv"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_nb.rc b/chrome/app/resources/locale_settings_nb.rc
index 7e4f0d1..146200b 100644
--- a/chrome/app/resources/locale_settings_nb.rc
+++ b/chrome/app/resources/locale_settings_nb.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=nb"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_nl.rc b/chrome/app/resources/locale_settings_nl.rc
index 50fafeb..3adf860 100644
--- a/chrome/app/resources/locale_settings_nl.rc
+++ b/chrome/app/resources/locale_settings_nl.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=nl"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_pl.rc b/chrome/app/resources/locale_settings_pl.rc
index 87f14f5..fa18c28 100644
--- a/chrome/app/resources/locale_settings_pl.rc
+++ b/chrome/app/resources/locale_settings_pl.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=pl"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_pt-BR.rc b/chrome/app/resources/locale_settings_pt-BR.rc
index 83849f8..ba615a5 100644
--- a/chrome/app/resources/locale_settings_pt-BR.rc
+++ b/chrome/app/resources/locale_settings_pt-BR.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=pt-BR"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_pt-PT.rc b/chrome/app/resources/locale_settings_pt-PT.rc
index 2edbfc6..01a90dc 100644
--- a/chrome/app/resources/locale_settings_pt-PT.rc
+++ b/chrome/app/resources/locale_settings_pt-PT.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=pt-PT"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "66"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_ro.rc b/chrome/app/resources/locale_settings_ro.rc
index 4fc94c0..feb2c27 100644
--- a/chrome/app/resources/locale_settings_ro.rc
+++ b/chrome/app/resources/locale_settings_ro.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=ro"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_ru.rc b/chrome/app/resources/locale_settings_ru.rc
index 0e265f2..5fbd052 100644
--- a/chrome/app/resources/locale_settings_ru.rc
+++ b/chrome/app/resources/locale_settings_ru.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=ru"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_sk.rc b/chrome/app/resources/locale_settings_sk.rc
index 26bec13..0c57492 100644
--- a/chrome/app/resources/locale_settings_sk.rc
+++ b/chrome/app/resources/locale_settings_sk.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=sk"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_sl.rc b/chrome/app/resources/locale_settings_sl.rc
index b05cc89..221d46a 100644
--- a/chrome/app/resources/locale_settings_sl.rc
+++ b/chrome/app/resources/locale_settings_sl.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=sl"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_sr.rc b/chrome/app/resources/locale_settings_sr.rc
index c5f45ad..362c53c 100644
--- a/chrome/app/resources/locale_settings_sr.rc
+++ b/chrome/app/resources/locale_settings_sr.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=sr"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_sv.rc b/chrome/app/resources/locale_settings_sv.rc
index 0d122b9..405fa176 100644
--- a/chrome/app/resources/locale_settings_sv.rc
+++ b/chrome/app/resources/locale_settings_sv.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=sv"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_th.rc b/chrome/app/resources/locale_settings_th.rc
index 8ccfc96..31f2b92 100644
--- a/chrome/app/resources/locale_settings_th.rc
+++ b/chrome/app/resources/locale_settings_th.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=th"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_tr.rc b/chrome/app/resources/locale_settings_tr.rc
index 32e6537..7924455 100644
--- a/chrome/app/resources/locale_settings_tr.rc
+++ b/chrome/app/resources/locale_settings_tr.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=tr"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "66"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_uk.rc b/chrome/app/resources/locale_settings_uk.rc
index faa16da..8f82270 100644
--- a/chrome/app/resources/locale_settings_uk.rc
+++ b/chrome/app/resources/locale_settings_uk.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=uk"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_vi.rc b/chrome/app/resources/locale_settings_vi.rc
index 7ca6b52..5f2747a 100644
--- a/chrome/app/resources/locale_settings_vi.rc
+++ b/chrome/app/resources/locale_settings_vi.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=vi"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_zh-CN.rc b/chrome/app/resources/locale_settings_zh-CN.rc
index bcddad3..906cb3d1 100644
--- a/chrome/app/resources/locale_settings_zh-CN.rc
+++ b/chrome/app/resources/locale_settings_zh-CN.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=zh-CN"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
diff --git a/chrome/app/resources/locale_settings_zh-TW.rc b/chrome/app/resources/locale_settings_zh-TW.rc
index 0e5b65c..ed9cab8 100644
--- a/chrome/app/resources/locale_settings_zh-TW.rc
+++ b/chrome/app/resources/locale_settings_zh-TW.rc
@@ -62,6 +62,7 @@ BEGIN
IDS_LEARN_MORE_PRIVACY_URL "http://www.google.com/support/chrome/bin/answer.py?answer=114836&hl=zh-TW"
IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS "150"
IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES "40"
+ IDS_DOWNLOAD_BIG_PROGRESS_SIZE "52"
END
#if defined(GOOGLE_CHROME_BUILD)
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,
diff --git a/chrome/browser/views/download_tab_view.cc b/chrome/browser/views/download_tab_view.cc
index 38ca746..1098aa2 100644
--- a/chrome/browser/views/download_tab_view.cc
+++ b/chrome/browser/views/download_tab_view.cc
@@ -200,15 +200,13 @@ gfx::Size DownloadItemTabView::GetPreferredSize() {
gfx::Size pause_size = pause_->GetPreferredSize();
gfx::Size cancel_size = cancel_->GetPreferredSize();
gfx::Size show_size = show_->GetPreferredSize();
- return gfx::Size(
- download_util::kBigProgressIconSize +
- 2 * kSpacer +
- kHorizontalLinkPadding +
- kFilenameSize +
- std::max(pause_size.width() + cancel_size.width() +
- kHorizontalLinkPadding,
- show_size.width()),
- download_util::kBigProgressIconSize);
+ return gfx::Size(parent_->big_icon_size() +
+ 2 * kSpacer +
+ kHorizontalLinkPadding +
+ kFilenameSize +
+ std::max(pause_size.width() + cancel_size.width() +
+ kHorizontalLinkPadding, show_size.width()),
+ parent_->big_icon_size());
}
// Each DownloadItemTabView has reasonably complex layout requirements
@@ -251,14 +249,14 @@ void DownloadItemTabView::LayoutDate() {
since_->SetText(TimeFormat::RelativeDate(model_->start_time(), NULL));
gfx::Size since_size = since_->GetPreferredSize();
- since_->SetBounds(kLeftMargin, download_util::kBigProgressIconOffset,
+ since_->SetBounds(kLeftMargin, parent_->big_icon_offset(),
kDateSize, since_size.height());
since_->SetVisible(true);
date_->SetText(base::TimeFormatShortDate(model_->start_time()));
gfx::Size date_size = date_->GetPreferredSize();
date_->SetBounds(kLeftMargin, since_size.height() + kVerticalPadding +
- download_util::kBigProgressIconOffset,
+ parent_->big_icon_offset(),
kDateSize, date_size.height());
date_->SetVisible(true);
}
@@ -279,13 +277,13 @@ void DownloadItemTabView::LayoutComplete() {
discard_button_->SetEnabled(false);
LayoutDate();
- int dx = kDownloadIconOffset - download_util::kBigProgressIconOffset +
- download_util::kBigProgressIconSize + kInfoPadding;
+ int dx = kDownloadIconOffset - parent_->big_icon_offset() +
+ parent_->big_icon_size() + kInfoPadding;
// File name and URL
file_name_->SetText(model_->GetFileName());
gfx::Size file_name_size = file_name_->GetPreferredSize();
- file_name_->SetBounds(dx, download_util::kBigProgressIconOffset,
+ file_name_->SetBounds(dx, parent_->big_icon_offset(),
std::min(kFilenameSize,
static_cast<int>(file_name_size.width())),
file_name_size.height());
@@ -297,7 +295,7 @@ void DownloadItemTabView::LayoutComplete() {
gfx::Size url_size = download_url_->GetPreferredSize();
download_url_->SetBounds(dx,
file_name_size.height() + kVerticalPadding +
- download_util::kBigProgressIconOffset,
+ parent_->big_icon_offset(),
std::min(kFilenameSize,
static_cast<int>(width() - dx)),
url_size.height());
@@ -307,7 +305,7 @@ void DownloadItemTabView::LayoutComplete() {
// Action button (text is constant and set in constructor)
gfx::Size show_size = show_->GetPreferredSize();
show_->SetBounds(dx, ((file_name_size.height() + url_size.height()) / 2) +
- download_util::kBigProgressIconOffset,
+ parent_->big_icon_offset(),
show_size.width(), show_size.height());
show_->SetVisible(true);
show_->SetEnabled(true);
@@ -329,13 +327,13 @@ void DownloadItemTabView::LayoutCancelled() {
discard_button_->SetEnabled(false);
LayoutDate();
- int dx = kDownloadIconOffset - download_util::kBigProgressIconOffset +
- download_util::kBigProgressIconSize + kInfoPadding;
+ int dx = kDownloadIconOffset - parent_->big_icon_offset() +
+ parent_->big_icon_size() + kInfoPadding;
// File name and URL, truncated to show cancelled status
file_name_->SetText(model_->GetFileName());
gfx::Size file_name_size = file_name_->GetPreferredSize();
- file_name_->SetBounds(dx, download_util::kBigProgressIconOffset,
+ file_name_->SetBounds(dx, parent_->big_icon_offset(),
kFilenameSize - kProgressSize - kSpacer,
file_name_size.height());
file_name_->SetVisible(true);
@@ -346,7 +344,7 @@ void DownloadItemTabView::LayoutCancelled() {
gfx::Size url_size = download_url_->GetPreferredSize();
download_url_->SetBounds(dx,
file_name_size.height() + kVerticalPadding +
- download_util::kBigProgressIconOffset,
+ parent_->big_icon_offset(),
std::min(kFilenameSize - kProgressSize - kSpacer,
static_cast<int>(width() - dx)),
url_size.height());
@@ -358,7 +356,7 @@ void DownloadItemTabView::LayoutCancelled() {
time_remaining_->SetColor(kStatusColor);
time_remaining_->SetText(l10n_util::GetString(IDS_DOWNLOAD_TAB_CANCELLED));
gfx::Size cancel_size = time_remaining_->GetPreferredSize();
- time_remaining_->SetBounds(dx, download_util::kBigProgressIconOffset,
+ time_remaining_->SetBounds(dx, parent_->big_icon_offset(),
kProgressSize, cancel_size.height());
time_remaining_->SetVisible(true);
@@ -398,7 +396,7 @@ void DownloadItemTabView::LayoutCancelled() {
gfx::Size byte_size = download_progress_->GetPreferredSize();
download_progress_->SetBounds(dx,
file_name_size.height() + kVerticalPadding +
- download_util::kBigProgressIconOffset,
+ parent_->big_icon_offset(),
kProgressSize,
byte_size.height());
download_progress_->SetVisible(true);
@@ -416,14 +414,13 @@ void DownloadItemTabView::LayoutInProgress() {
discard_button_->SetEnabled(false);
LayoutDate();
- int dx = kDownloadIconOffset - download_util::kBigProgressIconOffset +
- download_util::kBigProgressIconSize +
- kInfoPadding;
+ int dx = kDownloadIconOffset - parent_->big_icon_offset() +
+ parent_->big_icon_size() + kInfoPadding;
// File name and URL, truncated to show progress status
file_name_->SetText(model_->GetFileName());
gfx::Size file_name_size = file_name_->GetPreferredSize();
- file_name_->SetBounds(dx, download_util::kBigProgressIconOffset,
+ file_name_->SetBounds(dx, parent_->big_icon_offset(),
kFilenameSize - kProgressSize - kSpacer,
file_name_size.height());
file_name_->SetVisible(true);
@@ -433,7 +430,7 @@ void DownloadItemTabView::LayoutInProgress() {
download_url_->SetURL(url);
gfx::Size url_size = download_url_->GetPreferredSize();
download_url_->SetBounds(dx, file_name_size.height() + kVerticalPadding +
- download_util::kBigProgressIconOffset,
+ parent_->big_icon_offset(),
std::min(kFilenameSize - kProgressSize - kSpacer,
static_cast<int>(width() - dx)),
url_size.height());
@@ -506,7 +503,7 @@ void DownloadItemTabView::LayoutInProgress() {
// Time remaining
int y_pos = file_name_size.height() + kVerticalPadding +
- download_util::kBigProgressIconOffset;
+ parent_->big_icon_offset();
gfx::Size time_size;
time_remaining_->SetColor(kStatusColor);
if (model_->is_paused()) {
@@ -514,7 +511,7 @@ void DownloadItemTabView::LayoutInProgress() {
time_remaining_->SetText(
l10n_util::GetString(IDS_DOWNLOAD_PROGRESS_PAUSED));
time_size = time_remaining_->GetPreferredSize();
- time_remaining_->SetBounds(dx, download_util::kBigProgressIconOffset,
+ time_remaining_->SetBounds(dx, parent_->big_icon_offset(),
kProgressSize, time_size.height());
time_remaining_->SetVisible(true);
} else if (total > 0) {
@@ -522,13 +519,13 @@ void DownloadItemTabView::LayoutInProgress() {
if (model_->TimeRemaining(&remaining))
time_remaining_->SetText(TimeFormat::TimeRemaining(remaining));
time_size = time_remaining_->GetPreferredSize();
- time_remaining_->SetBounds(dx, download_util::kBigProgressIconOffset,
+ time_remaining_->SetBounds(dx, parent_->big_icon_offset(),
kProgressSize, time_size.height());
time_remaining_->SetVisible(true);
} else {
time_remaining_->SetText(L"");
y_pos = ((file_name_size.height() + url_size.height()) / 2) +
- download_util::kBigProgressIconOffset;
+ parent_->big_icon_offset();
}
download_progress_->SetText(progress);
@@ -539,7 +536,7 @@ void DownloadItemTabView::LayoutInProgress() {
dx += kProgressSize + kSpacer;
y_pos = ((file_name_size.height() + url_size.height()) / 2) +
- download_util::kBigProgressIconOffset;
+ parent_->big_icon_offset();
// Pause (or Resume) / Cancel buttons.
if (model_->is_paused())
@@ -574,9 +571,8 @@ void DownloadItemTabView::LayoutPromptDangerousDownload() {
download_progress_->SetVisible(false);
LayoutDate();
- int dx = kDownloadIconOffset - download_util::kBigProgressIconOffset +
- download_util::kBigProgressIconSize +
- kInfoPadding;
+ int dx = kDownloadIconOffset - parent_->big_icon_offset() +
+ parent_->big_icon_size() + kInfoPadding;
// Warning message and URL.
std::wstring file_name;
@@ -620,14 +616,21 @@ void DownloadItemTabView::Paint(ChromeCanvas* canvas) {
if (model_->state() == DownloadItem::IN_PROGRESS &&
model_->safety_state() != DownloadItem::DANGEROUS) {
- download_util::PaintDownloadProgress(canvas,
- this,
- kDownloadIconOffset -
- download_util::kBigProgressIconOffset,
- 0,
- parent_->start_angle(),
- model_->PercentComplete(),
- download_util::BIG);
+ // For most languages, 'offset' will be 0. For languages where the dangerous
+ // download warning is longer than usual, the download view will be slightly
+ // larger and 'offset' will be positive value that lines up the progress
+ // halo and the file's icon in order to accomodate the larger view.
+ int offset = (parent_->big_icon_size() -
+ download_util::kBigProgressIconSize) / 2;
+ download_util::PaintDownloadProgress(
+ canvas,
+ this,
+ offset + kDownloadIconOffset -
+ parent_->big_icon_offset(),
+ offset,
+ parent_->start_angle(),
+ model_->PercentComplete(),
+ download_util::BIG);
}
// Most of the UI elements in the DownloadItemTabView are represented as
@@ -637,7 +640,7 @@ void DownloadItemTabView::Paint(ChromeCanvas* canvas) {
SkBitmap* icon = parent_->LookupIcon(model_);
if (icon) {
gfx::Rect icon_bounds(kDownloadIconOffset,
- download_util::kBigProgressIconOffset,
+ parent_->big_icon_offset(),
icon->width(), icon->height());
icon_bounds.set_x(MirroredLeftPointForRect(icon_bounds));
canvas->DrawBitmapInt(*icon, icon_bounds.x(), icon_bounds.y());
@@ -652,11 +655,11 @@ void DownloadItemTabView::PaintBackground(ChromeCanvas* canvas) {
// directly painted on the canvas (as opposed to being represented as a
// child View like the rest of the UI elements in DownloadItemTabView).
gfx::Rect highlighted_bounds(kDownloadIconOffset -
- download_util::kBigProgressIconOffset,
+ parent_->big_icon_offset(),
0,
- download_util::kBigProgressIconSize +
- kInfoPadding + kFilenameSize,
- download_util::kBigProgressIconSize);
+ parent_->big_icon_size() +
+ kInfoPadding + kFilenameSize,
+ parent_->big_icon_size());
highlighted_bounds.set_x(MirroredLeftPointForRect(highlighted_bounds));
canvas->FillRectInt(kSelectedItemColor,
@@ -678,11 +681,11 @@ bool DownloadItemTabView::OnMousePressed(const views::MouseEvent& event) {
// If the click is in the highlight region, then highlight this download.
// Otherwise, remove the highlighting from any download.
gfx::Rect select_rect(
- kDownloadIconOffset - download_util::kBigProgressIconOffset,
+ kDownloadIconOffset - parent_->big_icon_offset(),
0,
- kDownloadIconOffset - download_util::kBigProgressIconOffset +
- download_util::kBigProgressIconSize + kInfoPadding + kFilenameSize,
- download_util::kBigProgressIconSize);
+ kDownloadIconOffset - parent_->big_icon_offset() +
+ parent_->big_icon_size() + kInfoPadding + kFilenameSize,
+ parent_->big_icon_size());
// The position of the highlighted region does not take into account the
// View's UI layout so we have to manually mirror the position if the View is
@@ -720,12 +723,14 @@ bool DownloadItemTabView::OnMouseDragged(const views::MouseEvent& event) {
// mirrored, we can either flip the mouse X coordinate or flip the X position
// of the drag rectangle. Flipping the mouse X coordinate is easier.
point.x = MirroredXCoordinateInsideView(point.x);
- CRect drag_rect(kDownloadIconOffset - download_util::kBigProgressIconOffset,
+ CRect drag_rect(kDownloadIconOffset -
+ parent_->big_icon_offset(),
0,
- kDownloadIconOffset - download_util::kBigProgressIconOffset +
- download_util::kBigProgressIconSize + kInfoPadding +
- kFilenameSize,
- download_util::kBigProgressIconSize);
+ kDownloadIconOffset -
+ parent_->big_icon_offset() +
+ parent_->big_icon_size() + kInfoPadding +
+ kFilenameSize,
+ parent_->big_icon_size());
if (drag_rect.PtInRect(point)) {
SkBitmap* icon = parent_->LookupIcon(model_);
@@ -772,8 +777,10 @@ void DownloadItemTabView::ButtonPressed(views::NativeButton* sender) {
DownloadTabView::DownloadTabView(DownloadManager* model)
: model_(model),
+ big_icon_size_(download_util::GetBigProgressIconSize()),
+ big_icon_offset_(download_util::GetBigProgressIconOffset()),
start_angle_(download_util::kStartAngleDegrees),
- scroll_helper_(kSpacer, download_util::kBigProgressIconSize + kSpacer),
+ scroll_helper_(kSpacer, big_icon_size_ + kSpacer),
selected_index_(-1) {
DCHECK(model_);
}
@@ -783,10 +790,15 @@ DownloadTabView::~DownloadTabView() {
model_->RemoveObserver(this);
// DownloadManager owns the contents.
+ for (OrderedDownloads::iterator it = downloads_.begin();
+ it != downloads_.end(); ++it) {
+ (*it)->RemoveObserver(this);
+ }
downloads_.clear();
ClearDownloadInProgress();
ClearDangerousDownloads();
+
icon_consumer_.CancelAllRequests();
}
@@ -821,9 +833,9 @@ void DownloadTabView::Layout() {
// as NativeControls are not supported yet in floating views.
gfx::Rect visible_bounds = GetVisibleBounds();
int row_start = (visible_bounds.y() - kSpacer) /
- (download_util::kBigProgressIconSize + kSpacer);
+ (big_icon_size_ + kSpacer);
int row_stop = (visible_bounds.y() - kSpacer + visible_bounds.height()) /
- (download_util::kBigProgressIconSize + kSpacer);
+ (big_icon_size_ + kSpacer);
row_stop = std::min(row_stop, static_cast<int>(downloads_.size()) - 1);
for (int i = row_start; i <= row_stop; ++i) {
// The DownloadManager stores downloads earliest first, but this view
@@ -835,7 +847,7 @@ void DownloadTabView::Layout() {
View* v = GetParent();
if (v) {
int h = static_cast<int>(downloads_.size()) *
- (download_util::kBigProgressIconSize + kSpacer) + kSpacer;
+ (big_icon_size_ + kSpacer) + kSpacer;
SetBounds(x(), y(), v->width(), h);
}
}
@@ -850,26 +862,24 @@ void DownloadTabView::Paint(ChromeCanvas* canvas) {
SkRect clip;
if (canvas->getClipBounds(&clip)) {
int row_start = (SkScalarRound(clip.fTop) - kSpacer) /
- (download_util::kBigProgressIconSize + kSpacer);
- int row_stop = SkScalarRound(clip.fBottom) /
- (download_util::kBigProgressIconSize + kSpacer);
+ (big_icon_size_ + kSpacer);
+ int row_stop = SkScalarRound(clip.fBottom) / (big_icon_size_ + kSpacer);
SkRect download_rect;
for (int i = row_start; i <= row_stop; ++i) {
- int y = i * (download_util::kBigProgressIconSize + kSpacer) + kSpacer;
+ int y = i * (big_icon_size_ + kSpacer) + kSpacer;
if (HasFloatingViewForPoint(0, y))
continue;
download_rect.set(SkIntToScalar(0),
SkIntToScalar(y),
SkIntToScalar(width()),
- SkIntToScalar(y + download_util::kBigProgressIconSize));
+ SkIntToScalar(y + big_icon_size_));
if (SkRect::Intersects(clip, download_rect)) {
// The DownloadManager stores downloads earliest first, but this
// view displays latest first, so adjust the index:
int index = static_cast<int>(downloads_.size()) - 1 - i;
download_renderer_.SetModel(downloads_[index], this);
PaintFloatingView(canvas, &download_renderer_,
- 0, y,
- width(), download_util::kBigProgressIconSize);
+ 0, y, width(), big_icon_size_);
}
}
}
@@ -878,15 +888,13 @@ void DownloadTabView::Paint(ChromeCanvas* canvas) {
// Draw the DownloadItemTabView for the current position.
bool DownloadTabView::GetFloatingViewIDForPoint(int x, int y, int* id) {
if (y < kSpacer ||
- y > (kSpacer + download_util::kBigProgressIconSize) *
- static_cast<int>(downloads_.size()))
+ y > (kSpacer + big_icon_size_) * static_cast<int>(downloads_.size()))
return false;
// Are we hovering over a download or the spacer? If we're over the
// download, create a floating view for it.
- if ((y - kSpacer) % (download_util::kBigProgressIconSize + kSpacer) <
- download_util::kBigProgressIconSize) {
- int row = y / (download_util::kBigProgressIconSize + kSpacer);
+ if ((y - kSpacer) % (big_icon_size_ + kSpacer) < big_icon_size_) {
+ int row = y / (big_icon_size_ + kSpacer);
*id = static_cast<int>(downloads_.size()) - 1 - row;
return true;
}
@@ -907,8 +915,8 @@ views::View* DownloadTabView::CreateFloatingViewForIndex(int index) {
AttachFloatingView(dl, index);
dl->SetModel(downloads_[index], this);
int row = static_cast<int>(downloads_.size()) - 1 - index;
- int y_pos = row * (download_util::kBigProgressIconSize + kSpacer) + kSpacer;
- dl->SetBounds(0, y_pos, width(), download_util::kBigProgressIconSize);
+ int y_pos = row * (big_icon_size_ + kSpacer) + kSpacer;
+ dl->SetBounds(0, y_pos, width(), big_icon_size_);
dl->Layout();
return dl;
}
@@ -1151,12 +1159,12 @@ bool DownloadTabView::ItemIsSelected(DownloadItem* download) {
void DownloadTabView::SchedulePaintForViewAtIndex(int index) {
int y = GetYPositionForIndex(index);
- SchedulePaint(0, y, width(), download_util::kBigProgressIconSize);
+ SchedulePaint(0, y, width(), big_icon_size_);
}
int DownloadTabView::GetYPositionForIndex(int index) {
int row = static_cast<int>(downloads_.size()) - 1 - index;
- return row * (download_util::kBigProgressIconSize + kSpacer) + kSpacer;
+ return row * (big_icon_size_ + kSpacer) + kSpacer;
}
void DownloadTabView::SetSearchText(const std::wstring& search_text) {
diff --git a/chrome/browser/views/download_tab_view.h b/chrome/browser/views/download_tab_view.h
index 1ba7433..932f5c1 100644
--- a/chrome/browser/views/download_tab_view.h
+++ b/chrome/browser/views/download_tab_view.h
@@ -157,6 +157,9 @@ class DownloadTabView : public views::View,
// The destination view's search box text has changed.
void SetSearchText(const std::wstring& search_text);
+ inline int big_icon_size() const { return big_icon_size_; }
+ inline int big_icon_offset() const { return big_icon_offset_; }
+
private:
// Creates and attaches to the view the floating view at |index|.
views::View* CreateFloatingViewForIndex(int index);
@@ -200,6 +203,10 @@ class DownloadTabView : public views::View,
// being a dangerous download.
base::hash_set<DownloadItem*> dangerous_downloads_;
+ // Cache the language specific large icon positional information.
+ int big_icon_size_;
+ int big_icon_offset_;
+
// Provide a start position for downloads with no known size.
int start_angle_;