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

Side by Side Diff: base/file_version_info_mac.mm

Issue 542223002: Use a different plist key for iOS versioning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #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/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 return base::string16(); 55 return base::string16();
56 } 56 }
57 57
58 base::string16 FileVersionInfoMac::legal_copyright() { 58 base::string16 FileVersionInfoMac::legal_copyright() {
59 return GetString16Value(CFSTR("CFBundleGetInfoString")); 59 return GetString16Value(CFSTR("CFBundleGetInfoString"));
60 } 60 }
61 61
62 base::string16 FileVersionInfoMac::product_version() { 62 base::string16 FileVersionInfoMac::product_version() {
63 // On OS X, CFBundleVersion is used by LaunchServices, and must follow 63 // On OS X, CFBundleVersion is used by LaunchServices, and must follow
64 // specific formatting rules, so the four-part Chrome version is in 64 // specific formatting rules, so the four-part Chrome version is in
65 // CFBundleShortVersionString. On iOS, however, CFBundleVersion can be the 65 // CFBundleShortVersionString. On iOS, both have a policy-enfoced limit
66 // full version, but CFBundleShortVersionString has a policy-enfoced limit 66 // of three version components, so the full version is stored in a custom
67 // of three version components. 67 // key (CrBundleVersion) falling back to CFBundleVersion if not present.
68 #if defined(OS_IOS) 68 #if defined(OS_IOS)
69 base::string16 version(GetString16Value(CFSTR("CrBundleVersion")));
rohitrao (ping after 24h) 2014/09/05 17:01:50 We can use whatever key we want without worrying a
stuartmorgan 2014/09/05 17:15:09 I can't imagine Apple would start using Cr as a pr
70 if (version.length() > 0)
71 return version;
69 return GetString16Value(CFSTR("CFBundleVersion")); 72 return GetString16Value(CFSTR("CFBundleVersion"));
rohitrao (ping after 24h) 2014/09/05 17:01:50 Do you intend to remove the fallback code eventual
stuartmorgan 2014/09/05 17:15:09 Since this is in base/ I wasn't planning on it. Th
stuartmorgan 2014/09/05 17:24:54 Also, the fallback should make life easier for tes
70 #else 73 #else
71 return GetString16Value(CFSTR("CFBundleShortVersionString")); 74 return GetString16Value(CFSTR("CFBundleShortVersionString"));
72 #endif // defined(OS_IOS) 75 #endif // defined(OS_IOS)
73 } 76 }
74 77
75 base::string16 FileVersionInfoMac::file_description() { 78 base::string16 FileVersionInfoMac::file_description() {
76 return base::string16(); 79 return base::string16();
77 } 80 }
78 81
79 base::string16 FileVersionInfoMac::legal_trademarks() { 82 base::string16 FileVersionInfoMac::legal_trademarks() {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 base::string16 FileVersionInfoMac::GetString16Value(CFStringRef name) { 114 base::string16 FileVersionInfoMac::GetString16Value(CFStringRef name) {
112 if (bundle_) { 115 if (bundle_) {
113 NSString *ns_name = base::mac::CFToNSCast(name); 116 NSString *ns_name = base::mac::CFToNSCast(name);
114 NSString* value = [bundle_ objectForInfoDictionaryKey:ns_name]; 117 NSString* value = [bundle_ objectForInfoDictionaryKey:ns_name];
115 if (value) { 118 if (value) {
116 return base::SysNSStringToUTF16(value); 119 return base::SysNSStringToUTF16(value);
117 } 120 }
118 } 121 }
119 return base::string16(); 122 return base::string16();
120 } 123 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698