diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-22 04:15:13 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-22 04:15:13 +0000 |
commit | 151c4a6e282f4282669fb7360dbcbb59c25b92fa (patch) | |
tree | aced67734d49ef99cbe82508f8f6c544a5dd1b3c /chrome/app/app_mode_loader_mac.mm | |
parent | 55397fc328afa661889e11bfac71617667bd3b69 (diff) | |
download | chromium_src-151c4a6e282f4282669fb7360dbcbb59c25b92fa.zip chromium_src-151c4a6e282f4282669fb7360dbcbb59c25b92fa.tar.gz chromium_src-151c4a6e282f4282669fb7360dbcbb59c25b92fa.tar.bz2 |
Use the real Mac browser app's bundle identifier everywhere that a base
bundle identifier is needed on the Mac. This means that everything will use
up using org.chromium.Chromium, com.google.Chrome, or
com.google.Chrome.canary when it's important to get the base bundle
identifier. .helper and .framework will not be appended. Note, however, that
things that run inside the helper and use CFPreferences or NSUserDefaults
will continue to write their defaults as org.chromium.Chromium.helper or
com.google.Chrome.helper. Mostly this just affects the Flash plug-in's
settings for the NSNav open dialog. There is no
com.google.Chrome.canary.helper, but that's not expected to be a problem.
This change ensures that Chromes, canaries, and Chromiums don't get in each
other's way.
BUG=79814
TEST=none
Review URL: http://codereview.chromium.org/6896003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82626 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/app_mode_loader_mac.mm')
-rw-r--r-- | chrome/app/app_mode_loader_mac.mm | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/chrome/app/app_mode_loader_mac.mm b/chrome/app/app_mode_loader_mac.mm index 9ffb697..003ce19 100644 --- a/chrome/app/app_mode_loader_mac.mm +++ b/chrome/app/app_mode_loader_mac.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -60,12 +60,21 @@ int main(int argc, char** argv) { // needed. NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; + // Get the current main bundle, i.e., that of the app loader that's running. + NSBundle* app_bundle = [NSBundle mainBundle]; + CHECK_MSG(app_bundle, "couldn't get loader bundle"); + + // Get the bundle ID of the browser that created this app bundle. + NSString* cr_bundle_id = [app_bundle + objectForInfoDictionaryKey:(NSString*)app_mode::kBrowserBundleIDKey]; + CHECK_MSG(cr_bundle_id, "couldn't get browser bundle ID"); + // Get the browser bundle path. // TODO(viettrungluu): more fun NSString* cr_bundle_path = [(NSString*)CFPreferencesCopyAppValue( app_mode::kLastRunAppBundlePathPrefsKey, - app_mode::kAppPrefsID) autorelease]; + (CFStringRef)cr_bundle_id) autorelease]; CHECK_MSG(cr_bundle_path, "couldn't get browser bundle path"); // Get the browser bundle. @@ -91,9 +100,6 @@ int main(int argc, char** argv) { // And copy it, since |cr_versioned_path| will go away with the pool. info.chrome_versioned_path = NSStringToFSCString(cr_versioned_path); - // Get the current main bundle, i.e., that of the app loader that's running. - NSBundle* app_bundle = [NSBundle mainBundle]; - CHECK_MSG(app_bundle, "couldn't get loader bundle"); // Optional, so okay if it's NULL. info.app_mode_bundle_path = NSStringToFSCString([app_bundle bundlePath]); |