summaryrefslogtreecommitdiffstats
path: root/chrome/common/resource_bundle_mac.mm
diff options
context:
space:
mode:
authorthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-03 16:26:03 +0000
committerthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-03 16:26:03 +0000
commit6f33add36219e1faadea9d295b35d43841ebd508 (patch)
treebc5561b8d3cedeb13e504c971a7992a34e6d2353 /chrome/common/resource_bundle_mac.mm
parentabf6c7a76bc68d0a01c1665e97972b0056654a26 (diff)
downloadchromium_src-6f33add36219e1faadea9d295b35d43841ebd508.zip
chromium_src-6f33add36219e1faadea9d295b35d43841ebd508.tar.gz
chromium_src-6f33add36219e1faadea9d295b35d43841ebd508.tar.bz2
Add a macutil for the main app bundle and override
- provide apis to get and override the app bundle - w/in the core code, use this api for fetching the bundle - render sandbox config - resource bundles - test shell font - w/in the unittest boot straps, use the mac util to override the bundle so resources can be found. Review URL: http://codereview.chromium.org/28214 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10798 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/resource_bundle_mac.mm')
-rw-r--r--chrome/common/resource_bundle_mac.mm29
1 files changed, 2 insertions, 27 deletions
diff --git a/chrome/common/resource_bundle_mac.mm b/chrome/common/resource_bundle_mac.mm
index e739855..3757fc89 100644
--- a/chrome/common/resource_bundle_mac.mm
+++ b/chrome/common/resource_bundle_mac.mm
@@ -36,33 +36,8 @@ namespace {
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;