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 // All checks from inside Chrome are considered user-initiated, because they | 558 [registration_ checkForUpdate]; |
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]; | |
563 | 559 |
564 // Upon completion, ksr::KSRegistrationCheckForUpdateNotification will be | 560 // Upon completion, ksr::KSRegistrationCheckForUpdateNotification will be |
565 // posted, and -checkForUpdateComplete: will be called. | 561 // posted, and -checkForUpdateComplete: will be called. |
566 } | 562 } |
567 | 563 |
568 - (void)checkForUpdateComplete:(NSNotification*)notification { | 564 - (void)checkForUpdateComplete:(NSNotification*)notification { |
569 NSDictionary* userInfo = [notification userInfo]; | 565 NSDictionary* userInfo = [notification userInfo]; |
570 | 566 |
571 if ([[userInfo objectForKey:ksr::KSRegistrationUpdateCheckErrorKey] | 567 if ([[userInfo objectForKey:ksr::KSRegistrationUpdateCheckErrorKey] |
572 boolValue]) { | 568 boolValue]) { |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 return [KeystoneGlue defaultKeystoneGlue] != nil; | 1080 return [KeystoneGlue defaultKeystoneGlue] != nil; |
1085 } | 1081 } |
1086 | 1082 |
1087 base::string16 CurrentlyInstalledVersion() { | 1083 base::string16 CurrentlyInstalledVersion() { |
1088 KeystoneGlue* keystoneGlue = [KeystoneGlue defaultKeystoneGlue]; | 1084 KeystoneGlue* keystoneGlue = [KeystoneGlue defaultKeystoneGlue]; |
1089 NSString* version = [keystoneGlue currentlyInstalledVersion]; | 1085 NSString* version = [keystoneGlue currentlyInstalledVersion]; |
1090 return base::SysNSStringToUTF16(version); | 1086 return base::SysNSStringToUTF16(version); |
1091 } | 1087 } |
1092 | 1088 |
1093 } // namespace keystone_glue | 1089 } // namespace keystone_glue |
OLD | NEW |