| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/common/chrome_version_info.h" | 5 #include "chrome/common/chrome_version_info.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/mac/bundle_locations.h" |
| 10 #include "base/sys_string_conversions.h" | 11 #include "base/sys_string_conversions.h" |
| 11 | 12 |
| 12 namespace chrome { | 13 namespace chrome { |
| 13 | 14 |
| 14 // static | 15 // static |
| 15 std::string VersionInfo::GetVersionStringModifier() { | 16 std::string VersionInfo::GetVersionStringModifier() { |
| 16 #if defined(GOOGLE_CHROME_BUILD) | 17 #if defined(GOOGLE_CHROME_BUILD) |
| 17 // Use the main application bundle and not the framework bundle. Keystone | 18 // Use the main Chrome application bundle and not the framework bundle. |
| 18 // keys don't live in the framework. | 19 // Keystone keys don't live in the framework. |
| 19 NSBundle* bundle = [NSBundle mainBundle]; | 20 NSBundle* bundle = base::mac::OuterBundle(); |
| 20 NSString* channel = [bundle objectForInfoDictionaryKey:@"KSChannelID"]; | 21 NSString* channel = [bundle objectForInfoDictionaryKey:@"KSChannelID"]; |
| 21 | 22 |
| 22 // Only ever return "", "unknown", "beta", "dev", or "canary" in a branded | 23 // Only ever return "", "unknown", "beta", "dev", or "canary" in a branded |
| 23 // build. | 24 // build. |
| 24 if (![bundle objectForInfoDictionaryKey:@"KSProductID"]) { | 25 if (![bundle objectForInfoDictionaryKey:@"KSProductID"]) { |
| 25 // This build is not Keystone-enabled, it can't have a channel. | 26 // This build is not Keystone-enabled, it can't have a channel. |
| 26 channel = @"unknown"; | 27 channel = @"unknown"; |
| 27 } else if (!channel) { | 28 } else if (!channel) { |
| 28 // For the stable channel, KSChannelID is not set. | 29 // For the stable channel, KSChannelID is not set. |
| 29 channel = @""; | 30 channel = @""; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 53 return CHANNEL_DEV; | 54 return CHANNEL_DEV; |
| 54 } else if (channel == "canary") { | 55 } else if (channel == "canary") { |
| 55 return CHANNEL_CANARY; | 56 return CHANNEL_CANARY; |
| 56 } | 57 } |
| 57 #endif | 58 #endif |
| 58 | 59 |
| 59 return CHANNEL_UNKNOWN; | 60 return CHANNEL_UNKNOWN; |
| 60 } | 61 } |
| 61 | 62 |
| 62 } // namespace chrome | 63 } // namespace chrome |
| OLD | NEW |