| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/gfx/color_utils.h" | 8 #include "app/gfx/color_utils.h" |
| 9 #include "base/i18n/word_iterator.h" | 9 #include "base/i18n/word_iterator.h" |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 130 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 131 | 131 |
| 132 scoped_ptr<FileVersionInfo> version_info( | 132 scoped_ptr<FileVersionInfo> version_info( |
| 133 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); | 133 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); |
| 134 if (version_info.get() == NULL) { | 134 if (version_info.get() == NULL) { |
| 135 NOTREACHED() << L"Failed to initialize about window"; | 135 NOTREACHED() << L"Failed to initialize about window"; |
| 136 return; | 136 return; |
| 137 } | 137 } |
| 138 | 138 |
| 139 current_version_ = version_info->file_version(); | 139 current_version_ = version_info->file_version(); |
| 140 #if !defined(GOOGLE_CHROME_BUILD) | |
| 141 current_version_ += L" ("; | |
| 142 current_version_ += version_info->last_change(); | |
| 143 current_version_ += L")"; | |
| 144 #endif | |
| 145 | 140 |
| 146 string16 version_modifier = platform_util::GetVersionStringModifier(); | 141 string16 version_modifier = platform_util::GetVersionStringModifier(); |
| 147 if (version_modifier.length()) { | 142 if (version_modifier.length()) { |
| 148 current_version_ += L" "; | 143 version_details_ += L" "; |
| 149 current_version_ += UTF16ToWide(version_modifier); | 144 version_details_ += UTF16ToWide(version_modifier); |
| 150 } | 145 } |
| 151 | 146 |
| 147 #if !defined(GOOGLE_CHROME_BUILD) |
| 148 version_details_ += L" ("; |
| 149 version_details_ += version_info->last_change(); |
| 150 version_details_ += L")"; |
| 151 #endif |
| 152 |
| 152 // Views we will add to the *parent* of this dialog, since it will display | 153 // Views we will add to the *parent* of this dialog, since it will display |
| 153 // next to the buttons which we don't draw ourselves. | 154 // next to the buttons which we don't draw ourselves. |
| 154 throbber_.reset(new views::Throbber(50, true)); | 155 throbber_.reset(new views::Throbber(50, true)); |
| 155 throbber_->set_parent_owned(false); | 156 throbber_->set_parent_owned(false); |
| 156 throbber_->SetVisible(false); | 157 throbber_->SetVisible(false); |
| 157 | 158 |
| 158 SkBitmap* success_image = rb.GetBitmapNamed(IDR_UPDATE_UPTODATE); | 159 SkBitmap* success_image = rb.GetBitmapNamed(IDR_UPDATE_UPTODATE); |
| 159 success_indicator_.SetImage(*success_image); | 160 success_indicator_.SetImage(*success_image); |
| 160 success_indicator_.set_parent_owned(false); | 161 success_indicator_.set_parent_owned(false); |
| 161 | 162 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 187 // Add the dialog labels. | 188 // Add the dialog labels. |
| 188 about_title_label_ = new views::Label( | 189 about_title_label_ = new views::Label( |
| 189 l10n_util::GetString(IDS_PRODUCT_NAME)); | 190 l10n_util::GetString(IDS_PRODUCT_NAME)); |
| 190 about_title_label_->SetFont(ResourceBundle::GetSharedInstance().GetFont( | 191 about_title_label_->SetFont(ResourceBundle::GetSharedInstance().GetFont( |
| 191 ResourceBundle::BaseFont).DeriveFont(18)); | 192 ResourceBundle::BaseFont).DeriveFont(18)); |
| 192 about_title_label_->SetColor(SK_ColorBLACK); | 193 about_title_label_->SetColor(SK_ColorBLACK); |
| 193 AddChildView(about_title_label_); | 194 AddChildView(about_title_label_); |
| 194 | 195 |
| 195 // This is a text field so people can copy the version number from the dialog. | 196 // This is a text field so people can copy the version number from the dialog. |
| 196 version_label_ = new views::Textfield(); | 197 version_label_ = new views::Textfield(); |
| 197 version_label_->SetText(WideToUTF16Hack(current_version_)); | 198 version_label_->SetText(WideToUTF16Hack(current_version_ + version_details_)); |
| 198 version_label_->SetReadOnly(true); | 199 version_label_->SetReadOnly(true); |
| 199 version_label_->RemoveBorder(); | 200 version_label_->RemoveBorder(); |
| 200 version_label_->SetTextColor(SK_ColorBLACK); | 201 version_label_->SetTextColor(SK_ColorBLACK); |
| 201 version_label_->SetBackgroundColor(SK_ColorWHITE); | 202 version_label_->SetBackgroundColor(SK_ColorWHITE); |
| 202 version_label_->SetFont(ResourceBundle::GetSharedInstance().GetFont( | 203 version_label_->SetFont(ResourceBundle::GetSharedInstance().GetFont( |
| 203 ResourceBundle::BaseFont)); | 204 ResourceBundle::BaseFont)); |
| 204 AddChildView(version_label_); | 205 AddChildView(version_label_); |
| 205 | 206 |
| 206 #if defined(OS_CHROMEOS) | 207 #if defined(OS_CHROMEOS) |
| 207 os_version_label_ = new views::Textfield(); | 208 os_version_label_ = new views::Textfield(); |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 View* parent = GetParent(); | 911 View* parent = GetParent(); |
| 911 parent->Layout(); | 912 parent->Layout(); |
| 912 | 913 |
| 913 // Check button may have appeared/disappeared. We cannot call this during | 914 // Check button may have appeared/disappeared. We cannot call this during |
| 914 // ViewHierarchyChanged because the |window()| pointer hasn't been set yet. | 915 // ViewHierarchyChanged because the |window()| pointer hasn't been set yet. |
| 915 if (window()) | 916 if (window()) |
| 916 GetDialogClientView()->UpdateDialogButtons(); | 917 GetDialogClientView()->UpdateDialogButtons(); |
| 917 } | 918 } |
| 918 | 919 |
| 919 #endif | 920 #endif |
| OLD | NEW |