| 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 // Helper tool that is built and run during a build to pull strings from | 5 // Helper tool that is built and run during a build to pull strings from |
| 6 // the GRD files and generate the InfoPlist.strings files needed for | 6 // the GRD files and generate the InfoPlist.strings files needed for |
| 7 // Mac OS X app bundles. | 7 // Mac OS X app bundles. |
| 8 | 8 |
| 9 #import <Foundation/Foundation.h> | 9 #import <Foundation/Foundation.h> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 ui::DataPack* LoadResourceDataPack(const char* dir_path, | 55 ui::DataPack* LoadResourceDataPack(const char* dir_path, |
| 56 const char* branding_strings_name, | 56 const char* branding_strings_name, |
| 57 const char* locale_name) { | 57 const char* locale_name) { |
| 58 ui::DataPack* resource_pack = NULL; | 58 ui::DataPack* resource_pack = NULL; |
| 59 | 59 |
| 60 NSString* resource_path = [NSString stringWithFormat:@"%s/%s_%s.pak", | 60 NSString* resource_path = [NSString stringWithFormat:@"%s/%s_%s.pak", |
| 61 dir_path, branding_strings_name, locale_name]; | 61 dir_path, branding_strings_name, locale_name]; |
| 62 if (resource_path) { | 62 if (resource_path) { |
| 63 base::FilePath resources_pak_path([resource_path fileSystemRepresentation]); | 63 base::FilePath resources_pak_path([resource_path fileSystemRepresentation]); |
| 64 file_util::AbsolutePath(&resources_pak_path); | 64 resources_pak_path = base::MakeAbsoluteFilePath(resources_pak_path); |
| 65 resource_pack = new ui::DataPack(ui::SCALE_FACTOR_100P); | 65 resource_pack = new ui::DataPack(ui::SCALE_FACTOR_100P); |
| 66 bool success = resource_pack->LoadFromPath(resources_pak_path); | 66 bool success = resource_pack->LoadFromPath(resources_pak_path); |
| 67 if (!success) { | 67 if (!success) { |
| 68 delete resource_pack; | 68 delete resource_pack; |
| 69 resource_pack = NULL; | 69 resource_pack = NULL; |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 return resource_pack; | 73 return resource_pack; |
| 74 } | 74 } |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 [output_path stringByAppendingPathComponent:@"InfoPlist.strings"]; | 310 [output_path stringByAppendingPathComponent:@"InfoPlist.strings"]; |
| 311 if (![strings_file_contents_utf8 writeToFile:output_path | 311 if (![strings_file_contents_utf8 writeToFile:output_path |
| 312 atomically:YES]) { | 312 atomically:YES]) { |
| 313 fprintf(stderr, "ERROR: Failed to write out '%s'\n", | 313 fprintf(stderr, "ERROR: Failed to write out '%s'\n", |
| 314 [output_path UTF8String]); | 314 [output_path UTF8String]); |
| 315 exit(1); | 315 exit(1); |
| 316 } | 316 } |
| 317 } | 317 } |
| 318 return 0; | 318 return 0; |
| 319 } | 319 } |
| OLD | NEW |