Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Unified Diff: chrome/app/keystone_glue.mm

Issue 344002: Map update check failure to "update server not available." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/cocoa/about_window_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/keystone_glue.mm
===================================================================
--- chrome/app/keystone_glue.mm (revision 30222)
+++ chrome/app/keystone_glue.mm (working copy)
@@ -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 @@
@"KSRegistrationCheckForUpdateNotification";
NSString *KSRegistrationStatusKey = @"Status";
NSString *KSRegistrationVersionKey = @"Version";
+NSString *KSRegistrationUpdateCheckErrorKey = @"Error";
NSString *KSRegistrationStartUpdateNotification =
@"KSRegistrationStartUpdateNotification";
@@ -26,6 +29,8 @@
NSString *KSRegistrationRemoveExistingTag = @"";
#define KSRegistrationPreserveExistingTag nil
+} // namespace
+
@interface KSRegistration : NSObject
+ (id)registrationWithProductID:(NSString*)productID;
@@ -253,10 +258,10 @@
- (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 @@
- (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;
« no previous file with comments | « no previous file | chrome/browser/cocoa/about_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698