diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-02 21:19:01 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-02 21:19:01 +0000 |
commit | 3e76e27b7504fef3150c8074b88954b679740769 (patch) | |
tree | e85a2a8b86f952e43da4856bf0f4d0a55587d7f4 /chrome/browser/platform_util_win.cc | |
parent | 6fc9077537613d42871b3ce6a0eb18f3924f6c99 (diff) | |
download | chromium_src-3e76e27b7504fef3150c8074b88954b679740769.zip chromium_src-3e76e27b7504fef3150c8074b88954b679740769.tar.gz chromium_src-3e76e27b7504fef3150c8074b88954b679740769.tar.bz2 |
Fix platform_util::GetChannel on Windows.
GetChannel was confused in multi-user installs. It treated them as
CHANNEL_UNKNOWN instead of their correct channels.
BUG=81218
TEST=none
Review URL: http://codereview.chromium.org/6893158
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83790 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/platform_util_win.cc')
-rw-r--r-- | chrome/browser/platform_util_win.cc | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/chrome/browser/platform_util_win.cc b/chrome/browser/platform_util_win.cc index 1949e2b..41993d6 100644 --- a/chrome/browser/platform_util_win.cc +++ b/chrome/browser/platform_util_win.cc @@ -204,7 +204,8 @@ std::string GetVersionStringModifier() { bool is_system_install = !InstallUtil::IsPerUserInstall(module.value().c_str()); - GoogleUpdateSettings::GetChromeChannel(is_system_install, &channel); + GoogleUpdateSettings::GetChromeChannelAndModifiers(is_system_install, + &channel); } return UTF16ToASCII(channel); #else @@ -214,20 +215,22 @@ std::string GetVersionStringModifier() { Channel GetChannel() { #if defined(GOOGLE_CHROME_BUILD) - // Call GoogleUpdateSettings::GetChromeChannel with |false| as the first - // argument to avoid having it append "-m" to the channel name, or returning - // "m" for the stable channel. - string16 channel_16; - GoogleUpdateSettings::GetChromeChannel(false, &channel_16); - std::string channel = UTF16ToASCII(channel_16); + std::wstring channel(L"unknown"); + + FilePath module; + if (PathService::Get(base::FILE_MODULE, &module)) { + bool is_system_install = + !InstallUtil::IsPerUserInstall(module.value().c_str()); + channel = GoogleUpdateSettings::GetChromeChannel(is_system_install); + } if (channel.empty()) { return CHANNEL_STABLE; - } else if (channel == "beta") { + } else if (channel == L"beta") { return CHANNEL_BETA; - } else if (channel == "dev") { + } else if (channel == L"dev") { return CHANNEL_DEV; - } else if (channel == "canary") { + } else if (channel == L"canary") { return CHANNEL_CANARY; } #endif |