summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-09 01:00:18 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-09 01:00:18 +0000
commit7ffe3aae33df556c298680c8754b76578e93c9eb (patch)
tree84abf8c86167477f83db6f707ca473ca7bb456d3 /chrome/common
parent4ad58c3ee09c10358c86990e5a0f51087cc56fef (diff)
downloadchromium_src-7ffe3aae33df556c298680c8754b76578e93c9eb.zip
chromium_src-7ffe3aae33df556c298680c8754b76578e93c9eb.tar.gz
chromium_src-7ffe3aae33df556c298680c8754b76578e93c9eb.tar.bz2
Per discussion with mal, recognize the stable branch (parent regkey
present but no 'ap' child). Also made recognizing beta/dev a touch more general. BUG=31772 Review URL: http://codereview.chromium.org/534005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35857 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/platform_util_win.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/common/platform_util_win.cc b/chrome/common/platform_util_win.cc
index 01f1efb..9b786c2 100644
--- a/chrome/common/platform_util_win.cc
+++ b/chrome/common/platform_util_win.cc
@@ -184,17 +184,23 @@ std::wstring CurrentChromeChannel() {
std::wstring(L"\\") + google_update::kChromeUpgradeCode;
RegKey client_state(registry_hive, key.c_str(), KEY_READ);
client_state.ReadValue(google_update::kRegApField, &update_branch);
+ // If the parent folder exists (we have a valid install) but the
+ // 'ap' key is empty, we necessarily are the stable channel.
+ if (update_branch.empty() && client_state.Valid()) {
+ update_branch = L"stable";
+ }
}
// Map to something pithy for human consumption. There are no rules as to
// what the ap string can contain, but generally it will contain a number
// followed by a dash followed by the branch name (and then some random
- // suffix). We fall back on empty string, in case we fail to parse (or the
- // branch is stable).
+ // suffix). We fall back on empty string in case we fail to parse.
if (update_branch.find(L"-beta") != std::wstring::npos)
update_branch = L"beta";
else if (update_branch.find(L"-dev") != std::wstring::npos)
update_branch = L"dev";
+ else if (update_branch.find(L"stable") != std::wstring::npos)
+ update_branch = L"stable";
else
update_branch = L"";