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

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

Issue 3032001: Make UpgradeDetector work on the Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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/browser/cocoa/keystone_glue.h ('k') | chrome/browser/upgrade_detector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/keystone_glue.mm
===================================================================
--- chrome/browser/cocoa/keystone_glue.mm (revision 52487)
+++ chrome/browser/cocoa/keystone_glue.mm (working copy)
@@ -12,6 +12,7 @@
#import "app/l10n_util_mac.h"
#include "base/logging.h"
#include "base/mac_util.h"
+#include "base/sys_string_conversions.h"
#import "base/worker_pool_mac.h"
#include "chrome/browser/cocoa/authorization_util.h"
#include "chrome/common/chrome_constants.h"
@@ -126,6 +127,9 @@
// center.
- (void)updateStatus:(AutoupdateStatus)status version:(NSString*)version;
+// Returns the version of the currently-installed application on disk.
+- (NSString*)currentlyInstalledVersion;
+
// These three methods are used to determine the version of the application
// currently installed on disk, compare that to the currently-running version,
// decide whether any updates have been installed, and call
@@ -546,6 +550,13 @@
}
}
+- (NSString*)currentlyInstalledVersion {
+ NSString* appInfoPlistPath = [self appInfoPlistPath];
+ NSDictionary* infoPlist =
+ [NSDictionary dictionaryWithContentsOfFile:appInfoPlistPath];
+ return [infoPlist objectForKey:@"CFBundleShortVersionString"];
+}
+
// Runs on the main thread.
- (void)determineUpdateStatusAsync {
DCHECK([NSThread isMainThread]);
@@ -564,10 +575,7 @@
- (void)determineUpdateStatus {
DCHECK(![NSThread isMainThread]);
- NSString* appInfoPlistPath = [self appInfoPlistPath];
- NSDictionary* infoPlist =
- [NSDictionary dictionaryWithContentsOfFile:appInfoPlistPath];
- NSString* version = [infoPlist objectForKey:@"CFBundleShortVersionString"];
+ NSString* version = [self currentlyInstalledVersion];
[self performSelectorOnMainThread:@selector(determineUpdateStatusForVersion:)
withObject:version
@@ -898,3 +906,17 @@
}
@end // @implementation KeystoneGlue
+
+namespace keystone_glue {
+
+bool KeystoneEnabled() {
+ return [KeystoneGlue defaultKeystoneGlue] != nil;
+}
+
+string16 CurrentlyInstalledVersion() {
+ KeystoneGlue* keystoneGlue = [KeystoneGlue defaultKeystoneGlue];
+ NSString* version = [keystoneGlue currentlyInstalledVersion];
+ return base::SysNSStringToUTF16(version);
+}
+
+} // namespace keystone_glue
« no previous file with comments | « chrome/browser/cocoa/keystone_glue.h ('k') | chrome/browser/upgrade_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698