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 #ifndef CHROME_COMMON_MAC_APP_MODE_CHROME_LOCATOR_H_ | 5 #ifndef CHROME_COMMON_MAC_APP_MODE_CHROME_LOCATOR_H_ |
6 #define CHROME_COMMON_MAC_APP_MODE_CHROME_LOCATOR_H_ | 6 #define CHROME_COMMON_MAC_APP_MODE_CHROME_LOCATOR_H_ |
7 | 7 |
8 #include <CoreFoundation/CoreFoundation.h> | 8 #include <CoreFoundation/CoreFoundation.h> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 | 11 |
12 @class NSString; | 12 @class NSString; |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class FilePath; | 15 class FilePath; |
16 } | 16 } |
17 | 17 |
18 namespace app_mode { | 18 namespace app_mode { |
19 | 19 |
20 // Given a bundle id, return the path of the corresponding bundle. | 20 // Given a bundle id, return the path of the corresponding bundle. |
21 // Returns true if the bundle was found, false otherwise. | 21 // Returns true if the bundle was found, false otherwise. |
22 bool FindBundleById(NSString* bundle_id, base::FilePath* out_bundle); | 22 bool FindBundleById(NSString* bundle_id, base::FilePath* out_bundle); |
23 | 23 |
24 // Given the path to the Chrome bundle, read the following information: | 24 // Given the path to the Chrome bundle, and an optional framework version, read |
| 25 // the following information: |
25 // |executable_path| - Path to the Chrome executable. | 26 // |executable_path| - Path to the Chrome executable. |
26 // |raw_version_str| - Chrome version. | |
27 // |version_path| - |chrome_bundle|/Contents/Versions/|raw_version_str|/ | 27 // |version_path| - |chrome_bundle|/Contents/Versions/|raw_version_str|/ |
28 // |framework_shlib_path| - Path to the chrome framework's shared library (not | 28 // |framework_shlib_path| - Path to the chrome framework's shared library (not |
29 // the framework directory). | 29 // the framework directory). |
| 30 // If |version_str| is not given, this will read the current Chrome version from |
| 31 // the bundle's plist. |
30 // Returns true if all information read succesfuly, false otherwise. | 32 // Returns true if all information read succesfuly, false otherwise. |
31 bool GetChromeBundleInfo(const base::FilePath& chrome_bundle, | 33 bool GetChromeBundleInfo(const base::FilePath& chrome_bundle, |
| 34 const std::string& version_str, |
32 base::FilePath* executable_path, | 35 base::FilePath* executable_path, |
33 base::string16* raw_version_str, | |
34 base::FilePath* version_path, | 36 base::FilePath* version_path, |
35 base::FilePath* framework_shlib_path); | 37 base::FilePath* framework_shlib_path); |
36 | 38 |
37 } // namespace app_mode | 39 } // namespace app_mode |
38 | 40 |
39 #endif // CHROME_COMMON_MAC_APP_MODE_CHROME_LOCATOR_H_ | 41 #endif // CHROME_COMMON_MAC_APP_MODE_CHROME_LOCATOR_H_ |
OLD | NEW |