| OLD | NEW |
| 1 // Copyright (c) 2010 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/browser/platform_util.h" | 5 #include "chrome/browser/platform_util.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #import <CoreServices/CoreServices.h> | 9 #include <CoreServices/CoreServices.h> |
| 10 | 10 |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/mac/scoped_aedesc.h" | 13 #include "base/mac/scoped_aedesc.h" |
| 14 #include "base/sys_string_conversions.h" | 14 #include "base/sys_string_conversions.h" |
| 15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 16 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
| 17 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
| 18 #include "ui/base/l10n/l10n_util_mac.h" | 18 #include "ui/base/l10n/l10n_util_mac.h" |
| 19 | 19 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 return result == NSAlertFirstButtonReturn; | 180 return result == NSAlertFirstButtonReturn; |
| 181 } | 181 } |
| 182 | 182 |
| 183 std::string GetVersionStringModifier() { | 183 std::string GetVersionStringModifier() { |
| 184 #if defined(GOOGLE_CHROME_BUILD) | 184 #if defined(GOOGLE_CHROME_BUILD) |
| 185 // Use the main application bundle and not the framework bundle. Keystone | 185 // Use the main application bundle and not the framework bundle. Keystone |
| 186 // keys don't live in the framework. | 186 // keys don't live in the framework. |
| 187 NSBundle* bundle = [NSBundle mainBundle]; | 187 NSBundle* bundle = [NSBundle mainBundle]; |
| 188 NSString* channel = [bundle objectForInfoDictionaryKey:@"KSChannelID"]; | 188 NSString* channel = [bundle objectForInfoDictionaryKey:@"KSChannelID"]; |
| 189 | 189 |
| 190 // Only ever return "", "unknown", "beta" or "dev" in a branded build. | 190 // Only ever return "", "unknown", "beta", "dev", or "canary" in a branded |
| 191 // build. |
| 191 if (![bundle objectForInfoDictionaryKey:@"KSProductID"]) { | 192 if (![bundle objectForInfoDictionaryKey:@"KSProductID"]) { |
| 192 // This build is not Keystone-enabled, it can't have a channel. | 193 // This build is not Keystone-enabled, it can't have a channel. |
| 193 channel = @"unknown"; | 194 channel = @"unknown"; |
| 194 } else if (!channel) { | 195 } else if (!channel) { |
| 195 // For the stable channel, KSChannelID is not set. | 196 // For the stable channel, KSChannelID is not set. |
| 196 channel = @""; | 197 channel = @""; |
| 197 } else if ([channel isEqual:@"beta"] || [channel isEqual:@"dev"]) { | 198 } else if ([channel isEqual:@"beta"] || |
| 199 [channel isEqual:@"dev"] || |
| 200 [channel isEqual:@"canary") { |
| 198 // do nothing. | 201 // do nothing. |
| 199 } else { | 202 } else { |
| 200 channel = @"unknown"; | 203 channel = @"unknown"; |
| 201 } | 204 } |
| 202 | 205 |
| 203 return base::SysNSStringToUTF8(channel); | 206 return base::SysNSStringToUTF8(channel); |
| 204 #else | 207 #else |
| 205 return std::string(); | 208 return std::string(); |
| 206 #endif | 209 #endif |
| 207 } | 210 } |
| 208 | 211 |
| 209 } // namespace platform_util | 212 } // namespace platform_util |
| OLD | NEW |