| 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 #include <sys/sysctl.h> | 10 #include <sys/sysctl.h> |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 - (void)checkForUpdate { | 552 - (void)checkForUpdate { |
| 553 DCHECK(![self asyncOperationPending]); | 553 DCHECK(![self asyncOperationPending]); |
| 554 | 554 |
| 555 if (!registration_) { | 555 if (!registration_) { |
| 556 [self updateStatus:kAutoupdateCheckFailed version:nil]; | 556 [self updateStatus:kAutoupdateCheckFailed version:nil]; |
| 557 return; | 557 return; |
| 558 } | 558 } |
| 559 | 559 |
| 560 [self updateStatus:kAutoupdateChecking version:nil]; | 560 [self updateStatus:kAutoupdateChecking version:nil]; |
| 561 | 561 |
| 562 [registration_ checkForUpdate]; | 562 // All checks from inside Chrome are considered user-initiated, because they |
| 563 // only happen following a user action, such as visiting the about page. |
| 564 // Non-user-initiated checks are the periodic checks automatically made by |
| 565 // Keystone, which don't come through this code path (or even this process). |
| 566 [registration_ checkForUpdateWasUserInitiated:YES]; |
| 563 | 567 |
| 564 // Upon completion, ksr::KSRegistrationCheckForUpdateNotification will be | 568 // Upon completion, ksr::KSRegistrationCheckForUpdateNotification will be |
| 565 // posted, and -checkForUpdateComplete: will be called. | 569 // posted, and -checkForUpdateComplete: will be called. |
| 566 } | 570 } |
| 567 | 571 |
| 568 - (void)checkForUpdateComplete:(NSNotification*)notification { | 572 - (void)checkForUpdateComplete:(NSNotification*)notification { |
| 569 NSDictionary* userInfo = [notification userInfo]; | 573 NSDictionary* userInfo = [notification userInfo]; |
| 570 | 574 |
| 571 if ([[userInfo objectForKey:ksr::KSRegistrationUpdateCheckErrorKey] | 575 if ([[userInfo objectForKey:ksr::KSRegistrationUpdateCheckErrorKey] |
| 572 boolValue]) { | 576 boolValue]) { |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 return [KeystoneGlue defaultKeystoneGlue] != nil; | 1101 return [KeystoneGlue defaultKeystoneGlue] != nil; |
| 1098 } | 1102 } |
| 1099 | 1103 |
| 1100 base::string16 CurrentlyInstalledVersion() { | 1104 base::string16 CurrentlyInstalledVersion() { |
| 1101 KeystoneGlue* keystoneGlue = [KeystoneGlue defaultKeystoneGlue]; | 1105 KeystoneGlue* keystoneGlue = [KeystoneGlue defaultKeystoneGlue]; |
| 1102 NSString* version = [keystoneGlue currentlyInstalledVersion]; | 1106 NSString* version = [keystoneGlue currentlyInstalledVersion]; |
| 1103 return base::SysNSStringToUTF16(version); | 1107 return base::SysNSStringToUTF16(version); |
| 1104 } | 1108 } |
| 1105 | 1109 |
| 1106 } // namespace keystone_glue | 1110 } // namespace keystone_glue |
| OLD | NEW |