From 382b497b6756b4a3ba5fd6e054c06f2e6b48d624 Mon Sep 17 00:00:00 2001 From: "petkov@chromium.org" Date: Tue, 3 Aug 2010 18:52:02 +0000 Subject: Handle the REPORTING_ERROR_EVENT state appropriately. Notify the user of the error event if the user has been notified about the update progress already. Stay quiet otherwise. BUG=chromium-os:5266 TEST=unit tests Review URL: http://codereview.chromium.org/3033048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54789 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/chromeos/update_observer.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/chrome/browser/chromeos/update_observer.cc b/chrome/browser/chromeos/update_observer.cc index 1765a8a..d92b8f4 100644 --- a/chrome/browser/chromeos/update_observer.cc +++ b/chrome/browser/chromeos/update_observer.cc @@ -56,6 +56,16 @@ void UpdateObserver::UpdateStatusChanged(UpdateLibrary* library) { case UPDATE_STATUS_UPDATED_NEED_REBOOT: notification_.Show(l10n_util::GetStringUTF16(IDS_UPDATE_COMPLETED), true); break; + case UPDATE_STATUS_REPORTING_ERROR_EVENT: + // If the update engine encounters an error and we have already + // notified the user of the update progress, show an error + // notification. Don't show anything otherwise -- for example, + // in cases where the update engine encounters an error while + // checking for an update. + if (notification_.visible()) { + notification_.Show(l10n_util::GetStringUTF16(IDS_UPDATE_ERROR), true); + } + break; default: notification_.Show(l10n_util::GetStringUTF16(IDS_UPDATE_ERROR), true); break; -- cgit v1.1