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 #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" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 string16 FileVersionInfoMac::original_filename() { | 91 string16 FileVersionInfoMac::original_filename() { |
92 return GetString16Value(kCFBundleNameKey); | 92 return GetString16Value(kCFBundleNameKey); |
93 } | 93 } |
94 | 94 |
95 string16 FileVersionInfoMac::special_build() { | 95 string16 FileVersionInfoMac::special_build() { |
96 return string16(); | 96 return string16(); |
97 } | 97 } |
98 | 98 |
99 string16 FileVersionInfoMac::last_change() { | 99 string16 FileVersionInfoMac::last_change() { |
100 return GetString16Value(CFSTR("SVNRevision")); | 100 return GetString16Value(CFSTR("SCMRevision")); |
101 } | 101 } |
102 | 102 |
103 bool FileVersionInfoMac::is_official_build() { | 103 bool FileVersionInfoMac::is_official_build() { |
104 #if defined (GOOGLE_CHROME_BUILD) | 104 #if defined (GOOGLE_CHROME_BUILD) |
105 return true; | 105 return true; |
106 #else | 106 #else |
107 return false; | 107 return false; |
108 #endif | 108 #endif |
109 } | 109 } |
110 | 110 |
111 string16 FileVersionInfoMac::GetString16Value(CFStringRef name) { | 111 string16 FileVersionInfoMac::GetString16Value(CFStringRef name) { |
112 if (bundle_) { | 112 if (bundle_) { |
113 NSString *ns_name = base::mac::CFToNSCast(name); | 113 NSString *ns_name = base::mac::CFToNSCast(name); |
114 NSString* value = [bundle_ objectForInfoDictionaryKey:ns_name]; | 114 NSString* value = [bundle_ objectForInfoDictionaryKey:ns_name]; |
115 if (value) { | 115 if (value) { |
116 return base::SysNSStringToUTF16(value); | 116 return base::SysNSStringToUTF16(value); |
117 } | 117 } |
118 } | 118 } |
119 return string16(); | 119 return string16(); |
120 } | 120 } |
OLD | NEW |