Commit 02a46a3c authored by mark@chromium.org's avatar mark@chromium.org

Take Keystone keys out of the framework's Info.plist. They now live only in

the outer application's Info.plist.

This ensures that the framework and other contents of the versioned directory
can be bit-for-bit identical for a given version, regardless of configured
Keystone channel. This will enable binary diff updates, because they will not
need knowledge of the channel a user is upgrading from.

BUG=45017
TEST=Keystone still functions properly, channel still shows up in the about
     window and about:version of official builds
Review URL: http://codereview.chromium.org/2791001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49334 0039d316-1c4b-4281-b951-d872f2087c98
parent 1d075eca
...@@ -247,19 +247,17 @@ const NSString* const kBrandKey = @"KSBrandID"; ...@@ -247,19 +247,17 @@ const NSString* const kBrandKey = @"KSBrandID";
} }
- (NSDictionary*)infoDictionary { - (NSDictionary*)infoDictionary {
// Use mac_util::MainAppBundle() to get the app framework's dictionary.
return [mac_util::MainAppBundle() infoDictionary];
}
- (void)loadParameters {
NSDictionary* infoDictionary = [self infoDictionary];
// Use [NSBundle mainBundle] to get the application's own bundle identifier // Use [NSBundle mainBundle] to get the application's own bundle identifier
// and path, not the framework's. For auto-update, the application is // and path, not the framework's. For auto-update, the application is
// what's significant here: it's used to locate the outermost part of the // what's significant here: it's used to locate the outermost part of the
// application for the existence checker and other operations that need to // application for the existence checker and other operations that need to
// see the entire application bundle. // see the entire application bundle.
return [[NSBundle mainBundle] infoDictionary];
}
- (void)loadParameters {
NSBundle* appBundle = [NSBundle mainBundle]; NSBundle* appBundle = [NSBundle mainBundle];
NSDictionary* infoDictionary = [self infoDictionary];
NSString* productID = [infoDictionary objectForKey:@"KSProductID"]; NSString* productID = [infoDictionary objectForKey:@"KSProductID"];
if (productID == nil) { if (productID == nil) {
......
...@@ -73,14 +73,16 @@ void SimpleErrorBox(gfx::NativeWindow parent, ...@@ -73,14 +73,16 @@ void SimpleErrorBox(gfx::NativeWindow parent,
string16 GetVersionStringModifier() { string16 GetVersionStringModifier() {
#if defined(GOOGLE_CHROME_BUILD) #if defined(GOOGLE_CHROME_BUILD)
NSBundle* bundle = mac_util::MainAppBundle(); // Use the main application bundle and not the framework bundle. Keystone
// keys don't live in the framework.
NSBundle* bundle = [NSBundle mainBundle];
NSString* channel = [bundle objectForInfoDictionaryKey:@"KSChannelID"]; NSString* channel = [bundle objectForInfoDictionaryKey:@"KSChannelID"];
// Only ever return "", "unknown", "beta" or "dev" in a branded build. // Only ever return "", "unknown", "beta" or "dev" in a branded build.
if (![bundle objectForInfoDictionaryKey:@"KSProductID"]) { if (![bundle objectForInfoDictionaryKey:@"KSProductID"]) {
// This build is not Keystone-enabled, it can't have a channel. // This build is not Keystone-enabled, it can't have a channel.
channel = @"unknown"; channel = @"unknown";
} else if (!channel || [channel isEqual:@"stable"]) { } else if (!channel) {
// For the stable channel, KSChannelID is not set. // For the stable channel, KSChannelID is not set.
channel = @""; channel = @"";
} else if ([channel isEqual:@"beta"] || [channel isEqual:@"dev"]) { } else if ([channel isEqual:@"beta"] || [channel isEqual:@"dev"]) {
......
...@@ -1150,10 +1150,9 @@ ...@@ -1150,10 +1150,9 @@
{ {
# Modify the Info.plist as needed. The script explains why this # Modify the Info.plist as needed. The script explains why this
# is needed. This is also done in the chrome and chrome_dll # is needed. This is also done in the chrome and chrome_dll
# targets. In this case, -b0 and -k0 are used because Breakpad # targets. In this case, -b0, -k0, and -s0 are used because
# and Keystone keys are never placed into the helper, only into # Breakpad, Keystone, and Subersion keys are never placed into
# the framework. -s0 is used because Subversion keys are only # the helper.
# placed into the main app.
'postbuild_name': 'Tweak Info.plist', 'postbuild_name': 'Tweak Info.plist',
'action': ['<(tweak_info_plist_path)', 'action': ['<(tweak_info_plist_path)',
'-b0', '-b0',
......
...@@ -391,14 +391,15 @@ ...@@ -391,14 +391,15 @@
{ {
# Modify the Info.plist as needed. The script explains why # Modify the Info.plist as needed. The script explains why
# this is needed. This is also done in the chrome target. # this is needed. This is also done in the chrome target.
# The framework needs the Breakpad and Keystone keys if # The framework needs the Breakpad keys if this feature is
# those features are enabled. It doesn't currently use the # enabled. It does not need the Keystone keys; these always
# Subversion keys for anything, but this seems like a really # come from the outer application bundle. The framework
# good place to store them. # doesn't currently use the Subversion keys for anything,
# but this seems like a really good place to store them.
'postbuild_name': 'Tweak Info.plist', 'postbuild_name': 'Tweak Info.plist',
'action': ['<(tweak_info_plist_path)', 'action': ['<(tweak_info_plist_path)',
'-b<(mac_breakpad)', '-b<(mac_breakpad)',
'-k<(mac_keystone)', '-k0',
'-s1', '-s1',
'<(branding)', '<(branding)',
'<(mac_bundle_id)'], '<(mac_bundle_id)'],
......
...@@ -357,9 +357,11 @@ ...@@ -357,9 +357,11 @@
# is needed. This is also done in the helper_app and chrome_dll # is needed. This is also done in the helper_app and chrome_dll
# targets. Use -b0 to not include any Breakpad information; that # targets. Use -b0 to not include any Breakpad information; that
# all goes into the framework's Info.plist. Keystone information # all goes into the framework's Info.plist. Keystone information
# is included if Keystone is enabled because the ticket will # is included if Keystone is enabled. The application reads
# reference this Info.plist to determine the tag of the installed # Keystone keys from this plist and not the framework's, and
# product. Use -s1 to include Subversion information. # the ticket will reference this Info.plist to determine the tag
# of the installed product. Use -s1 to include Subversion
# information.
'postbuild_name': 'Tweak Info.plist', 'postbuild_name': 'Tweak Info.plist',
'action': ['<(tweak_info_plist_path)', 'action': ['<(tweak_info_plist_path)',
'-b0', '-b0',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment