summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/about_chrome_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/views/about_chrome_view.cc')
-rwxr-xr-xchrome/browser/views/about_chrome_view.cc81
1 files changed, 6 insertions, 75 deletions
diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc
index 9877ec2..0e8b79c 100755
--- a/chrome/browser/views/about_chrome_view.cc
+++ b/chrome/browser/views/about_chrome_view.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/common/platform_util.h"
#include "chrome/common/url_constants.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -62,74 +63,6 @@ std::wstring StringSubRange(const std::wstring& text, size_t start,
return text.substr(start, end - start);
}
-#if defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN)
-
-// Constants copied from src/tools/channel_changer/channel_changer.cc.
-
-// The Google Update key to read to find out which branch you are on.
-const wchar_t* const kChromeClientStateKey =
- L"Software\\Google\\Update\\ClientState\\"
- L"{8A69D345-D564-463C-AFF1-A69D9E530F96}";
-
-// The Google Client key to read to find out which branch you are on.
-const wchar_t* const kChromeClientsKey =
- L"Software\\Google\\Update\\Clients\\"
- L"{8A69D345-D564-463C-AFF1-A69D9E530F96}";
-
-// The Google Update value that defines which branch you are on.
-const wchar_t* const kBranchKey = L"ap";
-
-// The suffix Google Update sometimes adds to the channel name (channel names
-// are defined in kBranchStrings), indicating that a full install is needed. We
-// strip this out (if present) for the purpose of determining which channel you
-// are on.
-const wchar_t* const kChannelSuffix = L"-full";
-
-// See DetectBranch() in src/tools/channel_changer/channel_changer.cc.
-std::wstring CurrentChromeChannel() {
- std::wstring update_branch = L"stable"; // default if we get confused.
-
- // See if we can find the Clients key on the HKLM branch.
- HKEY registry_hive = HKEY_LOCAL_MACHINE;
- RegKey google_update_hklm(registry_hive, kChromeClientsKey, KEY_READ);
- if (!google_update_hklm.Valid()) {
- // HKLM failed us, try the same for the HKCU branch.
- registry_hive = HKEY_CURRENT_USER;
- RegKey google_update_hkcu(registry_hive, kChromeClientsKey, KEY_READ);
- if (!google_update_hkcu.Valid()) {
- // Unknown.
- registry_hive = 0;
- }
- }
-
- if (registry_hive != 0) {
- // Now that we know which hive to use, read the 'ap' key from it.
- RegKey client_state(registry_hive, kChromeClientStateKey, KEY_READ);
- client_state.ReadValue(kBranchKey, &update_branch);
-
- // We look for '1.1-beta' or '1.1-dev', but Google Update might have added
- // '-full' to the channel name, which we need to strip out to determine what
- // channel you are on.
- std::wstring suffix = kChannelSuffix;
- if (update_branch.length() > suffix.length()) {
- size_t index = update_branch.rfind(suffix);
- if (index != std::wstring::npos &&
- index == update_branch.length() - suffix.length()) {
- update_branch = update_branch.substr(0, index);
- }
- }
- }
-
- // Map to something pithy for human consumption.
- if ((update_branch == L"2.0-dev") ||(update_branch == L"1.1-dev"))
- update_branch = L"dev";
- else if (update_branch == L"1.1-beta")
- update_branch = L"beta";
-
- return update_branch;
-}
-#endif /* GOOGLE_CHROME_BUILD && OS_WIN */
-
} // namespace
namespace browser {
@@ -203,17 +136,15 @@ void AboutChromeView::Init() {
return;
}
+ string16 version_modifier = platform_util::GetVersionStringModifier();
+ if (version_modifier.length()) {
+ current_version_ += L" ";
+ current_version_ += UTF16ToWide(version_modifier);
+ }
current_version_ = version_info->file_version();
-#if defined(GOOGLE_CHROME_BUILD)
-#if defined(OS_WIN)
- current_version_ += L" ";
- current_version_ += CurrentChromeChannel();
-#endif
-#else
current_version_ += L" (";
current_version_ += version_info->last_change();
current_version_ += L")";
-#endif
// Views we will add to the *parent* of this dialog, since it will display
// next to the buttons which we don't draw ourselves.