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

Unified Diff: chrome/common/mac/app_mode_chrome_locator.mm

Issue 501303002: [Mac] Make app shims load the same framework version as the running Chrome process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a comment. Created 6 years, 4 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
Index: chrome/common/mac/app_mode_chrome_locator.mm
diff --git a/chrome/common/mac/app_mode_chrome_locator.mm b/chrome/common/mac/app_mode_chrome_locator.mm
index 3cd5302cc46cf9b1b8679c84026230719484aa94..7fffebaac7d1c8e3a4c087a9eb1df0204d55c95d 100644
--- a/chrome/common/mac/app_mode_chrome_locator.mm
+++ b/chrome/common/mac/app_mode_chrome_locator.mm
@@ -25,8 +25,8 @@ bool FindBundleById(NSString* bundle_id, base::FilePath* out_bundle) {
}
bool GetChromeBundleInfo(const base::FilePath& chrome_bundle,
+ const std::string& version_str,
base::FilePath* executable_path,
- base::string16* raw_version_str,
base::FilePath* version_path,
base::FilePath* framework_shlib_path) {
using base::mac::ObjCCast;
@@ -37,12 +37,16 @@ bool GetChromeBundleInfo(const base::FilePath& chrome_bundle,
if (!cr_bundle)
return false;
- // Read raw version string.
- NSString* cr_version =
- ObjCCast<NSString>(
- [cr_bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]);
- if (!cr_version)
- return false;
+ // Read version string.
+ NSString* cr_version;
+ if (version_str.empty()) {
+ cr_version = ObjCCast<NSString>(
+ [cr_bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]);
+ if (!cr_version)
+ return false;
+ } else {
+ cr_version = base::SysUTF8ToNSString(version_str);
+ }
// Get versioned directory.
NSArray* cr_versioned_path_components =
@@ -90,7 +94,6 @@ bool GetChromeBundleInfo(const base::FilePath& chrome_bundle,
// Everything OK, copy output parameters.
*executable_path = base::mac::NSStringToFilePath([cr_bundle executablePath]);
- *raw_version_str = base::SysNSStringToUTF16(cr_version);
*version_path = base::mac::NSStringToFilePath(cr_versioned_path);
*framework_shlib_path =
base::mac::NSStringToFilePath(cr_framework_shlib_path);

Powered by Google App Engine
This is Rietveld 408576698