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

Side by Side Diff: base/file_version_info_mac.mm

Issue 6046009: Move base/mac_util.h to base/mac and use the base::mac namespace.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « base/base_paths_mac.mm ('k') | base/mac/mac_util.h » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/mac_util.h"
11 #include "base/sys_string_conversions.h" 12 #include "base/sys_string_conversions.h"
12 #include "base/mac_util.h"
13 13
14 FileVersionInfoMac::FileVersionInfoMac(NSBundle *bundle) : bundle_(bundle) { 14 FileVersionInfoMac::FileVersionInfoMac(NSBundle *bundle) : bundle_(bundle) {
15 } 15 }
16 16
17 // static 17 // static
18 FileVersionInfo* FileVersionInfo::CreateFileVersionInfoForCurrentModule() { 18 FileVersionInfo* FileVersionInfo::CreateFileVersionInfoForCurrentModule() {
19 return CreateFileVersionInfo(mac_util::MainAppBundlePath()); 19 return CreateFileVersionInfo(base::mac::MainAppBundlePath());
20 } 20 }
21 21
22 // static 22 // static
23 FileVersionInfo* FileVersionInfo::CreateFileVersionInfo( 23 FileVersionInfo* FileVersionInfo::CreateFileVersionInfo(
24 const FilePath& file_path) { 24 const FilePath& file_path) {
25 NSString* path = base::SysUTF8ToNSString(file_path.value()); 25 NSString* path = base::SysUTF8ToNSString(file_path.value());
26 NSBundle* bundle = [NSBundle bundleWithPath:path]; 26 NSBundle* bundle = [NSBundle bundleWithPath:path];
27 return new FileVersionInfoMac(bundle); 27 return new FileVersionInfoMac(bundle);
28 } 28 }
29 29
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 bool FileVersionInfoMac::is_official_build() { 90 bool FileVersionInfoMac::is_official_build() {
91 #if defined (GOOGLE_CHROME_BUILD) 91 #if defined (GOOGLE_CHROME_BUILD)
92 return true; 92 return true;
93 #else 93 #else
94 return false; 94 return false;
95 #endif 95 #endif
96 } 96 }
97 97
98 string16 FileVersionInfoMac::GetString16Value(CFStringRef name) { 98 string16 FileVersionInfoMac::GetString16Value(CFStringRef name) {
99 if (bundle_) { 99 if (bundle_) {
100 NSString *ns_name = mac_util::CFToNSCast(name); 100 NSString *ns_name = base::mac::CFToNSCast(name);
101 NSString* value = [bundle_ objectForInfoDictionaryKey:ns_name]; 101 NSString* value = [bundle_ objectForInfoDictionaryKey:ns_name];
102 if (value) { 102 if (value) {
103 return base::SysNSStringToUTF16(value); 103 return base::SysNSStringToUTF16(value);
104 } 104 }
105 } 105 }
106 return string16(); 106 return string16();
107 } 107 }
OLDNEW
« no previous file with comments | « base/base_paths_mac.mm ('k') | base/mac/mac_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698