From ac6eedd1e17ca1f42f60397cacb2762a09cce130 Mon Sep 17 00:00:00 2001 From: "garykac@google.com" Date: Wed, 6 Jul 2011 22:19:14 +0000 Subject: Cleanup Chromoting's Continue window: * Add Cancel button (to disconnect) * Update to use shared strings (rather than from win-specific template) BUG=87459 TEST=manual Review URL: http://codereview.chromium.org/7232033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91619 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/host/continue_window_win.cc | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'remoting/host/continue_window_win.cc') diff --git a/remoting/host/continue_window_win.cc b/remoting/host/continue_window_win.cc index 8826e88..08a6b72 100644 --- a/remoting/host/continue_window_win.cc +++ b/remoting/host/continue_window_win.cc @@ -8,6 +8,7 @@ #include "base/compiler_specific.h" #include "base/logging.h" +#include "base/utf_string_conversions.h" #include "remoting/host/chromoting_host.h" // TODO(wez): The DisconnectWindow isn't plugin-specific, so shouldn't have // a dependency on the plugin's resource header. @@ -77,6 +78,26 @@ BOOL ContinueWindowWin::OnDialogMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_INITDIALOG: + { + // Update UI string placeholders with actual strings. + std::wstring w_title = UTF8ToWide(kTitle); + SetWindowText(hwnd, w_title.c_str()); + + HWND hwndMessage = GetDlgItem(hwnd, IDC_CONTINUE_MESSAGE); + CHECK(hwndMessage); + std::wstring w_message = UTF8ToWide(kMessage); + SetWindowText(hwndMessage, w_message.c_str()); + + HWND hwndDefault = GetDlgItem(hwnd, IDC_CONTINUE_DEFAULT); + CHECK(hwndDefault); + std::wstring w_default = UTF8ToWide(kDefaultButtonText); + SetWindowText(hwndDefault, w_default.c_str()); + + HWND hwndCancel = GetDlgItem(hwnd, IDC_CONTINUE_CANCEL); + CHECK(hwndCancel); + std::wstring w_cancel = UTF8ToWide(kCancelButtonText); + SetWindowText(hwndCancel, w_cancel.c_str()); + } return TRUE; case WM_CLOSE: // Ignore close messages. @@ -87,7 +108,7 @@ BOOL ContinueWindowWin::OnDialogMessage(HWND hwnd, UINT msg, return TRUE; case WM_COMMAND: switch (LOWORD(wParam)) { - case IDC_CONTINUE: + case IDC_CONTINUE_DEFAULT: { CHECK(host_); host_->PauseSession(false); @@ -95,6 +116,14 @@ BOOL ContinueWindowWin::OnDialogMessage(HWND hwnd, UINT msg, hwnd_ = NULL; } return TRUE; + case IDC_CONTINUE_CANCEL: + { + CHECK(host_); + host_->Shutdown(NULL); + ::EndDialog(hwnd, LOWORD(wParam)); + hwnd_ = NULL; + } + return TRUE; } } return FALSE; -- cgit v1.1