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

Unified Diff: chrome/app/keystone_glue.mm

Issue 339010: Make the About box display existing pending operations instead of firing off a new update check (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 | « chrome/app/keystone_glue.h ('k') | 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 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
« no previous file with comments | « chrome/app/keystone_glue.h ('k') | chrome/browser/cocoa/about_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698