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

Unified Diff: chrome/browser/web_applications/web_app_mac.mm

Issue 1016543004: [Mac] Use the app's version as the app shim bundle version. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use GetVersionForDisplay. Created 5 years, 9 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/web_applications/web_app.cc ('k') | chrome/browser/web_applications/web_app_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_applications/web_app_mac.mm
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
index a24d95631f6cf301138b2f7116f699787d4f150e..5c04775cd1eba2e971ef131c58fe8918d622fecc 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -500,8 +500,13 @@ web_app::ShortcutInfo BuildShortcutInfoFromBundle(
web_app::ShortcutInfo RecordAppShimErrorAndBuildShortcutInfo(
const base::FilePath& bundle_path) {
NSDictionary* plist = ReadPlist(GetPlistPath(bundle_path));
- base::Version full_version(base::SysNSStringToUTF8(
- [plist valueForKey:app_mode::kCFBundleShortVersionStringKey]));
+ NSString* version_string = [plist valueForKey:app_mode::kCrBundleVersionKey];
+ if (!version_string) {
+ // Older bundles have the Chrome version in the following key.
+ version_string =
+ [plist valueForKey:app_mode::kCFBundleShortVersionStringKey];
+ }
+ base::Version full_version(base::SysNSStringToUTF8(version_string));
uint32_t major_version = 0;
if (full_version.IsValid())
major_version = full_version.components()[0];
@@ -840,6 +845,10 @@ bool WebAppShortcutCreator::UpdatePlist(const base::FilePath& app_path) const {
}
// 2. Fill in other values.
+ [plist setObject:base::SysUTF8ToNSString(chrome::VersionInfo().Version())
+ forKey:app_mode::kCrBundleVersionKey];
+ [plist setObject:base::SysUTF8ToNSString(info_.version_for_display)
+ forKey:app_mode::kCFBundleShortVersionStringKey];
[plist setObject:base::SysUTF8ToNSString(GetBundleIdentifier())
forKey:base::mac::CFToNSCast(kCFBundleIdentifierKey)];
[plist setObject:base::mac::FilePathToNSString(app_data_dir_)
« no previous file with comments | « chrome/browser/web_applications/web_app.cc ('k') | chrome/browser/web_applications/web_app_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698