OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/views/about_chrome_view.h" | 5 #include "chrome/browser/views/about_chrome_view.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <commdlg.h> | 8 #include <commdlg.h> |
9 #endif // defined(OS_WIN) | 9 #endif // defined(OS_WIN) |
10 | 10 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 void AboutChromeView::Init() { | 149 void AboutChromeView::Init() { |
150 text_direction_is_rtl_ = base::i18n::IsRTL(); | 150 text_direction_is_rtl_ = base::i18n::IsRTL(); |
151 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 151 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
152 | 152 |
153 chrome::VersionInfo version_info; | 153 chrome::VersionInfo version_info; |
154 if (!version_info.is_valid()) { | 154 if (!version_info.is_valid()) { |
155 NOTREACHED() << L"Failed to initialize about window"; | 155 NOTREACHED() << L"Failed to initialize about window"; |
156 return; | 156 return; |
157 } | 157 } |
158 | 158 |
159 current_version_ = ASCIIToWide(version_info.Version()); | 159 current_version_ = version_info.Version(); |
160 | 160 |
161 std::string version_modifier = platform_util::GetVersionStringModifier(); | 161 std::string version_modifier = platform_util::GetVersionStringModifier(); |
162 if (!version_modifier.empty()) | 162 if (!version_modifier.empty()) |
163 version_details_ += L" " + ASCIIToWide(version_modifier); | 163 version_details_ += " " + version_modifier; |
164 | 164 |
165 #if !defined(GOOGLE_CHROME_BUILD) | 165 #if !defined(GOOGLE_CHROME_BUILD) |
166 version_details_ += L" ("; | 166 version_details_ += " ("; |
167 version_details_ += ASCIIToWide(version_info.LastChange()); | 167 version_details_ += version_info.LastChange(); |
168 version_details_ += L")"; | 168 version_details_ += ")"; |
169 #endif | 169 #endif |
170 | 170 |
171 // Views we will add to the *parent* of this dialog, since it will display | 171 // Views we will add to the *parent* of this dialog, since it will display |
172 // next to the buttons which we don't draw ourselves. | 172 // next to the buttons which we don't draw ourselves. |
173 throbber_.reset(new views::Throbber(50, true)); | 173 throbber_.reset(new views::Throbber(50, true)); |
174 throbber_->set_parent_owned(false); | 174 throbber_->set_parent_owned(false); |
175 throbber_->SetVisible(false); | 175 throbber_->SetVisible(false); |
176 | 176 |
177 SkBitmap* success_image = rb.GetBitmapNamed(IDR_UPDATE_UPTODATE); | 177 SkBitmap* success_image = rb.GetBitmapNamed(IDR_UPDATE_UPTODATE); |
178 success_indicator_.SetImage(*success_image); | 178 success_indicator_.SetImage(*success_image); |
(...skipping 24 matching lines...) Expand all Loading... |
203 // Add the dialog labels. | 203 // Add the dialog labels. |
204 about_title_label_ = new views::Label( | 204 about_title_label_ = new views::Label( |
205 l10n_util::GetString(IDS_PRODUCT_NAME)); | 205 l10n_util::GetString(IDS_PRODUCT_NAME)); |
206 about_title_label_->SetFont(ResourceBundle::GetSharedInstance().GetFont( | 206 about_title_label_->SetFont(ResourceBundle::GetSharedInstance().GetFont( |
207 ResourceBundle::BaseFont).DeriveFont(18)); | 207 ResourceBundle::BaseFont).DeriveFont(18)); |
208 about_title_label_->SetColor(SK_ColorBLACK); | 208 about_title_label_->SetColor(SK_ColorBLACK); |
209 AddChildView(about_title_label_); | 209 AddChildView(about_title_label_); |
210 | 210 |
211 // This is a text field so people can copy the version number from the dialog. | 211 // This is a text field so people can copy the version number from the dialog. |
212 version_label_ = new views::Textfield(); | 212 version_label_ = new views::Textfield(); |
213 version_label_->SetText(WideToUTF16Hack(current_version_ + version_details_)); | 213 version_label_->SetText(ASCIIToUTF16(current_version_ + version_details_)); |
214 version_label_->SetReadOnly(true); | 214 version_label_->SetReadOnly(true); |
215 version_label_->RemoveBorder(); | 215 version_label_->RemoveBorder(); |
216 version_label_->SetTextColor(SK_ColorBLACK); | 216 version_label_->SetTextColor(SK_ColorBLACK); |
217 version_label_->SetBackgroundColor(SK_ColorWHITE); | 217 version_label_->SetBackgroundColor(SK_ColorWHITE); |
218 version_label_->SetFont(ResourceBundle::GetSharedInstance().GetFont( | 218 version_label_->SetFont(ResourceBundle::GetSharedInstance().GetFont( |
219 ResourceBundle::BaseFont)); | 219 ResourceBundle::BaseFont)); |
220 AddChildView(version_label_); | 220 AddChildView(version_label_); |
221 | 221 |
222 #if defined(OS_CHROMEOS) | 222 #if defined(OS_CHROMEOS) |
223 os_version_label_ = new views::Textfield(views::Textfield::STYLE_MULTILINE); | 223 os_version_label_ = new views::Textfield(views::Textfield::STYLE_MULTILINE); |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 UserMetrics::RecordAction( | 756 UserMetrics::RecordAction( |
757 UserMetricsAction("UpgradeCheck_AlreadyUpToDate"), profile_); | 757 UserMetricsAction("UpgradeCheck_AlreadyUpToDate"), profile_); |
758 #if defined(OS_CHROMEOS) | 758 #if defined(OS_CHROMEOS) |
759 std::wstring update_label_text = | 759 std::wstring update_label_text = |
760 l10n_util::GetStringF(IDS_UPGRADE_ALREADY_UP_TO_DATE, | 760 l10n_util::GetStringF(IDS_UPGRADE_ALREADY_UP_TO_DATE, |
761 l10n_util::GetString(IDS_PRODUCT_NAME)); | 761 l10n_util::GetString(IDS_PRODUCT_NAME)); |
762 #else | 762 #else |
763 std::wstring update_label_text = | 763 std::wstring update_label_text = |
764 l10n_util::GetStringF(IDS_UPGRADE_ALREADY_UP_TO_DATE, | 764 l10n_util::GetStringF(IDS_UPGRADE_ALREADY_UP_TO_DATE, |
765 l10n_util::GetString(IDS_PRODUCT_NAME), | 765 l10n_util::GetString(IDS_PRODUCT_NAME), |
766 current_version_); | 766 ASCIIToUTF16(current_version_)); |
767 #endif | 767 #endif |
768 if (base::i18n::IsRTL()) { | 768 if (base::i18n::IsRTL()) { |
769 update_label_text.push_back( | 769 update_label_text.push_back( |
770 static_cast<wchar_t>(base::i18n::kLeftToRightMark)); | 770 static_cast<wchar_t>(base::i18n::kLeftToRightMark)); |
771 } | 771 } |
772 update_label_.SetText(update_label_text); | 772 update_label_.SetText(update_label_text); |
773 show_success_indicator = true; | 773 show_success_indicator = true; |
774 break; | 774 break; |
775 #if defined(OS_WIN) | 775 #if defined(OS_WIN) |
776 } | 776 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 View* parent = GetParent(); | 818 View* parent = GetParent(); |
819 parent->Layout(); | 819 parent->Layout(); |
820 | 820 |
821 // Check button may have appeared/disappeared. We cannot call this during | 821 // Check button may have appeared/disappeared. We cannot call this during |
822 // ViewHierarchyChanged because the |window()| pointer hasn't been set yet. | 822 // ViewHierarchyChanged because the |window()| pointer hasn't been set yet. |
823 if (window()) | 823 if (window()) |
824 GetDialogClientView()->UpdateDialogButtons(); | 824 GetDialogClientView()->UpdateDialogButtons(); |
825 } | 825 } |
826 | 826 |
827 #endif | 827 #endif |
OLD | NEW |