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

Unified Diff: chrome/common/resource_bundle_mac.mm

Issue 28214: Add a macutil for the main app bundle and override... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/resource_bundle_mac.mm
===================================================================
--- chrome/common/resource_bundle_mac.mm (revision 10790)
+++ chrome/common/resource_bundle_mac.mm (working copy)
@@ -36,33 +36,8 @@
base::DataPack *LoadResourceDataPack(NSString *name) {
base::DataPack *resource_pack = NULL;
- NSString *const pakExt = @"pak";
-
- // TODO(thomasvl): THIS SUCKS! We need to remove this gate. It's here
- // because of the unittests, but we have no other way to find our resources.
- if (!mac_util::AmIBundled()) {
- FilePath path;
- PathService::Get(base::DIR_EXE, &path);
- path = path.AppendASCII("Chromium.app");
- path = path.AppendASCII("Contents");
- path = path.AppendASCII("Resources");
- if ([name isEqual:@"locale"]) {
- path = path.AppendASCII("en.lproj");
- }
- NSString *pakName = [name stringByAppendingPathExtension:pakExt];
- path = path.Append([pakName fileSystemRepresentation]);
- resource_pack = new base::DataPack;
- bool success = resource_pack->Load(path);
- DCHECK(success) << "failed to load chrome.pak";
- if (!success) {
- delete resource_pack;
- resource_pack = NULL;
- }
- return resource_pack;
- }
-
- NSString *resource_path = [[NSBundle mainBundle] pathForResource:name
- ofType:pakExt];
+ NSString *resource_path = [mac_util::MainAppBundle() pathForResource:name
+ ofType:@"pak"];
if (resource_path) {
FilePath resources_pak_path([resource_path fileSystemRepresentation]);
resource_pack = new base::DataPack;

Powered by Google App Engine
This is Rietveld 408576698