diff options
author | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-24 16:43:04 +0000 |
---|---|---|
committer | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-24 16:43:04 +0000 |
commit | a2126d5e54f773947d5a400f0caec33f4ea1d930 (patch) | |
tree | 81d026b3318923cae14fe25f6fb539f90e672a18 /chrome/common | |
parent | 90a99dc148bd74520db74fbc80fa3d8639e2d40f (diff) | |
download | chromium_src-a2126d5e54f773947d5a400f0caec33f4ea1d930.zip chromium_src-a2126d5e54f773947d5a400f0caec33f4ea1d930.tar.gz chromium_src-a2126d5e54f773947d5a400f0caec33f4ea1d930.tar.bz2 |
Tweak the comment in the lproj fixup script to explain why we need an "en" folder.
Added a string for the products short name, this is current mac only, and is used for the application menu title via the infoplist.strings file.
Added source for a tool to build InfoPlist.strings files based on the values within the GRD files.
Run the InfoPlist.strings generation tool during the build.
Added a script to take a string and list of locale and generate all the versions of the string.
Wired up the string locale tool so GYP knows about all the inputs/outputs from the InfoPlist.strings generation tool.
Stop setting some of the Info.plist keys that are now covered by the InfoPlist.strings files.
Update the mac links script to stop creating a resources link.
Add a shim to nuke the helper's resource link so it can get a real folder.
Helper in in chrome_paths_mac to find the main app's bundle (that the helper lives in).
At startup, if not the browser, set the main bundle to be the parent of this bundle.
Fix up the breakpad init to use the mac_util helper for main bundle.
TEST=when runnining in the supported languages, Finder Get Info should show a localized copyright. The process names in activity monitor should also be correct and show localized names once the TC work is done.
BUG=19019
Review URL: http://codereview.chromium.org/171040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24104 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/chrome_paths_internal.h | 9 | ||||
-rw-r--r-- | chrome/common/chrome_paths_mac.mm | 27 |
2 files changed, 34 insertions, 2 deletions
diff --git a/chrome/common/chrome_paths_internal.h b/chrome/common/chrome_paths_internal.h index f1f0fa9..54b9870 100644 --- a/chrome/common/chrome_paths_internal.h +++ b/chrome/common/chrome_paths_internal.h @@ -7,7 +7,7 @@ #include "build/build_config.h" -class FilePath; +#include "base/file_path.h" namespace chrome { @@ -29,6 +29,13 @@ bool GetUserDownloadsDirectory(FilePath* result); // The path to the user's desktop. bool GetUserDesktop(FilePath* result); +#if defined(OS_MACOSX) +// Retrieves the browser bundle path. It is only valid to call this from a +// helper process, as it makes assumptions about the location of the enclosing +// bundle on disk. +FilePath GetBrowserBundlePath(); +#endif // defined(OS_MACOSX) + } // namespace chrome diff --git a/chrome/common/chrome_paths_mac.mm b/chrome/common/chrome_paths_mac.mm index 618dd4f..82dbb3c 100644 --- a/chrome/common/chrome_paths_mac.mm +++ b/chrome/common/chrome_paths_mac.mm @@ -7,7 +7,6 @@ #import <Cocoa/Cocoa.h> #import "base/base_paths.h" -#import "base/file_path.h" #import "base/logging.h" #import "base/path_service.h" @@ -72,4 +71,30 @@ bool GetUserDesktop(FilePath* result) { return success; } +FilePath GetBrowserBundlePath() { + NSBundle* running_app_bundle = [NSBundle mainBundle]; + NSString* running_app_bundle_path = [running_app_bundle bundlePath]; + DCHECK(running_app_bundle_path) << "failed to get the main bundle path"; + + // Are we the helper or the browser (main bundle)? + if (![[[running_app_bundle infoDictionary] + objectForKey:@"LSUIElement"] boolValue]) { + // We aren't a LSUIElement, so this must be the browser, return it's path. + return FilePath([running_app_bundle_path fileSystemRepresentation]); + } + + // Helper lives at ...app/Contents/Resources/...Helper.app + NSArray* components = [running_app_bundle_path pathComponents]; + DCHECK_GE([components count], static_cast<NSUInteger>(4)) + << "too few path components for this bundle to be within another bundle"; + components = + [components subarrayWithRange:NSMakeRange(0, [components count] - 3)]; + + NSString* browser_path = [NSString pathWithComponents:components]; + DCHECK([[browser_path pathExtension] isEqualToString:@"app"]) + << "we weren't within another app?"; + + return FilePath([browser_path fileSystemRepresentation]); +} + } // namespace chrome |