| Index: chrome/app/keystone_glue.mm
|
| ===================================================================
|
| --- chrome/app/keystone_glue.mm (revision 30078)
|
| +++ chrome/app/keystone_glue.mm (working copy)
|
| @@ -241,11 +241,15 @@
|
| }
|
|
|
| - (void)checkForUpdate {
|
| + DCHECK(![self asyncOperationPending]);
|
| +
|
| if (!registration_) {
|
| [self updateStatus:kAutoupdateCheckFailed version:nil];
|
| return;
|
| }
|
|
|
| + [self updateStatus:kAutoupdateChecking version:nil];
|
| +
|
| [registration_ checkForUpdate];
|
|
|
| // Upon completion, KSRegistrationCheckForUpdateNotification will be posted,
|
| @@ -271,11 +275,15 @@
|
| }
|
|
|
| - (void)installUpdate {
|
| + DCHECK(![self asyncOperationPending]);
|
| +
|
| if (!registration_) {
|
| [self updateStatus:kAutoupdateInstallFailed version:nil];
|
| return;
|
| }
|
|
|
| + [self updateStatus:kAutoupdateInstalling version:nil];
|
| +
|
| [registration_ startUpdate];
|
|
|
| // Upon completion, KSRegistrationStartUpdateNotification will be posted,
|
| @@ -391,4 +399,15 @@
|
| recentNotification_.reset(nil);
|
| }
|
|
|
| +- (AutoupdateStatus)recentStatus {
|
| + NSDictionary* dictionary = [recentNotification_ userInfo];
|
| + return static_cast<AutoupdateStatus>(
|
| + [[dictionary objectForKey:kAutoupdateStatusStatus] intValue]);
|
| +}
|
| +
|
| +- (BOOL)asyncOperationPending {
|
| + AutoupdateStatus status = [self recentStatus];
|
| + return status == kAutoupdateChecking || status == kAutoupdateInstalling;
|
| +}
|
| +
|
| @end // @implementation KeystoneGlue
|
|
|