summaryrefslogtreecommitdiffstats
path: root/chrome/app
diff options
context:
space:
mode:
authorthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-24 16:43:04 +0000
committerthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-24 16:43:04 +0000
commita2126d5e54f773947d5a400f0caec33f4ea1d930 (patch)
tree81d026b3318923cae14fe25f6fb539f90e672a18 /chrome/app
parent90a99dc148bd74520db74fbc80fa3d8639e2d40f (diff)
downloadchromium_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/app')
-rw-r--r--chrome/app/app-Info.plist50
-rw-r--r--chrome/app/breakpad_mac.mm3
-rw-r--r--chrome/app/chrome_dll_main.cc15
-rw-r--r--chrome/app/chromium_strings.grd11
-rw-r--r--chrome/app/google_chrome_strings.grd11
-rw-r--r--chrome/app/helper-Info.plist6
-rwxr-xr-xchrome/app/make_mac_app_symlinks9
-rwxr-xr-xchrome/app/nuke_mac_resources_link19
-rwxr-xr-xchrome/app/tweak_mac_lproj_folders11
9 files changed, 103 insertions, 32 deletions
diff --git a/chrome/app/app-Info.plist b/chrome/app/app-Info.plist
index 1341cdc..1e65fda 100644
--- a/chrome/app/app-Info.plist
+++ b/chrome/app/app-Info.plist
@@ -3,27 +3,9 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>UTExportedTypeDeclarations</key>
- <array>
- <dict>
- <key>UTTypeIdentifier</key>
- <string>org.chromium.extension</string>
- <key>UTTypeDescription</key>
- <string>Chromium Extra</string>
- <key>UTTypeConformsTo</key>
- <array>
- <string>public.data</string>
- </array>
- <key>UTTypeTagSpecification</key>
- <dict>
- <key>public.filename-extension</key>
- <array>
- <string>crx</string>
- </array>
- </dict>
- </dict>
- </array>
+ <string>en-US</string>
+ <key>CFBundleDisplayName</key>
+ <string>${EXECUTABLE_NAME}</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
@@ -134,12 +116,12 @@
<string>Viewer</string>
</dict>
<dict>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>org.chromium.extension</string>
</array>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
</dict>
</array>
<key>CFBundleExecutable</key>
@@ -188,11 +170,33 @@
<string>0.1</string>
<key>LSFileQuarantineEnabled</key>
<true/>
+ <key>LSHasLocalizedDisplayName</key>
+ <string>1</string>
<key>LSMinimumSystemVersion</key>
<string>10.5.0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
+ <key>UTExportedTypeDeclarations</key>
+ <array>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.data</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>Chromium Extra</string>
+ <key>UTTypeIdentifier</key>
+ <string>org.chromium.extension</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>crx</string>
+ </array>
+ </dict>
+ </dict>
+ </array>
</dict>
</plist>
diff --git a/chrome/app/breakpad_mac.mm b/chrome/app/breakpad_mac.mm
index 142a46e..6acb3f4 100644
--- a/chrome/app/breakpad_mac.mm
+++ b/chrome/app/breakpad_mac.mm
@@ -10,6 +10,7 @@
#import "base/basictypes.h"
#include "base/command_line.h"
#import "base/logging.h"
+#include "base/mac_util.h"
#import "base/scoped_nsautorelease_pool.h"
#include "base/sys_string_conversions.h"
#import "breakpad/src/client/mac/Framework/Breakpad.h"
@@ -44,7 +45,7 @@ void InitCrashReporter() {
// may not have access to the disk or to the same data as the browser
// process, so the browser passes the consent preference to them on the
// command line.
- NSBundle* main_bundle = [NSBundle mainBundle];
+ NSBundle* main_bundle = mac_util::MainAppBundle();
NSDictionary* info_dictionary = [main_bundle infoDictionary];
bool is_browser = [[info_dictionary objectForKey:@"LSUIElement"]
isEqualToString:@"1"] ? false : true;
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index d2af7a9..64f5ce53 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -49,6 +49,8 @@
#include "base/win_util.h"
#endif
#if defined(OS_MACOSX)
+#include "base/mac_util.h"
+#include "chrome/common/chrome_paths_internal.h"
#include "chrome/app/breakpad_mac.h"
#endif
#if defined(OS_LINUX)
@@ -335,6 +337,17 @@ int ChromeMain(int argc, const char** argv) {
#endif
const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
+ std::wstring process_type =
+ parsed_command_line.GetSwitchValue(switches::kProcessType);
+
+#if defined(OS_MACOSX)
+ // If process_type is not empty, this is the helper. Set the main app bundle
+ // so code can fetch Mac resources.
+ if (!process_type.empty()) {
+ FilePath main_path(chrome::GetBrowserBundlePath());
+ mac_util::SetOverrideAppBundlePath(main_path);
+ }
+#endif // OS_MACOSX
#if defined(OS_WIN)
// Must do this before any other usage of command line!
@@ -373,8 +386,6 @@ int ChromeMain(int argc, const char** argv) {
#endif // OS_POSIX
int browser_pid;
- std::wstring process_type =
- parsed_command_line.GetSwitchValue(switches::kProcessType);
if (process_type.empty()) {
browser_pid = base::GetCurrentProcId();
} else {
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd
index 2127282..b61d19a 100644
--- a/chrome/app/chromium_strings.grd
+++ b/chrome/app/chromium_strings.grd
@@ -349,6 +349,17 @@ be available for now. -->
<message name="IDS_DEFAULT_BROWSER_INFOBAR_SHORT_TEXT" desc="More compact text to show in the default browser query infobar.">
Chromium isn't your default browser.
</message>
+ <if expr="os == 'darwin'">
+ <message name="IDS_SHORT_PRODUCT_NAME" desc="The application's short name, used for the Mac's application menu, activity monitor, etc. This should be less than 16 characters. Example: Chrome, not Google Chrome.">
+ Chromium
+ </message>
+ <message name="IDS_HELPER_NAME" desc="The helper application's name. Should contain the Chrome application name (IDS_PRODUCT_NAME). Example: Google Chrome Helper.">
+ Chromium Helper
+ </message>
+ <message name="IDS_SHORT_HELPER_NAME" desc="The helper application's short name, used for the Mac's application menu, activity monitor, etc. Example: Chrome Helper, not Google Chrome Helper.">
+ Chromium Helper
+ </message>
+ </if>
</messages>
</release>
</grit>
diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd
index bec59f6..5548e28 100644
--- a/chrome/app/google_chrome_strings.grd
+++ b/chrome/app/google_chrome_strings.grd
@@ -397,6 +397,17 @@ Chrome supports. -->
<message name="IDS_DEFAULT_BROWSER_INFOBAR_SHORT_TEXT" desc="More compact text to show in the default browser query infobar.">
Google Chrome isn't your default browser.
</message>
+ <if expr="os == 'darwin'">
+ <message name="IDS_SHORT_PRODUCT_NAME" desc="The application's short name, used for the Mac's application menu, activity monitor, etc. This should be less than 16 characters. Example: Chrome, not Google Chrome.">
+ Google Chrome
+ </message>
+ <message name="IDS_HELPER_NAME" desc="The helper application's name. Should contain the Chrome application name (IDS_PRODUCT_NAME). Example: Google Chrome Helper.">
+ Google Chrome Helper
+ </message>
+ <message name="IDS_SHORT_HELPER_NAME" desc="The helper application's short name, used for the Mac's application menu, activity monitor, etc. Example: Chrome Helper, not Google Chrome Helper.">
+ Chrome Helper
+ </message>
+ </if>
</messages>
</release>
</grit>
diff --git a/chrome/app/helper-Info.plist b/chrome/app/helper-Info.plist
index 9aeacff..72f92b7 100644
--- a/chrome/app/helper-Info.plist
+++ b/chrome/app/helper-Info.plist
@@ -3,7 +3,9 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
- <string>English</string>
+ <string>en-US</string>
+ <key>CFBundleDisplayName</key>
+ <string>${EXECUTABLE_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
@@ -20,6 +22,8 @@
<string>0.1</string>
<key>LSFileQuarantineEnabled</key>
<true/>
+ <key>LSHasLocalizedDisplayName</key>
+ <string>1</string>
<key>LSMinimumSystemVersion</key>
<string>10.5.0</string>
<key>LSUIElement</key>
diff --git a/chrome/app/make_mac_app_symlinks b/chrome/app/make_mac_app_symlinks
index 5f3c040..66353a95 100755
--- a/chrome/app/make_mac_app_symlinks
+++ b/chrome/app/make_mac_app_symlinks
@@ -5,14 +5,13 @@
# found in the LICENSE file.
# This script is intended to run from a "postbuild" action from within Xcode.
-# It sets up symbolic links for an app bundle's Resources and Frameworks
-# directories. This is intended to be used for app bundles that live within
-# the Resources directory of a larger app bundle, when the sub-app's
-# Resources and Frameworks directories should point to the enclosing app's.
+# It sets up symbolic links for an app bundle's Frameworks directory. This is
+# intended to be used for app bundles that live within the Resources directory
+# of a larger app bundle, when the sub-app's Frameworks directory should point
+# to the enclosing app's.
set -e
CONTENTS_PATH="${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Contents"
-ln -fhs ../.. "${CONTENTS_PATH}/Resources"
ln -fhs ../../../Frameworks "${CONTENTS_PATH}/Frameworks"
diff --git a/chrome/app/nuke_mac_resources_link b/chrome/app/nuke_mac_resources_link
new file mode 100755
index 0000000..98c5c75
--- /dev/null
+++ b/chrome/app/nuke_mac_resources_link
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# TODO: Remove this script and the action that invokes it after 09/01/09
+
+# The helper's Resources directory used to be a link, but now that we need
+# real resources, we have this script deletes the link as a stop gap for the
+# build bots and developers' builds.
+
+set -e
+
+RESOURCES_PATH="${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Contents/Resources"
+
+if [ -L "${RESOURCES_PATH}" ] ; then
+ rm -f "${RESOURCES_PATH}"
+fi
diff --git a/chrome/app/tweak_mac_lproj_folders b/chrome/app/tweak_mac_lproj_folders
index d15c858..78dba5b 100755
--- a/chrome/app/tweak_mac_lproj_folders
+++ b/chrome/app/tweak_mac_lproj_folders
@@ -19,4 +19,15 @@ cd "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Contents/Resources"
rm -rf "zh.lproj" "en.lproj"
# Provide an link for en.lproj that points to en-US.lproj.
+
+# The standard OS language list includes English (en) and not a specific
+# "flavor" such as U.S. English (en-US). When checking for a language match,
+# the OS will remove subtags if no exact match is found, so that en will be
+# used if the user's preferred language list only contains British English
+# (en-GB) and no specific en-GB translation is available.
+#
+# To ensure that users with the default language list, which contains English
+# without any regional subtag, as well as users with a specific variant of
+# English with a regional subtag, will have access to an English-localized
+# application, a symbolic link from en.lproj to en-US.lproj is provided.
ln -fhs "en-US.lproj" "en.lproj"