Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: chrome/browser/platform_util_mac.mm

Issue 7249003: Move GetVersionStringModifier() and GetChannel() from platform_util_* to chrome_version_info_* (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: correct nits Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/platform_util_common_linux.cc ('k') | chrome/browser/platform_util_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/platform_util_mac.mm
diff --git a/chrome/browser/platform_util_mac.mm b/chrome/browser/platform_util_mac.mm
index 818ab968ded9543ae7154468d0af284f271eabdd..72000597d3b0cba8157e38d4e56036cd5a3bf647 100644
--- a/chrome/browser/platform_util_mac.mm
+++ b/chrome/browser/platform_util_mac.mm
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/mac/scoped_aedesc.h"
#include "base/sys_string_conversions.h"
+#include "chrome/common/chrome_version_info.h"
#include "googleurl/src/gurl.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -180,54 +181,9 @@ bool SimpleYesNoBox(gfx::NativeWindow parent,
return result == NSAlertFirstButtonReturn;
}
-std::string GetVersionStringModifier() {
-#if defined(GOOGLE_CHROME_BUILD)
- // 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"];
-
- // Only ever return "", "unknown", "beta", "dev", or "canary" in a branded
- // build.
- if (![bundle objectForInfoDictionaryKey:@"KSProductID"]) {
- // This build is not Keystone-enabled, it can't have a channel.
- channel = @"unknown";
- } else if (!channel) {
- // For the stable channel, KSChannelID is not set.
- channel = @"";
- } else if ([channel isEqual:@"beta"] ||
- [channel isEqual:@"dev"] ||
- [channel isEqual:@"canary"]) {
- // do nothing.
- } else {
- channel = @"unknown";
- }
-
- return base::SysNSStringToUTF8(channel);
-#else
- return std::string();
-#endif
-}
-
-Channel GetChannel() {
-#if defined(GOOGLE_CHROME_BUILD)
- std::string channel = GetVersionStringModifier();
- if (channel.empty()) {
- return CHANNEL_STABLE;
- } else if (channel == "beta") {
- return CHANNEL_BETA;
- } else if (channel == "dev") {
- return CHANNEL_DEV;
- } else if (channel == "canary") {
- return CHANNEL_CANARY;
- }
-#endif
-
- return CHANNEL_UNKNOWN;
-}
-
bool CanSetAsDefaultBrowser() {
- return GetChannel() != CHANNEL_CANARY;
+ return chrome::VersionInfo::GetChannel() !=
+ chrome::VersionInfo::CHANNEL_CANARY;
}
bool CanSetAsDefaultProtocolClient(const std::string& protocol) {
« no previous file with comments | « chrome/browser/platform_util_common_linux.cc ('k') | chrome/browser/platform_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698