OLD | NEW |
---|---|
1 // Copyright (c) 2011 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 #include "base/file_version_info_mac.h" | 5 #include "base/file_version_info_mac.h" |
6 | 6 |
7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/mac/bundle_locations.h" | 11 #include "base/mac/bundle_locations.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 | 53 |
54 string16 FileVersionInfoMac::comments() { | 54 string16 FileVersionInfoMac::comments() { |
55 return string16(); | 55 return string16(); |
56 } | 56 } |
57 | 57 |
58 string16 FileVersionInfoMac::legal_copyright() { | 58 string16 FileVersionInfoMac::legal_copyright() { |
59 return GetString16Value(CFSTR("CFBundleGetInfoString")); | 59 return GetString16Value(CFSTR("CFBundleGetInfoString")); |
60 } | 60 } |
61 | 61 |
62 string16 FileVersionInfoMac::product_version() { | 62 string16 FileVersionInfoMac::product_version() { |
63 // On OS X, CFBundleVersion is used by LaunchServices, and must follow | |
64 // specific formatting rules, so the four-part Chrome version is in | |
65 // CFBundleShortVersionString. On iOS, however, CFBundleVersion can be the | |
Mark Mentovai
2012/07/23 20:48:43
Oh, wow.
stuartmorgan
2012/07/24 09:37:55
Yeah, having completely different arbitrary rules
| |
66 // full version, but CFBundleShortVersionString has a policy-enfoced limit | |
67 // of three version components. | |
68 #if defined(OS_IOS) | |
69 return GetString16Value(CFSTR("CFBundleVersion")); | |
70 #else | |
63 return GetString16Value(CFSTR("CFBundleShortVersionString")); | 71 return GetString16Value(CFSTR("CFBundleShortVersionString")); |
72 #endif // defined(OS_IOS) | |
64 } | 73 } |
65 | 74 |
66 string16 FileVersionInfoMac::file_description() { | 75 string16 FileVersionInfoMac::file_description() { |
67 return string16(); | 76 return string16(); |
68 } | 77 } |
69 | 78 |
70 string16 FileVersionInfoMac::legal_trademarks() { | 79 string16 FileVersionInfoMac::legal_trademarks() { |
71 return string16(); | 80 return string16(); |
72 } | 81 } |
73 | 82 |
(...skipping 28 matching lines...) Expand all Loading... | |
102 string16 FileVersionInfoMac::GetString16Value(CFStringRef name) { | 111 string16 FileVersionInfoMac::GetString16Value(CFStringRef name) { |
103 if (bundle_) { | 112 if (bundle_) { |
104 NSString *ns_name = base::mac::CFToNSCast(name); | 113 NSString *ns_name = base::mac::CFToNSCast(name); |
105 NSString* value = [bundle_ objectForInfoDictionaryKey:ns_name]; | 114 NSString* value = [bundle_ objectForInfoDictionaryKey:ns_name]; |
106 if (value) { | 115 if (value) { |
107 return base::SysNSStringToUTF16(value); | 116 return base::SysNSStringToUTF16(value); |
108 } | 117 } |
109 } | 118 } |
110 return string16(); | 119 return string16(); |
111 } | 120 } |
OLD | NEW |