diff options
47 files changed, 289 insertions, 74 deletions
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd index 0d11f77..7385be7 100644 --- a/chrome/app/chromium_strings.grd +++ b/chrome/app/chromium_strings.grd @@ -92,6 +92,18 @@ be available for now. --> <message name="IDS_ABOUT_VERSION_COPYRIGHT" desc="Copyright information on the about pages"> Copyright © 2006-2008 The Chromium Authors. All Rights Reserved. </message> + <message name="IDS_ABOUT_VERSION_LICENSE" desc="The label below the copyright message, containing the URLs. Do not change the order of the links when translating."> + Chromium is made possible by the <ph name="PROJECT_LINK">$1<ex>Chromium</ex></ph> open source project and other <ph name="OPEN_SOURCE_LINK">$2<ex>open source</ex> software</ph>. + </message> + <message name="IDS_ABOUT_OPEN_SOURCE_SOFTWARE" desc="The link text on the About box that links to open source software. Used in IDS_ABOUT_VERSION_LICENSE."> + open source + </message> + <message name="IDS_ABOUT_TERMS_OF_SERVICE" desc="The terms of service label in the About box."> + Chromium <ph name="TERMS_OF_SERVICE_LINK">$1<ex>Terms of Service</ex></ph>. + </message> + <message name="IDS_TERMS_OF_SERVICE" desc="The Terms of Service link text in the About box. Used in IDS_ABOUT_TERMS_OF_SERVICE."> + Terms of Service + </message> <message name="IDS_ACCNAME_APP" desc="The accessible name for the app menu."> Chromium </message> diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index e1fcb36..4ac4e2c 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -1506,9 +1506,6 @@ each locale. --> <message name="IDS_ABOUT_VERSION_UNOFFICIAL" desc="unofficial build on the about:version page"> Developer Build </message> - <message name="IDS_ABOUT_VERSION_LICENSE" desc="The line that shows the license text (what appears in front of the URL)"> - Portions of this software were licensed from third parties as described at: - </message> <!-- Javascript Dialog Box strings --> <message name="IDS_JAVASCRIPT_MESSAGEBOX_DEFAULT_TITLE" desc="Title for Javascript alert, prompt, and confirm if there is no hostname to display"> diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd index 854eb77..32b3ac0 100644 --- a/chrome/app/google_chrome_strings.grd +++ b/chrome/app/google_chrome_strings.grd @@ -131,6 +131,18 @@ Chrome supports. --> <message name="IDS_ABOUT_VERSION_COPYRIGHT" desc="Copyright information on the about pages"> Copyright © 2006-2008 Google Inc. All Rights Reserved. </message> + <message name="IDS_ABOUT_VERSION_LICENSE" desc="The label below the copyright message, containing the URLs. Do not change the order of the links when translating."> + Google Chrome is made possible by the <ph name="PROJECT_LINK">$1<ex>Chromium</ex></ph> open source project and other <ph name="OPEN_SOURCE_LINK">$2<ex>open source</ex> software</ph>. + </message> + <message name="IDS_ABOUT_OPEN_SOURCE_SOFTWARE" desc="The link text on the About box that links to open source software. Used in IDS_ABOUT_VERSION_LICENSE."> + open source + </message> + <message name="IDS_ABOUT_TERMS_OF_SERVICE" desc="The terms of service label in the About box."> + Google Chrome <ph name="TERMS_OF_SERVICE_LINK">$1<ex>Terms of Service</ex></ph>. + </message> + <message name="IDS_TERMS_OF_SERVICE" desc="The Terms of Service link text in the About box. Used in IDS_ABOUT_TERMS_OF_SERVICE."> + Terms of Service + </message> <message name="IDS_ACCNAME_APP" desc="The accessible name for the app menu."> Chrome </message> diff --git a/chrome/app/resources/locale_settings_ar.rc b/chrome/app/resources/locale_settings_ar.rc index 6d6a801..6b360d7 100644 --- a/chrome/app/resources/locale_settings_ar.rc +++ b/chrome/app/resources/locale_settings_ar.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/ar/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=ar" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=ar" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 ad7d161..66e4ea4 100644 --- a/chrome/app/resources/locale_settings_bg.rc +++ b/chrome/app/resources/locale_settings_bg.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/bg/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=bg" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=bg" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 e31e8ad..d617eaed 100644 --- a/chrome/app/resources/locale_settings_ca.rc +++ b/chrome/app/resources/locale_settings_ca.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/ca/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=ca" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=ca" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 a53a564..e2712c6 100644 --- a/chrome/app/resources/locale_settings_cs.rc +++ b/chrome/app/resources/locale_settings_cs.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/cs/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=cs" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=cs" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 c74b0a2..a212934 100644 --- a/chrome/app/resources/locale_settings_da.rc +++ b/chrome/app/resources/locale_settings_da.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/da/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=da" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=da" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 6491a43..1192fa4 100644 --- a/chrome/app/resources/locale_settings_de.rc +++ b/chrome/app/resources/locale_settings_de.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/de/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=de" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=de" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 7ffd652..f38d0f1 100644 --- a/chrome/app/resources/locale_settings_el.rc +++ b/chrome/app/resources/locale_settings_el.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/el/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=el" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=el" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 39813b4..9131451 100644 --- a/chrome/app/resources/locale_settings_en-GB.rc +++ b/chrome/app/resources/locale_settings_en-GB.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/en-GB/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=en-GB" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=en-GB" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 e58934f..7cc2fd1 100644 --- a/chrome/app/resources/locale_settings_en-US.rc +++ b/chrome/app/resources/locale_settings_en-US.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/en-US/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=en-US" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=en-US" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 2501d56..89fe217 100644 --- a/chrome/app/resources/locale_settings_es-419.rc +++ b/chrome/app/resources/locale_settings_es-419.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/es-419/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=es-419" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=es-419" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 2d23c02..a711073 100644 --- a/chrome/app/resources/locale_settings_es.rc +++ b/chrome/app/resources/locale_settings_es.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/es/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=es" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=es" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 b5e8f5a..4524a94 100644 --- a/chrome/app/resources/locale_settings_et.rc +++ b/chrome/app/resources/locale_settings_et.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/et/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=et" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=et" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 346d020..c934ffe 100644 --- a/chrome/app/resources/locale_settings_fi.rc +++ b/chrome/app/resources/locale_settings_fi.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/fi/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=fi" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=fi" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 e5ea86b..0c6f9f2 100644 --- a/chrome/app/resources/locale_settings_fil.rc +++ b/chrome/app/resources/locale_settings_fil.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/fil/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=fil" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=fil" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 adc40dd..ee93fb4 100644 --- a/chrome/app/resources/locale_settings_fr.rc +++ b/chrome/app/resources/locale_settings_fr.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/fr/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=fr" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=fr" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 504f91c..c0263c8 100644 --- a/chrome/app/resources/locale_settings_he.rc +++ b/chrome/app/resources/locale_settings_he.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/he/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=he" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=he" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 99fdc2464..7b622e0 100644 --- a/chrome/app/resources/locale_settings_hi.rc +++ b/chrome/app/resources/locale_settings_hi.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/hi/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=hi" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=hi" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 07601aa..db6bc32 100644 --- a/chrome/app/resources/locale_settings_hr.rc +++ b/chrome/app/resources/locale_settings_hr.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/hr/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=hr" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=hr" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 c50c2ef..af450e6 100644 --- a/chrome/app/resources/locale_settings_hu.rc +++ b/chrome/app/resources/locale_settings_hu.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/hu/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=hu" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=hu" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 25c1b02..ed33b62 100644 --- a/chrome/app/resources/locale_settings_id.rc +++ b/chrome/app/resources/locale_settings_id.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/id/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=id" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=id" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 3c3ab42..e24b374 100644 --- a/chrome/app/resources/locale_settings_it.rc +++ b/chrome/app/resources/locale_settings_it.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/it/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=it" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=it" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 6057f5b..1a4ed92 100644 --- a/chrome/app/resources/locale_settings_ja.rc +++ b/chrome/app/resources/locale_settings_ja.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/ja/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=ja" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=ja" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 39c7369..da47922 100644 --- a/chrome/app/resources/locale_settings_ko.rc +++ b/chrome/app/resources/locale_settings_ko.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/ko/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=ko" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=ko" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 15845df..a94fbfe 100644 --- a/chrome/app/resources/locale_settings_lt.rc +++ b/chrome/app/resources/locale_settings_lt.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/lt/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=lt" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=lt" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 0ffd74d..adb51c2 100644 --- a/chrome/app/resources/locale_settings_lv.rc +++ b/chrome/app/resources/locale_settings_lv.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/lv/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=lv" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=lv" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 d8d77a4..d663aa3 100644 --- a/chrome/app/resources/locale_settings_nb.rc +++ b/chrome/app/resources/locale_settings_nb.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/no/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=nb" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=nb" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 01dfb8b..ddafe5b 100644 --- a/chrome/app/resources/locale_settings_nl.rc +++ b/chrome/app/resources/locale_settings_nl.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/nl/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=nl" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=nl" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 c81dc99..c4c466d 100644 --- a/chrome/app/resources/locale_settings_pl.rc +++ b/chrome/app/resources/locale_settings_pl.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/pl/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=pl" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=pl" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 73f0d59..41627ae 100644 --- a/chrome/app/resources/locale_settings_pt-BR.rc +++ b/chrome/app/resources/locale_settings_pt-BR.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/pt-BR/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=pt-BR" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=pt-BR" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 986432b..0f8ae7d 100644 --- a/chrome/app/resources/locale_settings_pt-PT.rc +++ b/chrome/app/resources/locale_settings_pt-PT.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/pt-PT/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=pt-PT" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=pt-PT" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 0f34d591..eca2057 100644 --- a/chrome/app/resources/locale_settings_ro.rc +++ b/chrome/app/resources/locale_settings_ro.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/ro/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=ro" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=ro" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 3819fd2..2244ce5 100644 --- a/chrome/app/resources/locale_settings_ru.rc +++ b/chrome/app/resources/locale_settings_ru.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/ru/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=ru" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=ru" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 0894d23..955693f 100644 --- a/chrome/app/resources/locale_settings_sk.rc +++ b/chrome/app/resources/locale_settings_sk.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/sk/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=sk" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=sk" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 bf000a6..6bf1d42 100644 --- a/chrome/app/resources/locale_settings_sl.rc +++ b/chrome/app/resources/locale_settings_sl.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/sl/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=sl" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=sl" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 de20915..e34c545 100644 --- a/chrome/app/resources/locale_settings_sr.rc +++ b/chrome/app/resources/locale_settings_sr.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/sr/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=sr" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=sr" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 10ce7b1..39ba173 100644 --- a/chrome/app/resources/locale_settings_sv.rc +++ b/chrome/app/resources/locale_settings_sv.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/sv/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=sv" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=sv" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 a6632df..edf7a63 100644 --- a/chrome/app/resources/locale_settings_th.rc +++ b/chrome/app/resources/locale_settings_th.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/th/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=th" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=th" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 5c1226e..c2eb103 100644 --- a/chrome/app/resources/locale_settings_tr.rc +++ b/chrome/app/resources/locale_settings_tr.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/tr/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=tr" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=tr" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 e77e2f1..d1ffd25 100644 --- a/chrome/app/resources/locale_settings_uk.rc +++ b/chrome/app/resources/locale_settings_uk.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/uk/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=uk" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=uk" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 987a239..57a9039a 100644 --- a/chrome/app/resources/locale_settings_vi.rc +++ b/chrome/app/resources/locale_settings_vi.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/vi/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=vi" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=vi" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 528dfd7..69645b1 100644 --- a/chrome/app/resources/locale_settings_zh-CN.rc +++ b/chrome/app/resources/locale_settings_zh-CN.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/zh-CN/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=zh-CN" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=zh-CN" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" 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 9a9610c..f19f34c 100644 --- a/chrome/app/resources/locale_settings_zh-TW.rc +++ b/chrome/app/resources/locale_settings_zh-TW.rc @@ -60,7 +60,6 @@ BEGIN IDS_WELCOME_PAGE_URL "http://tools.google.com/chrome/intl/zh-TW/welcome.html" IDS_LEARN_MORE_INCOGNITO_URL "http://www.google.com/support/chrome/bin/answer.py?answer=95464&hl=zh-TW" IDS_LEARN_MORE_HELPMAKECHROMEBETTER_URL "http://www.google.com/support/chrome/bin/answer.py?answer=96817&hl=zh-TW" - IDS_ABOUT_VERSION_LICENSE_URL "http://www.google.com/support/chrome/bin/answer.py?answer=100336" END #if defined(GOOGLE_CHROME_BUILD) diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc index df8f0b6..ee275d2 100644 --- a/chrome/browser/views/about_chrome_view.cc +++ b/chrome/browser/views/about_chrome_view.cc @@ -9,9 +9,11 @@ #include "base/file_version_info.h" #include "base/string_util.h" #include "base/win_util.h" +#include "base/word_iterator.h" #include "chrome/app/locales/locale_settings.h" #include "chrome/app/theme/theme_resources.h" #include "chrome/browser/browser_list.h" +#include "chrome/common/gfx/chrome_canvas.h" #include "chrome/common/gfx/color_utils.h" #include "chrome/browser/user_metrics.h" #include "chrome/browser/views/restart_message_box.h" @@ -34,6 +36,11 @@ // the version field doesn't overlap it. const int kVersionFieldWidth = 195; +// The URLs that you navigate to when clicking the links in the About dialog. +const wchar_t* const kChromiumUrl = L"http://www.chromium.org"; +const wchar_t* const kAcknowledgements = L"about:licenses"; +const wchar_t* const kTOS = L"about:terms"; + //////////////////////////////////////////////////////////////////////////////// // AboutChromeView, public: @@ -42,8 +49,12 @@ AboutChromeView::AboutChromeView(Profile* profile) about_dlg_background_(NULL), about_title_label_(NULL), version_label_(NULL), + copyright_label_(NULL), main_text_label_(NULL), - copyright_url_(NULL), + main_text_label_height_(0), + terms_of_service_url_(NULL), + chromium_url_(NULL), + open_source_url_(NULL), check_button_status_(CHECKBUTTON_HIDDEN) { DCHECK(profile); Init(); @@ -122,22 +133,52 @@ void AboutChromeView::Init() { ResourceBundle::BaseFont).DeriveFont(0, BOLD_FONTTYPE)); AddChildView(version_label_); - // Text to display at the bottom of the dialog. - std::wstring main_text = - l10n_util::GetString(IDS_ABOUT_VERSION_COMPANY_NAME) + L"\n" + - l10n_util::GetString(IDS_ABOUT_VERSION_COPYRIGHT) + L"\n" + - l10n_util::GetString(IDS_ABOUT_VERSION_LICENSE); - - main_text_label_ = new ChromeViews::Label(main_text); - main_text_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); - main_text_label_->SetMultiLine(true); - AddChildView(main_text_label_); - // The copyright URL portion of the main label. - copyright_url_ = new ChromeViews::Link( - l10n_util::GetString(IDS_ABOUT_VERSION_LICENSE_URL)); - AddChildView(copyright_url_); - copyright_url_->SetController(this); + copyright_label_ = new ChromeViews::Label( + l10n_util::GetString(IDS_ABOUT_VERSION_COPYRIGHT)); + copyright_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + AddChildView(copyright_label_); + + main_text_label_ = new ChromeViews::Label(L""); + + // Figure out what to write in the main label of the About box. + std::vector<size_t> url_offsets; + std::wstring text = l10n_util::GetStringF(IDS_ABOUT_VERSION_LICENSE, + std::wstring(), + std::wstring(), + &url_offsets); + + DCHECK(url_offsets[0] < url_offsets[1]); + main_label_chunk1_ = text.substr(0, url_offsets[0]); + main_label_chunk2_ = text.substr(url_offsets[0], + url_offsets[1] - url_offsets[0]); + main_label_chunk3_ = text.substr(url_offsets[1]); + + url_offsets.clear(); + text = l10n_util::GetStringF(IDS_ABOUT_TERMS_OF_SERVICE, + std::wstring(), + std::wstring(), + &url_offsets); + + main_label_chunk4_ = text.substr(0, url_offsets[0]); + main_label_chunk5_ = text.substr(url_offsets[0]); + + // The Chromium link within the main text of the dialog. + chromium_url_ = new ChromeViews::Link(l10n_util::GetString(IDS_PRODUCT_NAME)); + AddChildView(chromium_url_); + chromium_url_->SetController(this); + + // The Open Source link within the main text of the dialog. + open_source_url_ = new ChromeViews::Link( + l10n_util::GetString(IDS_ABOUT_OPEN_SOURCE_SOFTWARE)); + AddChildView(open_source_url_); + open_source_url_->SetController(this); + + // The Terms of Service URL at the bottom. + terms_of_service_url_ = + new ChromeViews::Link(l10n_util::GetString(IDS_TERMS_OF_SERVICE)); + AddChildView(terms_of_service_url_); + terms_of_service_url_->SetController(this); } //////////////////////////////////////////////////////////////////////////////// @@ -185,21 +226,38 @@ void AboutChromeView::Layout() { // For the width of the main text label we want to use up the whole panel // width and remaining height, minus a little margin on each side. - int y_pos = background_image_height + kPanelVertMargin; + int y_pos = background_image_height + kRelatedControlVerticalSpacing; sz.cx = panel_size.cx - 2 * kPanelHorizMargin; - sz.cy = main_text_label_->GetHeightForWidth(sz.cx); + // Draw the text right below the background image. - main_text_label_->SetBounds(kPanelHorizMargin, + copyright_label_->SetBounds(kPanelHorizMargin, y_pos, sz.cx, sz.cy); - // Position the URL right below the main label. - copyright_url_->GetPreferredSize(&sz); - copyright_url_->SetBounds(kPanelHorizMargin, - main_text_label_->y() + main_text_label_->height(), - sz.cx, - sz.cy); + // Then the main_text_label. + main_text_label_->SetBounds(kPanelHorizMargin, + copyright_label_->y() + + copyright_label_->height(), + sz.cx, + main_text_label_height_); + + // Position the URLs within the main label. The rects here are calculated when + // we draw the strings. First position the Chromium URL within the main label. + chromium_url_->SetBounds(chromium_url_rect_.x(), + chromium_url_rect_.y(), + chromium_url_rect_.width(), + chromium_url_rect_.height()); + // Then position the Open Source URL within the main label. + open_source_url_->SetBounds(open_source_url_rect_.x(), + open_source_url_rect_.y(), + open_source_url_rect_.width(), + open_source_url_rect_.height()); + // Then position the TOS URL within the main label. + terms_of_service_url_->SetBounds(terms_of_service_url_rect_.x(), + terms_of_service_url_rect_.y(), + terms_of_service_url_rect_.width(), + terms_of_service_url_rect_.height()); // Get the y-coordinate of our parent so we can position the text left of the // buttons at the bottom. @@ -240,6 +298,122 @@ void AboutChromeView::Layout() { sz.cy); } + +void AboutChromeView::Paint(ChromeCanvas* canvas) { + ChromeViews::View::Paint(canvas); + + ChromeFont font = + ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont); + + CRect bounds; + main_text_label_->GetBounds(&bounds); + + // This struct keeps track of where to write the next word (which x,y + // pixel coordinate). This struct is updated after drawing text and checking + // if we need to wrap. + CSize position; + // Draw the first text chunk and position the Chromium url. + DrawTextAndPositionUrl(canvas, main_label_chunk1_, chromium_url_, + &chromium_url_rect_, &position, bounds, font); + // Draw the second text chunk and position the Open Source url. + DrawTextAndPositionUrl(canvas, main_label_chunk2_, open_source_url_, + &open_source_url_rect_, &position, bounds, font); + // Draw the third text chunk. + DrawTextStartingFrom(canvas, main_label_chunk3_, &position, bounds, font); + + // Insert a line break and some whitespace. + position.cx = 0; + position.cy += font.height() + kRelatedControlVerticalSpacing; + + // And now the Terms of Service and position the TOS url. + DrawTextAndPositionUrl(canvas, main_label_chunk4_, terms_of_service_url_, + &terms_of_service_url_rect_, &position, bounds, font); + // The last text chunk doesn't have a URL associated with it. + DrawTextStartingFrom(canvas, main_label_chunk5_, &position, bounds, font); + + // Save the height so we can set the bounds correctly. + main_text_label_height_ = position.cy + font.height(); +} + +void AboutChromeView::DrawTextAndPositionUrl(ChromeCanvas* canvas, + const std::wstring& text, + ChromeViews::Link* link, + gfx::Rect* rect, + CSize* position, + const CRect& bounds, + const ChromeFont& font) { + DCHECK(canvas && link && rect && position); + // Draw the text chunk. + DrawTextStartingFrom(canvas, text, position, bounds, font); + + // And then position the link after it. + CSize sz; + link->GetPreferredSize(&sz); + WrapIfWordDoesntFit(sz.cx, font.height(), position, bounds); + *rect = gfx::Rect(position->cx, position->cy, sz.cx, sz.cy); + + // Going from relative to absolute pixel coordinates again. + rect->Offset(bounds.TopLeft().x, bounds.TopLeft().y); + // And leave some space to draw the link in. + position->cx += sz.cx; +} + +void AboutChromeView::DrawTextStartingFrom(ChromeCanvas* canvas, + const std::wstring& text, + CSize* position, + const CRect& bounds, + const ChromeFont& font) { + // Iterate through line breaking opportunities (which in English would be + // spaces and such. This tells us where to wrap. + WordIterator iter(text, WordIterator::BREAK_LINE); + if (!iter.Init()) + return; + + int flags = (UILayoutIsRightToLeft() ? + ChromeCanvas::TEXT_ALIGN_RIGHT : + ChromeCanvas::TEXT_ALIGN_LEFT) | + ChromeCanvas::MULTI_LINE | + ChromeCanvas::HIDE_PREFIX; + + // Iterate over each word in the text, or put in a more locale-neutral way: + // iterate to the next line breaking opportunity. + while (iter.Advance()) { + // Get the word and figure out the dimensions. + std::wstring word = iter.GetWord(); + int w = font.GetStringWidth(word), h = font.height(); + canvas->SizeStringInt(word, font, &w, &h, flags); + + // If we exceed the boundaries, we need to wrap. + WrapIfWordDoesntFit(w, font.height(), position, bounds); + + // Draw the word on the screen (mirrored if RTL locale). + canvas->DrawStringInt(word, font, SK_ColorBLACK, + main_text_label_->MirroredXCoordinateInsideView( + position->cx + bounds.TopLeft().x), + position->cy + bounds.TopLeft().y, + w, h, flags); + + if (word.size() > 0 && word[word.size() - 1] == L'\x0a') { + // When we come across '\n', we move to the beginning of the next line. + position->cx = 0; + position->cy += font.height(); + } else { + // Otherwise, we advance position to the next word. + position->cx += w; + } + } +} + +void AboutChromeView::WrapIfWordDoesntFit(int word_width, + int font_height, + CSize* position, + const CRect& bounds) { + if (position->cx + word_width > bounds.right) { + position->cx = 0; + position->cy += font_height; + } +} + void AboutChromeView::ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { @@ -366,9 +540,18 @@ ChromeViews::View* AboutChromeView::GetContentsView() { void AboutChromeView::LinkActivated(ChromeViews::Link* source, int event_flags) { - DCHECK(source == copyright_url_); + GURL url; + if (source == terms_of_service_url_) + url = GURL(kTOS); + else if (source == chromium_url_) + url = GURL(kChromiumUrl); + else if (source == open_source_url_) + url = GURL(kAcknowledgements); + else + NOTREACHED() << "Unknown link source"; + Browser* browser = BrowserList::GetLastActive(); - browser->OpenURL(GURL(source->GetText()), NEW_WINDOW, PageTransition::LINK); + browser->OpenURL(url, NEW_WINDOW, PageTransition::LINK); } //////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/views/about_chrome_view.h b/chrome/browser/views/about_chrome_view.h index 1cfd949..e74823e 100644 --- a/chrome/browser/views/about_chrome_view.h +++ b/chrome/browser/views/about_chrome_view.h @@ -41,6 +41,7 @@ class AboutChromeView : public ChromeViews::View, // Overridden from ChromeViews::View: virtual void GetPreferredSize(CSize *out); virtual void Layout(); + virtual void Paint(ChromeCanvas* canvas); virtual void ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, ChromeViews::View* child); @@ -79,14 +80,57 @@ class AboutChromeView : public ChromeViews::View, void UpdateStatus(GoogleUpdateUpgradeResult result, GoogleUpdateErrorCode error_code); + // Draws a string onto the canvas (wrapping if needed) while also keeping + // track of where it ends so we can position a URL after the text. The + // parameter |bounds| represents the boundary we have to work with, |position| + // specifies where to draw the string (relative to the top left corner of the + // |bounds| rectangle and |font| specifies the font to use when drawing. When + // the function returns, the parameter |rect| contains where to draw the URL + // (to the right of where we just drew the text) and |position| is updated to + // reflect where to draw the next string after the URL. + // NOTE: The reason why we need this function is because while Skia knows how + // to wrap text appropriately, it doesn't tell us where it drew the last + // character, which we need to position the URLs within the text. + void DrawTextAndPositionUrl(ChromeCanvas* canvas, + const std::wstring& text, + ChromeViews::Link* link, + gfx::Rect* rect, + CSize* position, + const CRect& bounds, + const ChromeFont& font); + + // A helper function for DrawTextAndPositionUrl, which simply draws the text + // from a certain starting point |position| and wraps within bounds. For + // details on the parameters, see DrawTextAndPositionUrl. + void DrawTextStartingFrom(ChromeCanvas* canvas, + const std::wstring& text, + CSize* position, + const CRect& bounds, + const ChromeFont& font); + + // A simply utility function that calculates whether a word of width + // |word_width| fits at position |position| within the |bounds| rectangle. If + // not, |position| is updated to wrap to the beginning of the next line. + void WrapIfWordDoesntFit(int word_width, + int font_height, + CSize* position, + const CRect& bounds); + Profile* profile_; // UI elements on the dialog. ChromeViews::ImageView* about_dlg_background_; ChromeViews::Label* about_title_label_; ChromeViews::TextField* version_label_; + ChromeViews::Label* copyright_label_; ChromeViews::Label* main_text_label_; - ChromeViews::Link* copyright_url_; + int main_text_label_height_; + ChromeViews::Link* chromium_url_; + gfx::Rect chromium_url_rect_; + ChromeViews::Link* open_source_url_; + gfx::Rect open_source_url_rect_; + ChromeViews::Link* terms_of_service_url_; + gfx::Rect terms_of_service_url_rect_; // UI elements we add to the parent view. scoped_ptr<ChromeViews::Throbber> throbber_; ChromeViews::ImageView success_indicator_; @@ -97,6 +141,15 @@ class AboutChromeView : public ChromeViews::View, // Keeps track of the visible state of the Check For Updates button. CheckButtonStatus check_button_status_; + // The text to display as the main label of the About box. We draw this text + // word for word with the help of the WordIterator, and make room for URLs + // which are drawn using ChromeViews::Link. See also |url_offsets_|. + std::wstring main_label_chunk1_; + std::wstring main_label_chunk2_; + std::wstring main_label_chunk3_; + std::wstring main_label_chunk4_; + std::wstring main_label_chunk5_; + // The class that communicates with Google Update to find out if an update is // available and asks it to start an upgrade. scoped_refptr<GoogleUpdate> google_updater_; @@ -107,7 +160,7 @@ class AboutChromeView : public ChromeViews::View, // The version Google Update reports is available to us. std::wstring new_version_available_; - DISALLOW_EVIL_CONSTRUCTORS(AboutChromeView); + DISALLOW_COPY_AND_ASSIGN(AboutChromeView); }; #endif // CHROME_BROWSER_VIEWS_ABOUT_CHROME_VIEW_H_ |