diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-02 22:53:04 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-02 22:53:04 +0000 |
commit | 5fcd5b10402e4e32d7849aca0a57805fed72ec83 (patch) | |
tree | aa6dd87cd8e34afe72ccf28bdfcae0d94c4acb83 /chrome | |
parent | 2ed5a95cfd474e43bd4b144f4b90bca752d6da9d (diff) | |
download | chromium_src-5fcd5b10402e4e32d7849aca0a57805fed72ec83.zip chromium_src-5fcd5b10402e4e32d7849aca0a57805fed72ec83.tar.gz chromium_src-5fcd5b10402e4e32d7849aca0a57805fed72ec83.tar.bz2 |
Add Flash EULA to about box on Windows/Views (for branded builds).
BUG=none
TEST=On Chromium, about box should be the same as before. On Google Chrome, about box should have "Adobe Flash Player License Agreement" below the Google Te rms of Service, with "License Agreement" an appropriate link.
Review URL: http://codereview.chromium.org/1561010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43545 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/views/about_chrome_view.cc | 51 | ||||
-rw-r--r-- | chrome/browser/views/about_chrome_view.h | 4 |
2 files changed, 50 insertions, 5 deletions
diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc index a698d21..25f944c 100644 --- a/chrome/browser/views/about_chrome_view.cc +++ b/chrome/browser/views/about_chrome_view.cc @@ -97,6 +97,7 @@ AboutChromeView::AboutChromeView(Profile* profile) chromium_url_(NULL), open_source_url_(NULL), terms_of_service_url_(NULL), + adobe_flash_eula_url_(NULL), check_button_status_(CHECKBUTTON_HIDDEN), chromium_url_appears_first_(true), text_direction_is_rtl_(false) { @@ -287,6 +288,7 @@ void AboutChromeView::Init() { kRelatedControlVerticalSpacing; #if defined(GOOGLE_CHROME_BUILD) + // Google Terms of Service. std::vector<size_t> url_offsets; text = l10n_util::GetStringF(IDS_ABOUT_TERMS_OF_SERVICE, std::wstring(), @@ -302,9 +304,28 @@ void AboutChromeView::Init() { AddChildView(terms_of_service_url_); terms_of_service_url_->SetController(this); - // Add the Terms of Service line and some whitespace. + // Add the Terms of Service line. + height += font.height(); + + // Adobe Flash Player EULA. + std::vector<size_t> flash_eula_url_offsets; + text = l10n_util::GetStringF(IDS_ABOUT_FLASH_EULA, + std::wstring(), + std::wstring(), + &flash_eula_url_offsets); + + main_label_chunk6_ = text.substr(0, flash_eula_url_offsets[0]); + main_label_chunk7_ = text.substr(flash_eula_url_offsets[0]); + + // The Flash EULA URL. + adobe_flash_eula_url_ = + new views::Link(l10n_util::GetString(IDS_FLASH_EULA)); + AddChildView(adobe_flash_eula_url_); + adobe_flash_eula_url_->SetController(this); + + // Add the Flash EULA line and some whitespace. height += font.height() + kRelatedControlVerticalSpacing; -#endif +#endif // GOOGLE_CHROME_BUILD // Use whichever is greater (the calculated height or the specified minimum // height). @@ -454,7 +475,7 @@ void AboutChromeView::Paint(gfx::Canvas* canvas) { position.set_width(0); position.Enlarge(0, font.height() + kRelatedControlVerticalSpacing); - // And now the Terms of Service and position the TOS url. + // Now the Google Terms of Service and position the TOS url. DrawTextAndPositionUrl(canvas, main_label_chunk4_, terms_of_service_url_, &terms_of_service_url_rect_, &position, label_bounds, font); @@ -467,7 +488,25 @@ void AboutChromeView::Paint(gfx::Canvas* canvas) { terms_of_service_url_rect_.y(), terms_of_service_url_rect_.width(), terms_of_service_url_rect_.height()); -#endif + + // Insert a line break. + position.set_width(0); + position.Enlarge(0, font.height()); + + // And now the Flash EULA and position the its url. + DrawTextAndPositionUrl(canvas, main_label_chunk6_, adobe_flash_eula_url_, + &adobe_flash_eula_url_rect_, &position, label_bounds, + font); + // The last text chunk doesn't have a URL associated with it. + DrawTextAndPositionUrl(canvas, main_label_chunk7_, NULL, NULL, &position, + label_bounds, font); + + // Position the EULA URL within the main label. + adobe_flash_eula_url_->SetBounds(adobe_flash_eula_url_rect_.x(), + adobe_flash_eula_url_rect_.y(), + adobe_flash_eula_url_rect_.width(), + adobe_flash_eula_url_rect_.height()); +#endif // GOOGLE_CHROME_BUILD // Position the URLs within the main label. First position the Chromium URL // within the main label. @@ -772,8 +811,10 @@ void AboutChromeView::LinkActivated(views::Link* source, GURL url; if (source == terms_of_service_url_) url = GURL(chrome::kAboutTermsURL); + else if (source == adobe_flash_eula_url_) + url = GURL(l10n_util::GetStringUTF16(IDS_FLASH_EULA_URL)); else if (source == chromium_url_) - url = GURL(WideToUTF16Hack(l10n_util::GetString(IDS_CHROMIUM_PROJECT_URL))); + url = GURL(l10n_util::GetStringUTF16(IDS_CHROMIUM_PROJECT_URL)); else if (source == open_source_url_) url = GURL(chrome::kAboutCreditsURL); else diff --git a/chrome/browser/views/about_chrome_view.h b/chrome/browser/views/about_chrome_view.h index 62b9da6..1250913 100644 --- a/chrome/browser/views/about_chrome_view.h +++ b/chrome/browser/views/about_chrome_view.h @@ -157,6 +157,8 @@ class AboutChromeView : public views::View, gfx::Rect open_source_url_rect_; views::Link* terms_of_service_url_; gfx::Rect terms_of_service_url_rect_; + views::Link* adobe_flash_eula_url_; + gfx::Rect adobe_flash_eula_url_rect_; // UI elements we add to the parent view. scoped_ptr<views::Throbber> throbber_; views::ImageView success_indicator_; @@ -178,6 +180,8 @@ class AboutChromeView : public views::View, std::wstring main_label_chunk3_; std::wstring main_label_chunk4_; std::wstring main_label_chunk5_; + std::wstring main_label_chunk6_; + std::wstring main_label_chunk7_; // Determines the order of the two links we draw in the main label. bool chromium_url_appears_first_; |