summaryrefslogtreecommitdiffstats
path: root/tools/channel_changer/channel_changer.cc
diff options
context:
space:
mode:
authorlaforge@chromium.org <laforge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-16 20:38:23 +0000
committerlaforge@chromium.org <laforge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-16 20:38:23 +0000
commitaff7d1eedc285ee2c60c087e01475efb51c660b3 (patch)
treecfd27ca5ed5b8d72dfc9ac21664e053cc2de9781 /tools/channel_changer/channel_changer.cc
parent2009148f6442bfe96170f3651ebfe99ac65eaec4 (diff)
downloadchromium_src-aff7d1eedc285ee2c60c087e01475efb51c660b3.zip
chromium_src-aff7d1eedc285ee2c60c087e01475efb51c660b3.tar.gz
chromium_src-aff7d1eedc285ee2c60c087e01475efb51c660b3.tar.bz2
Google Chrome Channel Changer - Minor update to add stable channel, some updates to text description.
Review URL: http://codereview.chromium.org/14455 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7090 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/channel_changer/channel_changer.cc')
-rw-r--r--tools/channel_changer/channel_changer.cc23
1 files changed, 17 insertions, 6 deletions
diff --git a/tools/channel_changer/channel_changer.cc b/tools/channel_changer/channel_changer.cc
index 4f9365e..1246200 100644
--- a/tools/channel_changer/channel_changer.cc
+++ b/tools/channel_changer/channel_changer.cc
@@ -13,20 +13,23 @@ enum Branch {
UNKNOWN_BRANCH = 0,
DEV_BRANCH,
BETA_BRANCH,
+ STABLE_BRANCH,
};
// This vector of strings needs to be in sync with the Branch enum above.
static const wchar_t* const kBranchStrings[] = {
L"",
L"1.1-dev",
- L"1.1-beta"
+ L"1.1-beta",
+ L"",
};
// This vector of strings needs to be in sync with the Branch enum above.
static const wchar_t* const kBranchStringsReadable[] = {
L"",
L"Dev",
- L"Beta"
+ L"Beta",
+ L"Stable",
};
// The root key for Google Update.
@@ -51,7 +54,7 @@ static HICON dlg_icon = NULL;
void SetMainLabel(HWND dialog, Branch branch) {
std::wstring main_label = L"You are currently on ";
- if (branch == DEV_BRANCH || branch == BETA_BRANCH)
+ if (branch == DEV_BRANCH || branch == BETA_BRANCH || branch == STABLE_BRANCH)
main_label += std::wstring(L"the ") + kBranchStringsReadable[branch] +
std::wstring(L" channel");
else
@@ -72,7 +75,7 @@ void OnInitDialog(HWND dialog) {
!google_update.ReadValue(kBranchKey, &branch_string)) {
// If the 'ap' value is missing, we create it, unless the key is missing.
RegKey write_default(kGoogleUpdateRoot, kGoogleUpdateKey, KEY_WRITE);
- branch_string = kBranchStrings[BETA_BRANCH];
+ branch_string = kBranchStrings[STABLE_BRANCH];
if (!write_default.WriteValue(kBranchKey, branch_string.c_str()))
branch_string = L""; // Error, show disabled UI.
}
@@ -90,7 +93,9 @@ void OnInitDialog(HWND dialog) {
}
Branch branch = UNKNOWN_BRANCH;
- if (branch_string == kBranchStrings[DEV_BRANCH]) {
+ if (branch_string == kBranchStrings[STABLE_BRANCH]) {
+ branch = STABLE_BRANCH;
+ } else if (branch_string == kBranchStrings[DEV_BRANCH]) {
branch = DEV_BRANCH;
} else if (branch_string == kBranchStrings[BETA_BRANCH]) {
branch = BETA_BRANCH;
@@ -98,6 +103,7 @@ void OnInitDialog(HWND dialog) {
// Hide the controls we can't use.
EnableWindow(GetDlgItem(dialog, IDOK), false);
EnableWindow(GetDlgItem(dialog, IDC_STABLE), false);
+ EnableWindow(GetDlgItem(dialog, IDC_BETA), false);
EnableWindow(GetDlgItem(dialog, IDC_CUTTING_EDGE), false);
MessageBox(dialog, L"KEY NOT FOUND\n\nChrome is not installed, or is not "
@@ -109,9 +115,11 @@ void OnInitDialog(HWND dialog) {
SetMainLabel(dialog, branch);
CheckDlgButton(dialog, IDC_STABLE,
- branch == BETA_BRANCH ? BST_CHECKED : BST_UNCHECKED);
+ branch == STABLE_BRANCH ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(dialog, IDC_CUTTING_EDGE,
branch == DEV_BRANCH ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(dialog, IDC_BETA,
+ branch == BETA_BRANCH ? BST_CHECKED : BST_UNCHECKED);
}
INT_PTR OnCtlColorStatic(HWND dialog, WPARAM wparam, LPARAM lparam) {
@@ -119,6 +127,7 @@ INT_PTR OnCtlColorStatic(HWND dialog, WPARAM wparam, LPARAM lparam) {
HWND control_wnd = reinterpret_cast<HWND>(lparam);
if (GetDlgItem(dialog, IDC_STABLE) == control_wnd ||
+ GetDlgItem(dialog, IDC_BETA) == control_wnd ||
GetDlgItem(dialog, IDC_CUTTING_EDGE) == control_wnd ||
GetDlgItem(dialog, IDC_LABEL_MAIN) == control_wnd ||
GetDlgItem(dialog, IDC_SECONDARY_LABEL) == control_wnd) {
@@ -133,6 +142,8 @@ INT_PTR OnCtlColorStatic(HWND dialog, WPARAM wparam, LPARAM lparam) {
void SaveChanges(HWND dialog) {
Branch branch = UNKNOWN_BRANCH;
if (IsDlgButtonChecked(dialog, IDC_STABLE))
+ branch = STABLE_BRANCH;
+ else if (IsDlgButtonChecked(dialog, IDC_BETA))
branch = BETA_BRANCH;
else if (IsDlgButtonChecked(dialog, IDC_CUTTING_EDGE))
branch = DEV_BRANCH;