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

Unified Diff: chrome/browser/cocoa/about_window_controller.mm

Issue 333049: Make KeystoneGlue less antisocial (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_unittest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/about_window_controller.mm
===================================================================
--- chrome/browser/cocoa/about_window_controller.mm (revision 30194)
+++ chrome/browser/cocoa/about_window_controller.mm (working copy)
@@ -96,6 +96,15 @@
[super dealloc];
}
+// YES when an About box is currently showing the kAutoupdateInstallFailed
+// status, or if no About box is visible, if the most recent About box to be
+// closed was closed while showing this status. When an About box opens, if
+// the recent status is kAutoupdateInstallFailed and
+// recentShownInstallFailedStatus is NO, the failure needs to be shown instead
+// of launching a new update check. recentShownInstallFailedStatus is
+// maintained by -updateStatus:.
+static BOOL recentShownInstallFailedStatus = NO;
+
- (void)awakeFromNib {
NSBundle* bundle = mac_util::MainAppBundle();
NSString* chromeVersion =
@@ -142,7 +151,8 @@
CGFloat updateShift;
if (keystoneGlue) {
if ([keystoneGlue asyncOperationPending] ||
- [keystoneGlue recentStatus] == kAutoupdateInstallFailed) {
+ ([keystoneGlue recentStatus] == kAutoupdateInstallFailed &&
+ !recentShownInstallFailedStatus)) {
// If an asynchronous update operation is currently pending, such as a
// check for updates or an update installation attempt, set the status
// up correspondingly without launching a new update check.
@@ -235,6 +245,8 @@
}
- (void)updateStatus:(NSNotification*)notification {
+ recentShownInstallFailedStatus = NO;
+
NSDictionary* dictionary = [notification userInfo];
AutoupdateStatus status = static_cast<AutoupdateStatus>(
[[dictionary objectForKey:kAutoupdateStatusStatus] intValue]);
@@ -271,7 +283,7 @@
break;
case kAutoupdateInstalling:
- // Don't let someone click "Update Now" twice.
+ // Don't let anyone click "Update Now" twice.
[updateNowButton_ setEnabled:NO];
throbber = true;
@@ -303,11 +315,7 @@
break;
case kAutoupdateInstallFailed:
- // Since the installation failure will now be displayed in an About box,
- // the saved state can be cleared. If the About box is closed and then
- // reopened, this will let it start out with a clean slate and not be
- // affected by past failures.
- [[KeystoneGlue defaultKeystoneGlue] clearRecentNotification];
+ recentShownInstallFailedStatus = YES;
// Allow another chance.
[updateNowButton_ setEnabled:YES];
« no previous file with comments | « chrome/app/keystone_glue_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698