summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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));