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

Side by Side Diff: chrome/tools/mac_helpers/infoplist_strings_util.mm

Issue 10387010: Select theme resources from ResourceBundle at requested scale factor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with master. Created 8 years, 7 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
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 // 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 ui::DataPack* LoadResourceDataPack(const char* dir_path, 54 ui::DataPack* LoadResourceDataPack(const char* dir_path,
55 const char* branding_strings_name, 55 const char* branding_strings_name,
56 const char* locale_name) { 56 const char* locale_name) {
57 ui::DataPack* resource_pack = NULL; 57 ui::DataPack* resource_pack = NULL;
58 58
59 NSString* resource_path = [NSString stringWithFormat:@"%s/%s_%s.pak", 59 NSString* resource_path = [NSString stringWithFormat:@"%s/%s_%s.pak",
60 dir_path, branding_strings_name, locale_name]; 60 dir_path, branding_strings_name, locale_name];
61 if (resource_path) { 61 if (resource_path) {
62 FilePath resources_pak_path([resource_path fileSystemRepresentation]); 62 FilePath resources_pak_path([resource_path fileSystemRepresentation]);
63 resource_pack = new ui::DataPack(ui::ResourceHandle::kScaleFactor100x); 63 resource_pack = new ui::DataPack(ui::SCALE_FACTOR_100P);
64 bool success = resource_pack->Load(resources_pak_path); 64 bool success = resource_pack->Load(resources_pak_path);
65 if (!success) { 65 if (!success) {
66 delete resource_pack; 66 delete resource_pack;
67 resource_pack = NULL; 67 resource_pack = NULL;
68 } 68 }
69 } 69 }
70 70
71 return resource_pack; 71 return resource_pack;
72 } 72 }
73 73
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 [output_path stringByAppendingPathComponent:@"InfoPlist.strings"]; 308 [output_path stringByAppendingPathComponent:@"InfoPlist.strings"];
309 if (![strings_file_contents_utf8 writeToFile:output_path 309 if (![strings_file_contents_utf8 writeToFile:output_path
310 atomically:YES]) { 310 atomically:YES]) {
311 fprintf(stderr, "ERROR: Failed to write out '%s'\n", 311 fprintf(stderr, "ERROR: Failed to write out '%s'\n",
312 [output_path UTF8String]); 312 [output_path UTF8String]);
313 exit(1); 313 exit(1);
314 } 314 }
315 } 315 }
316 return 0; 316 return 0;
317 } 317 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698