Chromium Code Reviews| 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/common/mac/app_mode_chrome_locator.h" | 5 #import "chrome/common/mac/app_mode_chrome_locator.h" |
| 6 | 6 |
| 7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
| 8 #include <CoreFoundation/CoreFoundation.h> | 8 #include <CoreFoundation/CoreFoundation.h> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 NSString* cr_versioned_path; | 47 NSString* cr_versioned_path; |
| 48 if (!version_str.empty()) { | 48 if (!version_str.empty()) { |
| 49 cr_versioned_path = | 49 cr_versioned_path = |
| 50 GetVersionedPath(cr_bundle_path, base::SysUTF8ToNSString(version_str)); | 50 GetVersionedPath(cr_bundle_path, base::SysUTF8ToNSString(version_str)); |
| 51 } | 51 } |
| 52 | 52 |
| 53 if (version_str.empty() || | 53 if (version_str.empty() || |
| 54 !base::PathExists(base::mac::NSStringToFilePath(cr_versioned_path))) { | 54 !base::PathExists(base::mac::NSStringToFilePath(cr_versioned_path))) { |
| 55 // Read version string. | 55 // Read version string. |
| 56 NSString* cr_version = ObjCCast<NSString>( | 56 NSString* cr_version = ObjCCast<NSString>( |
| 57 [cr_bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]); | 57 [cr_bundle objectForInfoDictionaryKey:@"CrBundleVersion"]); |
|
tapted
2015/03/18 01:49:59
kCrBundleVersionKey?
Although I guess that's not
jackhou1
2015/03/18 04:43:48
Done.
| |
| 58 if (!cr_version) { | |
| 59 // Older bundles have the Chrome version in the following key. | |
| 60 cr_version = ObjCCast<NSString>( | |
| 61 [cr_bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]); | |
| 62 } | |
| 58 if (!cr_version) | 63 if (!cr_version) |
| 59 return false; | 64 return false; |
| 60 | 65 |
| 61 cr_versioned_path = GetVersionedPath(cr_bundle_path, cr_version); | 66 cr_versioned_path = GetVersionedPath(cr_bundle_path, cr_version); |
| 62 } | 67 } |
| 63 | 68 |
| 64 // Get the framework path. | 69 // Get the framework path. |
| 65 NSString* cr_bundle_exe = | 70 NSString* cr_bundle_exe = |
| 66 ObjCCast<NSString>( | 71 ObjCCast<NSString>( |
| 67 [cr_bundle objectForInfoDictionaryKey:@"CFBundleExecutable"]); | 72 [cr_bundle objectForInfoDictionaryKey:@"CFBundleExecutable"]); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 97 | 102 |
| 98 // Everything OK, copy output parameters. | 103 // Everything OK, copy output parameters. |
| 99 *executable_path = base::mac::NSStringToFilePath([cr_bundle executablePath]); | 104 *executable_path = base::mac::NSStringToFilePath([cr_bundle executablePath]); |
| 100 *version_path = base::mac::NSStringToFilePath(cr_versioned_path); | 105 *version_path = base::mac::NSStringToFilePath(cr_versioned_path); |
| 101 *framework_shlib_path = | 106 *framework_shlib_path = |
| 102 base::mac::NSStringToFilePath(cr_framework_shlib_path); | 107 base::mac::NSStringToFilePath(cr_framework_shlib_path); |
| 103 return true; | 108 return true; |
| 104 } | 109 } |
| 105 | 110 |
| 106 } // namespace app_mode | 111 } // namespace app_mode |
| OLD | NEW |