| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/mac/keystone_glue.h" | 5 #import "chrome/browser/mac/keystone_glue.h" |
| 6 | 6 |
| 7 #include <sys/mount.h> | 7 #include <sys/mount.h> |
| 8 #include <sys/param.h> | 8 #include <sys/param.h> |
| 9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
| 10 | 10 |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 - (void)checkForUpdate { | 548 - (void)checkForUpdate { |
| 549 DCHECK(![self asyncOperationPending]); | 549 DCHECK(![self asyncOperationPending]); |
| 550 | 550 |
| 551 if (!registration_) { | 551 if (!registration_) { |
| 552 [self updateStatus:kAutoupdateCheckFailed version:nil]; | 552 [self updateStatus:kAutoupdateCheckFailed version:nil]; |
| 553 return; | 553 return; |
| 554 } | 554 } |
| 555 | 555 |
| 556 [self updateStatus:kAutoupdateChecking version:nil]; | 556 [self updateStatus:kAutoupdateChecking version:nil]; |
| 557 | 557 |
| 558 [registration_ checkForUpdate]; | 558 // All checks from inside Chrome are considered user-initiated, because they |
| 559 // only happen following a user action, such as visiting the about page. |
| 560 // Non-user-initiated checks are the periodic checks automatically made by |
| 561 // Keystone, which don't come through this code path (or even this process). |
| 562 [registration_ checkForUpdateWasUserInitiated:YES]; |
| 559 | 563 |
| 560 // Upon completion, ksr::KSRegistrationCheckForUpdateNotification will be | 564 // Upon completion, ksr::KSRegistrationCheckForUpdateNotification will be |
| 561 // posted, and -checkForUpdateComplete: will be called. | 565 // posted, and -checkForUpdateComplete: will be called. |
| 562 } | 566 } |
| 563 | 567 |
| 564 - (void)checkForUpdateComplete:(NSNotification*)notification { | 568 - (void)checkForUpdateComplete:(NSNotification*)notification { |
| 565 NSDictionary* userInfo = [notification userInfo]; | 569 NSDictionary* userInfo = [notification userInfo]; |
| 566 | 570 |
| 567 if ([[userInfo objectForKey:ksr::KSRegistrationUpdateCheckErrorKey] | 571 if ([[userInfo objectForKey:ksr::KSRegistrationUpdateCheckErrorKey] |
| 568 boolValue]) { | 572 boolValue]) { |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1080 return [KeystoneGlue defaultKeystoneGlue] != nil; | 1084 return [KeystoneGlue defaultKeystoneGlue] != nil; |
| 1081 } | 1085 } |
| 1082 | 1086 |
| 1083 base::string16 CurrentlyInstalledVersion() { | 1087 base::string16 CurrentlyInstalledVersion() { |
| 1084 KeystoneGlue* keystoneGlue = [KeystoneGlue defaultKeystoneGlue]; | 1088 KeystoneGlue* keystoneGlue = [KeystoneGlue defaultKeystoneGlue]; |
| 1085 NSString* version = [keystoneGlue currentlyInstalledVersion]; | 1089 NSString* version = [keystoneGlue currentlyInstalledVersion]; |
| 1086 return base::SysNSStringToUTF16(version); | 1090 return base::SysNSStringToUTF16(version); |
| 1087 } | 1091 } |
| 1088 | 1092 |
| 1089 } // namespace keystone_glue | 1093 } // namespace keystone_glue |
| OLD | NEW |