diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-01 13:16:52 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-01 13:16:52 +0000 |
commit | a48548184b405b38c3549b7c17dd38c8147833d8 (patch) | |
tree | 73feac16a29f1e8e214123606cc2d9cb0860fd99 | |
parent | ad5ce3b352f2e8e59e39366a661e8409280f89f2 (diff) | |
download | chromium_src-a48548184b405b38c3549b7c17dd38c8147833d8.zip chromium_src-a48548184b405b38c3549b7c17dd38c8147833d8.tar.gz chromium_src-a48548184b405b38c3549b7c17dd38c8147833d8.tar.bz2 |
Pass through installer errors from Google Update to the About box.
BUG=96477
TEST=You either need to find a way to manually make the upgrade through the About box fail or get a custom Google Update that returns an error during upgrade (see Ganesh). It is also important to make sure Chromium builds still refuse to update and obviously to make sure the update process through the About box still works.
Review URL: http://codereview.chromium.org/8394042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108106 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/generated_resources.grd | 8 | ||||
-rw-r--r-- | chrome/browser/google/google_update.cc | 109 | ||||
-rw-r--r-- | chrome/browser/google/google_update.h | 26 | ||||
-rw-r--r-- | chrome/browser/ui/views/about_chrome_view.cc | 76 | ||||
-rw-r--r-- | chrome/browser/ui/views/about_chrome_view.h | 14 |
5 files changed, 164 insertions, 69 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index cbcfba7..94c53e3 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -5173,6 +5173,14 @@ Keep your key file in a safe place. You will need it to create new versions of y Prevent this page from creating additional dialogs. </message> + <!-- About box strings --> + <message name="IDS_ABOUT_BOX_ERROR_DURING_UPDATE_CHECK" desc="The error label for errors that occurred while checking for updates in the About box."> + An error occurred while checking for updates: <ph name="ERROR">$1<ex>Unable to contact Google Update</ex></ph> + </message> + <message name="IDS_ABOUT_BOX_ERROR_COCREATE_FAILED" desc="The error message for the specific case when we cannot create the Google Update component"> + Update check failed to start (error code <ph name="ERROR">$1<ex>0x80000005</ex></ph>). + </message> + <!-- "Before Unload" Dialog Box strings --> <message name="IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE" desc="Title for the 'before unload' dialog."> Confirm Navigation diff --git a/chrome/browser/google/google_update.cc b/chrome/browser/google/google_update.cc index 0403663..d55e556 100644 --- a/chrome/browser/google/google_update.cc +++ b/chrome/browser/google/google_update.cc @@ -22,7 +22,9 @@ #include "chrome/installer/util/helper.h" #include "chrome/installer/util/install_util.h" #include "content/public/browser/browser_thread.h" +#include "grit/generated_resources.h" #include "google_update_idl_i.c" +#include "ui/base/l10n/l10n_util.h" #include "views/widget/widget.h" namespace { @@ -31,32 +33,29 @@ namespace { // Returns GOOGLE_UPDATE_NO_ERROR only if the instance running is a Google // Chrome distribution installed in a standard location. GoogleUpdateErrorCode CanUpdateCurrentChrome( - const std::wstring& chrome_exe_path) { + const FilePath& chrome_exe_path) { #if !defined(GOOGLE_CHROME_BUILD) return CANNOT_UPGRADE_CHROME_IN_THIS_DIRECTORY; #else // TODO(tommi): Check if using the default distribution is always the right // thing to do. BrowserDistribution* dist = BrowserDistribution::GetDistribution(); - std::wstring user_exe_path = - installer::GetChromeInstallPath(false, dist).value(); - std::wstring machine_exe_path = - installer::GetChromeInstallPath(true, dist).value(); - std::transform(user_exe_path.begin(), user_exe_path.end(), - user_exe_path.begin(), tolower); - std::transform(machine_exe_path.begin(), machine_exe_path.end(), - machine_exe_path.begin(), tolower); - if (chrome_exe_path != user_exe_path && - chrome_exe_path != machine_exe_path ) { + FilePath user_exe_path = installer::GetChromeInstallPath(false, dist); + FilePath machine_exe_path = installer::GetChromeInstallPath(true, dist); + if (!FilePath::CompareEqualIgnoreCase(chrome_exe_path.value(), + user_exe_path.value()) && + !FilePath::CompareEqualIgnoreCase(chrome_exe_path.value(), + machine_exe_path.value())) { LOG(ERROR) << L"Google Update cannot update Chrome installed in a " - << L"non-standard location: " << chrome_exe_path.c_str() - << L". The standard location is: " << user_exe_path.c_str() - << L" or " << machine_exe_path.c_str() << L"."; + << L"non-standard location: " << chrome_exe_path.value().c_str() + << L". The standard location is: " + << user_exe_path.value().c_str() + << L" or " << machine_exe_path.value().c_str() << L"."; return CANNOT_UPGRADE_CHROME_IN_THIS_DIRECTORY; } - std::wstring app_guid = installer::GetAppGuidForUpdates( - !InstallUtil::IsPerUserInstall(chrome_exe_path.c_str())); + string16 app_guid = installer::GetAppGuidForUpdates( + !InstallUtil::IsPerUserInstall(chrome_exe_path.value().c_str())); DCHECK(!app_guid.empty()); if (GoogleUpdateSettings::GetAppUpdatePolicy(app_guid, NULL) == @@ -84,7 +83,7 @@ HRESULT CoCreateInstanceAsAdmin(REFCLSID class_id, REFIID interface_id, StringFromGUID2(class_id, class_id_as_string, arraysize(class_id_as_string)); - std::wstring elevation_moniker_name = + string16 elevation_moniker_name = base::StringPrintf(L"Elevation:Administrator!new:%ls", class_id_as_string); @@ -166,6 +165,8 @@ class GoogleUpdateJobObserver result_ = UPGRADE_ALREADY_UP_TO_DATE; break; } + case COMPLETION_CODE_ERROR: + error_message_ = text; default: { NOTREACHED(); result_ = UPGRADE_ERROR; @@ -196,17 +197,27 @@ class GoogleUpdateJobObserver // Returns which version Google Update found on the server (if a more // recent version was found). Otherwise, this will be blank. - STDMETHOD(GetVersionInfo)(std::wstring* version_string) { + STDMETHOD(GetVersionInfo)(string16* version_string) { *version_string = new_version_; return S_OK; } + // Returns the Google Update supplied error string that describes the error + // that occurred during the update check/upgrade. + STDMETHOD(GetErrorMessage)(string16* error_message) { + *error_message = error_message_; + return S_OK; + } + private: // The status/result of the Google Update operation. GoogleUpdateUpgradeResult result_; // The version string Google Update found. - std::wstring new_version_; + string16 new_version_; + + // An error message, if any. + string16 error_message_; // Allows us control the upgrade process to a small degree. After OnComplete // has been called, this object can not be used. @@ -242,21 +253,16 @@ void GoogleUpdate::CheckForUpdate(bool install_if_newer, void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, views::Widget* window, MessageLoop* main_loop) { - FilePath chrome_exe_path; - if (!PathService::Get(base::DIR_EXE, &chrome_exe_path)) + FilePath chrome_exe; + if (!PathService::Get(base::DIR_EXE, &chrome_exe)) NOTREACHED(); - std::wstring chrome_exe = chrome_exe_path.value(); - - std::transform(chrome_exe.begin(), chrome_exe.end(), - chrome_exe.begin(), tolower); - GoogleUpdateErrorCode error_code = CanUpdateCurrentChrome(chrome_exe); if (error_code != GOOGLE_UPDATE_NO_ERROR) { main_loop->PostTask( FROM_HERE, base::Bind(&GoogleUpdate::ReportResults, this, - UPGRADE_ERROR, error_code)); + UPGRADE_ERROR, error_code, string16())); return; } @@ -264,7 +270,14 @@ void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, HRESULT hr = CComObject<GoogleUpdateJobObserver>::CreateInstance(&job_observer); if (hr != S_OK) { - ReportFailure(hr, GOOGLE_UPDATE_JOB_SERVER_CREATION_FAILED, main_loop); + // Most of the error messages come straight from Google Update. This one is + // deemed worthy enough to also warrant its own error. + string16 error_code = base::StringPrintf(L"0x%x", hr); + ReportFailure( + hr, GOOGLE_UPDATE_JOB_SERVER_CREATION_FAILED, + l10n_util::GetStringFUTF16(IDS_ABOUT_BOX_ERROR_COCREATE_FAILED, + error_code), + main_loop); return; } @@ -274,7 +287,7 @@ void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, bool system_level = false; - if (InstallUtil::IsPerUserInstall(chrome_exe.c_str())) { + if (InstallUtil::IsPerUserInstall(chrome_exe.value().c_str())) { hr = on_demand.CreateInstance(CLSID_OnDemandUserAppsClass); } else { // The Update operation needs Admin privileges for writing @@ -296,11 +309,12 @@ void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, } if (hr != S_OK) { - ReportFailure(hr, GOOGLE_UPDATE_ONDEMAND_CLASS_NOT_FOUND, main_loop); + ReportFailure(hr, GOOGLE_UPDATE_ONDEMAND_CLASS_NOT_FOUND, + string16(), main_loop); return; } - std::wstring app_guid = installer::GetAppGuidForUpdates(system_level); + string16 app_guid = installer::GetAppGuidForUpdates(system_level); DCHECK(!app_guid.empty()); if (!install_if_newer) @@ -309,7 +323,8 @@ void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, hr = on_demand->Update(app_guid.c_str(), job_observer); if (hr != S_OK) { - ReportFailure(hr, GOOGLE_UPDATE_ONDEMAND_CLASS_REPORTED_ERROR, main_loop); + ReportFailure(hr, GOOGLE_UPDATE_ONDEMAND_CLASS_REPORTED_ERROR, + string16(), main_loop); return; } @@ -322,45 +337,55 @@ void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, GoogleUpdateUpgradeResult results; hr = job_observer->GetResult(&results); if (hr != S_OK) { - ReportFailure(hr, GOOGLE_UPDATE_GET_RESULT_CALL_FAILED, main_loop); + ReportFailure(hr, GOOGLE_UPDATE_GET_RESULT_CALL_FAILED, + string16(), main_loop); return; } if (results == UPGRADE_ERROR) { - ReportFailure(hr, GOOGLE_UPDATE_ERROR_UPDATING, main_loop); + string16 error_message; + job_observer->GetErrorMessage(&error_message); + ReportFailure(hr, GOOGLE_UPDATE_ERROR_UPDATING, error_message, main_loop); return; } hr = job_observer->GetVersionInfo(&version_available_); if (hr != S_OK) { - ReportFailure(hr, GOOGLE_UPDATE_GET_VERSION_INFO_FAILED, main_loop); + ReportFailure(hr, GOOGLE_UPDATE_GET_VERSION_INFO_FAILED, + string16(), main_loop); return; } main_loop->PostTask( FROM_HERE, base::Bind(&GoogleUpdate::ReportResults, this, - results, GOOGLE_UPDATE_NO_ERROR)); + results, GOOGLE_UPDATE_NO_ERROR, string16())); job_holder = NULL; on_demand = NULL; } void GoogleUpdate::ReportResults(GoogleUpdateUpgradeResult results, - GoogleUpdateErrorCode error_code) { + GoogleUpdateErrorCode error_code, + const string16& error_message) { // If we get an error, then error code must not be blank, and vice versa. DCHECK(results == UPGRADE_ERROR ? error_code != GOOGLE_UPDATE_NO_ERROR : error_code == GOOGLE_UPDATE_NO_ERROR); - if (listener_) - listener_->OnReportResults(results, error_code, version_available_); + if (listener_) { + listener_->OnReportResults( + results, error_code, error_message, version_available_); + } } -bool GoogleUpdate::ReportFailure(HRESULT hr, GoogleUpdateErrorCode error_code, +bool GoogleUpdate::ReportFailure(HRESULT hr, + GoogleUpdateErrorCode error_code, + const string16& error_message, MessageLoop* main_loop) { NOTREACHED() << "Communication with Google Update failed: " << hr - << " error: " << error_code; + << " error: " << error_code + << ", message: " << error_message.c_str(); main_loop->PostTask( FROM_HERE, base::Bind(&GoogleUpdate::ReportResults, this, - UPGRADE_ERROR, error_code)); + UPGRADE_ERROR, error_code, error_message)); return false; } diff --git a/chrome/browser/google/google_update.h b/chrome/browser/google/google_update.h index a5e59a5..791c6c7 100644 --- a/chrome/browser/google/google_update.h +++ b/chrome/browser/google/google_update.h @@ -6,10 +6,9 @@ #define CHROME_BROWSER_GOOGLE_GOOGLE_UPDATE_H_ #pragma once -#include <string> - #include "base/basictypes.h" #include "base/memory/ref_counted.h" +#include "base/string16.h" #if defined(OS_WIN) #include "google_update_idl.h" #endif @@ -67,13 +66,15 @@ class GoogleUpdateStatusListener { public: // This function is called when Google Update has finished its operation and // wants to notify us about the results. |results| represents what the end - // state is, |error_code| represents what error occurred and |version| - // specifies what new version Google Update detected (or installed). This - // value can be a blank string, if the version tag in the Update{} block - // (in Google Update's server config for Chrome) is blank. + // state is, |error_code| represents what error occurred, |error_message| is a + // string version of the same (might be blank) and |version| specifies what + // new version Google Update detected (or installed). This value can be a + // blank string, if the version tag in the Update{} block (in Google Update's + // server config for Chrome) is blank. virtual void OnReportResults(GoogleUpdateUpgradeResult results, GoogleUpdateErrorCode error_code, - const std::wstring& version) = 0; + const string16& error_message, + const string16& version) = 0; }; //////////////////////////////////////////////////////////////////////////////// @@ -114,7 +115,7 @@ class GoogleUpdate : public base::RefCountedThreadSafe<GoogleUpdate> { // listener. // Note, after this function completes, this object will have deleted itself. bool ReportFailure(HRESULT hr, GoogleUpdateErrorCode error_code, - MessageLoop* main_loop); + const string16& error_message, MessageLoop* main_loop); #endif @@ -127,15 +128,16 @@ class GoogleUpdate : public base::RefCountedThreadSafe<GoogleUpdate> { MessageLoop* main_loop); // This function reports the results of the GoogleUpdate operation to the - // listener. If results indicates an error, the error_code will indicate which - // error occurred. + // listener. If results indicates an error, the |error_code| and + // |error_message| will indicate which error occurred. // Note, after this function completes, this object will have deleted itself. void ReportResults(GoogleUpdateUpgradeResult results, - GoogleUpdateErrorCode error_code); + GoogleUpdateErrorCode error_code, + const string16& error_message); // Which version string Google Update found (if a new one was available). // Otherwise, this will be blank. - std::wstring version_available_; + string16 version_available_; // The listener who is interested in finding out the result of the operation. GoogleUpdateStatusListener* listener_; diff --git a/chrome/browser/ui/views/about_chrome_view.cc b/chrome/browser/ui/views/about_chrome_view.cc index 24b7afc..f345b5a 100644 --- a/chrome/browser/ui/views/about_chrome_view.cc +++ b/chrome/browser/ui/views/about_chrome_view.cc @@ -50,6 +50,10 @@ #include "chrome/installer/util/install_util.h" #endif // defined(OS_WIN) +// The amount of vertical space separating the error label at the bottom from +// the rest of the text. +static const int kErrorLabelVerticalSpacing = 15; // Pixels. + namespace { // These are used as placeholder text around the links in the text in the about // dialog. @@ -165,7 +169,12 @@ void AboutChromeView::Init() { // This is a text field so people can copy the version number from the dialog. version_label_ = new views::Textfield(); chrome::VersionInfo version_info; - version_label_->SetText(UTF8ToUTF16(version_info.CreateVersionString())); + { + // TODO(finnur): Need to evaluate whether we should be doing IO here. + // See issue: http://crbug.com/101699. + base::ThreadRestrictions::ScopedAllowIO allow_io; + version_label_->SetText(UTF8ToUTF16(version_info.CreateVersionString())); + } version_label_->SetReadOnly(true); version_label_->RemoveBorder(); version_label_->SetTextColor(SK_ColorBLACK); @@ -189,13 +198,13 @@ void AboutChromeView::Init() { text.find(kBeginLinkChr) < text.find(kBeginLinkOss); size_t link1 = text.find(kBeginLink); - DCHECK(link1 != std::wstring::npos); + DCHECK(link1 != string16::npos); size_t link1_end = text.find(kEndLink, link1); - DCHECK(link1_end != std::wstring::npos); + DCHECK(link1_end != string16::npos); size_t link2 = text.find(kBeginLink, link1_end); - DCHECK(link2 != std::wstring::npos); + DCHECK(link2 != string16::npos); size_t link2_end = text.find(kEndLink, link2); - DCHECK(link1_end != std::wstring::npos); + DCHECK(link1_end != string16::npos); main_label_chunk1_ = text.substr(0, link1); main_label_chunk2_ = StringSubRange(text, link1_end + kEndLinkOss.size(), @@ -267,6 +276,11 @@ void AboutChromeView::Init() { AddChildView(terms_of_service_url_); terms_of_service_url_->set_listener(this); + error_label_ = new views::Label(); + error_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); + error_label_->SetMultiLine(true); + AddChildView(error_label_); + // Add the Terms of Service line and some whitespace. height += font.GetHeight() + views::kRelatedControlVerticalSpacing; #endif @@ -327,6 +341,16 @@ void AboutChromeView::Layout() { sz.width(), main_text_label_height_); + // And the error label at the bottom of the main content. This does not fit on + // screen until EnlargeWindowSizeIfNeeded has been called (which happens when + // an error is returned from Google Update). + sz.set_height(error_label_->GetHeightForWidth(sz.width())); + error_label_->SetBounds(main_text_label_->bounds().x(), + main_text_label_->bounds().y() + + main_text_label_->height() + + kErrorLabelVerticalSpacing, + sz.width(), sz.height()); + // Get the y-coordinate of our parent so we can position the text left of the // buttons at the bottom. gfx::Rect parent_bounds = parent()->GetContentsBounds(); @@ -484,7 +508,7 @@ void AboutChromeView::ViewHierarchyChanged(bool is_add, if (!(base::win::GetVersion() == base::win::VERSION_VISTA && (base::win::OSInfo::GetInstance()->service_pack().major == 0) && !base::win::UserAccountControlIsEnabled())) { - UpdateStatus(UPGRADE_CHECK_STARTED, GOOGLE_UPDATE_NO_ERROR); + UpdateStatus(UPGRADE_CHECK_STARTED, GOOGLE_UPDATE_NO_ERROR, string16()); // CheckForUpdate(false, ...) means don't upgrade yet. google_updater_->CheckForUpdate(false, GetWidget()); } @@ -593,6 +617,7 @@ void AboutChromeView::LinkClicked(views::Link* source, int event_flags) { void AboutChromeView::OnReportResults(GoogleUpdateUpgradeResult result, GoogleUpdateErrorCode error_code, + const string16& error_message, const string16& version) { // Drop the last reference to the object so that it gets cleaned up here. google_updater_ = NULL; @@ -600,13 +625,15 @@ void AboutChromeView::OnReportResults(GoogleUpdateUpgradeResult result, // Make a note of which version Google Update is reporting is the latest // version. new_version_available_ = version; - UpdateStatus(result, error_code); + UpdateStatus(result, error_code, error_message); } + //////////////////////////////////////////////////////////////////////////////// // AboutChromeView, private: void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, - GoogleUpdateErrorCode error_code) { + GoogleUpdateErrorCode error_code, + const string16& error_message) { #if !defined(GOOGLE_CHROME_BUILD) // For Chromium builds it would show an error message. // But it looks weird because in fact there is no error, @@ -638,7 +665,7 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, DCHECK(!google_updater_); // Should have been nulled out already. google_updater_ = new GoogleUpdate(); google_updater_->set_status_listener(this); - UpdateStatus(UPGRADE_STARTED, GOOGLE_UPDATE_NO_ERROR); + UpdateStatus(UPGRADE_STARTED, GOOGLE_UPDATE_NO_ERROR, string16()); // CheckForUpdate(true,...) means perform upgrade if new version found. google_updater_->CheckForUpdate(true, GetWidget()); // TODO(seanparent): Need to see if this code needs to change to @@ -668,7 +695,7 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, (installed_version->CompareTo(*running_version) <= 0)) { UserMetrics::RecordAction( UserMetricsAction("UpgradeCheck_AlreadyUpToDate")); - std::wstring update_label_text = l10n_util::GetStringFUTF16( + string16 update_label_text = l10n_util::GetStringFUTF16( IDS_UPGRADE_ALREADY_UP_TO_DATE, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), ASCIIToUTF16(version_info.Version())); @@ -689,7 +716,7 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, else UserMetrics::RecordAction(UserMetricsAction("UpgradeCheck_Upgraded")); restart_button_visible_ = true; - const std::wstring& update_string = + const string16& update_string = UTF16ToWide(l10n_util::GetStringFUTF16( IDS_UPGRADE_SUCCESSFUL_RELAUNCH, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); @@ -697,8 +724,16 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, show_success_indicator = true; break; } - case UPGRADE_ERROR: + case UPGRADE_ERROR: { UserMetrics::RecordAction(UserMetricsAction("UpgradeCheck_Error")); + if (!error_message.empty()) { + error_label_->SetText( + l10n_util::GetStringFUTF16(IDS_ABOUT_BOX_ERROR_DURING_UPDATE_CHECK, + error_message)); + int added_height = EnlargeWindowSizeIfNeeded(); + dialog_dimensions_.set_height(dialog_dimensions_.height() + + added_height); + } restart_button_visible_ = false; if (error_code != GOOGLE_UPDATE_DISABLED_BY_POLICY) { update_label_.SetText( @@ -709,6 +744,7 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, } show_timeout_indicator = true; break; + } default: NOTREACHED(); } @@ -732,4 +768,20 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, GetDialogClientView()->UpdateDialogButtons(); } +int AboutChromeView::EnlargeWindowSizeIfNeeded() { + if (error_label_->GetText().empty()) + return 0; + + // This will enlarge the window each time the function is called, which is + // fine since we only receive status once from Google Update. + gfx::Rect window_rect = GetWidget()->GetWindowScreenBounds(); + int height = error_label_->GetHeightForWidth( + dialog_dimensions_.width() - (2 * views::kPanelHorizMargin)) + + views::kRelatedControlVerticalSpacing; + window_rect.set_height(window_rect.height() + height); + GetWidget()->SetBounds(window_rect); + + return height; +} + #endif diff --git a/chrome/browser/ui/views/about_chrome_view.h b/chrome/browser/ui/views/about_chrome_view.h index ed85ebc..b051542 100644 --- a/chrome/browser/ui/views/about_chrome_view.h +++ b/chrome/browser/ui/views/about_chrome_view.h @@ -77,14 +77,21 @@ class AboutChromeView : public views::DialogDelegateView, // Overridden from GoogleUpdateStatusListener: virtual void OnReportResults(GoogleUpdateUpgradeResult result, GoogleUpdateErrorCode error_code, - const std::wstring& version) OVERRIDE; + const string16& error_message, + const string16& version) OVERRIDE; #endif private: #if defined(OS_WIN) && !defined(USE_AURA) // Update the UI to show the status of the upgrade. void UpdateStatus(GoogleUpdateUpgradeResult result, - GoogleUpdateErrorCode error_code); + GoogleUpdateErrorCode error_code, + const string16& error_message); + + // Update the size of the window containing this view to account for more + // text being displayed (error messages, etc). Returns how many pixels the + // window was increased by (if any). + int EnlargeWindowSizeIfNeeded(); #endif Profile* profile_; @@ -102,6 +109,7 @@ class AboutChromeView : public views::DialogDelegateView, gfx::Rect open_source_url_rect_; views::Link* terms_of_service_url_; gfx::Rect terms_of_service_url_rect_; + views::Label* error_label_; // UI elements we add to the parent view. scoped_ptr<views::Throbber> throbber_; views::ImageView success_indicator_; @@ -133,7 +141,7 @@ class AboutChromeView : public views::DialogDelegateView, #endif // The version Google Update reports is available to us. - std::wstring new_version_available_; + string16 new_version_available_; // Whether text direction is left-to-right or right-to-left. bool text_direction_is_rtl_; |