Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Unified Diff: chrome/browser/ui/views/about_chrome_view.cc

Issue 7489036: Unify the version string to be displayed on "About Chromium" dialog. (3/6) (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/about_chrome_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/about_chrome_view.cc
diff --git a/chrome/browser/ui/views/about_chrome_view.cc b/chrome/browser/ui/views/about_chrome_view.cc
index c67f01ae19e073ee6fbdb2302a01f9889a8968fd..89c80554b276a9f73da4465d244c2b80b22015c3 100644
--- a/chrome/browser/ui/views/about_chrome_view.cc
+++ b/chrome/browser/ui/views/about_chrome_view.cc
@@ -94,7 +94,6 @@ AboutChromeView::AboutChromeView(Profile* profile)
about_dlg_background_logo_(NULL),
about_title_label_(NULL),
version_label_(NULL),
- os_version_label_(NULL),
copyright_label_(NULL),
main_text_label_(NULL),
main_text_label_height_(0),
@@ -132,32 +131,6 @@ void AboutChromeView::Init() {
text_direction_is_rtl_ = base::i18n::IsRTL();
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- chrome::VersionInfo version_info;
- if (!version_info.is_valid()) {
- NOTREACHED() << L"Failed to initialize about window";
- return;
- }
-
- current_version_ = version_info.Version();
-
- // This code only runs as a result of the user opening the About box so
- // doing registry access to get the version string modifier should be fine.
- base::ThreadRestrictions::ScopedAllowIO allow_io;
- std::string version_modifier =
- chrome::VersionInfo::GetVersionStringModifier();
- if (!version_modifier.empty())
- version_details_ += ASCIIToUTF16(" ") + ASCIIToUTF16(version_modifier);
-
-#if !defined(GOOGLE_CHROME_BUILD)
- version_details_ += ASCIIToUTF16(" (");
- version_details_ += l10n_util::GetStringUTF16(
- version_info.IsOfficialBuild() ?
- IDS_ABOUT_VERSION_OFFICIAL : IDS_ABOUT_VERSION_UNOFFICIAL);
- version_details_ += ASCIIToUTF16(" ");
- version_details_ += ASCIIToUTF16(version_info.LastChange());
- version_details_ += ASCIIToUTF16(")");
-#endif
-
// Views we will add to the *parent* of this dialog, since it will display
// next to the buttons which we don't draw ourselves.
throbber_.reset(new views::Throbber(50, true));
@@ -200,7 +173,8 @@ void AboutChromeView::Init() {
// This is a text field so people can copy the version number from the dialog.
version_label_ = new views::Textfield();
- version_label_->SetText(ASCIIToUTF16(current_version_) + version_details_);
+ chrome::VersionInfo version_info;
+ version_label_->SetText(UTF8ToUTF16(version_info.CreateVersionString()));
version_label_->SetReadOnly(true);
version_label_->RemoveBorder();
version_label_->SetTextColor(SK_ColorBLACK);
@@ -209,16 +183,6 @@ void AboutChromeView::Init() {
ResourceBundle::BaseFont));
AddChildView(version_label_);
- os_version_label_ = new views::Textfield();
- os_version_label_->SetText(UTF8ToUTF16(version_info.OSType()));
- os_version_label_->SetReadOnly(true);
- os_version_label_->RemoveBorder();
- os_version_label_->SetTextColor(SK_ColorBLACK);
- os_version_label_->SetBackgroundColor(SK_ColorWHITE);
- os_version_label_->SetFont(ResourceBundle::GetSharedInstance().GetFont(
- ResourceBundle::BaseFont));
- AddChildView(os_version_label_);
-
// The copyright URL portion of the main label.
copyright_label_ = new views::Label(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_COPYRIGHT)));
@@ -347,17 +311,6 @@ void AboutChromeView::Layout() {
about_dlg_background_logo_->width(),
sz.height());
- // Then we have the version number right below it.
- sz = os_version_label_->GetPreferredSize();
- os_version_label_->SetBounds(
- views::kPanelHorizMargin,
- version_label_->y() +
- version_label_->height() +
- views::kRelatedControlVerticalSpacing,
- panel_size.width() -
- about_dlg_background_logo_->width(),
- sz.height());
-
// 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 + views::kRelatedControlVerticalSpacing;
@@ -709,6 +662,7 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result,
// into the next case of UPGRADE_SUCCESSFUL.
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
base::ThreadRestrictions::ScopedAllowIO allow_io;
+ chrome::VersionInfo version_info;
scoped_ptr<Version> installed_version(
InstallUtil::GetChromeVersion(dist, false));
if (!installed_version.get()) {
@@ -716,7 +670,7 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result,
installed_version.reset(InstallUtil::GetChromeVersion(dist, true));
}
scoped_ptr<Version> running_version(
- Version::GetVersionFromString(current_version_));
+ Version::GetVersionFromString(version_info.Version()));
if (!installed_version.get() ||
(installed_version->CompareTo(*running_version) <= 0)) {
UserMetrics::RecordAction(
@@ -724,7 +678,7 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result,
std::wstring update_label_text = l10n_util::GetStringFUTF16(
IDS_UPGRADE_ALREADY_UP_TO_DATE,
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
- ASCIIToUTF16(current_version_));
+ ASCIIToUTF16(version_info.Version()));
if (base::i18n::IsRTL()) {
update_label_text.push_back(
static_cast<wchar_t>(base::i18n::kLeftToRightMark));
« no previous file with comments | « chrome/browser/ui/views/about_chrome_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698