summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-27 20:44:57 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-27 20:44:57 +0000
commit19e0ff7bf0b74a121d52a75b1d883222d266b789 (patch)
tree961cfa651f5ff59c05d88f066d506727adb0d5bc
parent513cb2b73074f5727988ad4c4293779391abff17 (diff)
downloadchromium_src-19e0ff7bf0b74a121d52a75b1d883222d266b789.zip
chromium_src-19e0ff7bf0b74a121d52a75b1d883222d266b789.tar.gz
chromium_src-19e0ff7bf0b74a121d52a75b1d883222d266b789.tar.bz2
Map update check failure to "update server not available."
BUG=25948 TEST=With a suitably recent KSR, mess up the update server URL in the ticket, and verify that the update status line in the About box shows the gray icon with "update server not available" after attempting to check for an update. Review URL: http://codereview.chromium.org/344002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30240 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/keystone_glue.mm19
-rw-r--r--chrome/browser/cocoa/about_window_controller.mm2
2 files changed, 11 insertions, 10 deletions
diff --git a/chrome/app/keystone_glue.mm b/chrome/app/keystone_glue.mm
index 9ffaf26..120b59a 100644
--- a/chrome/app/keystone_glue.mm
+++ b/chrome/app/keystone_glue.mm
@@ -9,6 +9,8 @@
#import "base/worker_pool_mac.h"
#include "chrome/common/chrome_constants.h"
+namespace {
+
// Provide declarations of the Keystone registration bits needed here. From
// KSRegistration.h.
typedef enum { kKSPathExistenceChecker } KSExistenceCheckerType;
@@ -17,6 +19,7 @@ NSString *KSRegistrationCheckForUpdateNotification =
@"KSRegistrationCheckForUpdateNotification";
NSString *KSRegistrationStatusKey = @"Status";
NSString *KSRegistrationVersionKey = @"Version";
+NSString *KSRegistrationUpdateCheckErrorKey = @"Error";
NSString *KSRegistrationStartUpdateNotification =
@"KSRegistrationStartUpdateNotification";
@@ -26,6 +29,8 @@ NSString *KSUpdateCheckSuccessfullyInstalledKey = @"SuccessfullyInstalled";
NSString *KSRegistrationRemoveExistingTag = @"";
#define KSRegistrationPreserveExistingTag nil
+} // namespace
+
@interface KSRegistration : NSObject
+ (id)registrationWithProductID:(NSString*)productID;
@@ -253,10 +258,10 @@ static KeystoneGlue* sDefaultKeystoneGlue = nil; // leaked
- (void)checkForUpdateComplete:(NSNotification*)notification {
NSDictionary* userInfo = [notification userInfo];
- BOOL updatesAvailable =
- [[userInfo objectForKey:KSRegistrationStatusKey] boolValue];
- if (updatesAvailable) {
+ if ([[userInfo objectForKey:KSRegistrationUpdateCheckErrorKey] boolValue]) {
+ [self updateStatus:kAutoupdateCheckFailed version:nil];
+ } else if ([[userInfo objectForKey:KSRegistrationStatusKey] boolValue]) {
// If an update is known to be available, go straight to
// -updateStatus:version:. It doesn't matter what's currently on disk.
NSString* version = [userInfo objectForKey:KSRegistrationVersionKey];
@@ -287,12 +292,10 @@ static KeystoneGlue* sDefaultKeystoneGlue = nil; // leaked
- (void)installUpdateComplete:(NSNotification*)notification {
NSDictionary* userInfo = [notification userInfo];
- BOOL checkSuccessful =
- [[userInfo objectForKey:KSUpdateCheckSuccessfulKey] boolValue];
- int installs =
- [[userInfo objectForKey:KSUpdateCheckSuccessfullyInstalledKey] intValue];
- if (!checkSuccessful || !installs) {
+ if (![[userInfo objectForKey:KSUpdateCheckSuccessfulKey] boolValue] ||
+ ![[userInfo objectForKey:KSUpdateCheckSuccessfullyInstalledKey]
+ intValue]) {
[self updateStatus:kAutoupdateInstallFailed version:nil];
} else {
updateSuccessfullyInstalled_ = YES;
diff --git a/chrome/browser/cocoa/about_window_controller.mm b/chrome/browser/cocoa/about_window_controller.mm
index 00afd21..52730e7 100644
--- a/chrome/browser/cocoa/about_window_controller.mm
+++ b/chrome/browser/cocoa/about_window_controller.mm
@@ -323,8 +323,6 @@ static BOOL recentShownInstallFailedStatus = NO;
// Fall through.
case kAutoupdateCheckFailed:
- // TODO(mark): Keystone doesn't currently indicate when a check for
- // updates failed. Fix that.
imageID = IDR_UPDATE_FAIL;
message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR,
IntToString16(status));