diff options
author | garykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-06 22:19:14 +0000 |
---|---|---|
committer | garykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-06 22:19:14 +0000 |
commit | ac6eedd1e17ca1f42f60397cacb2762a09cce130 (patch) | |
tree | 55a9b1843fa443be17eba546b5cdfad767c4c842 /remoting/host/continue_window_win.cc | |
parent | 941b58f295d1074b6a65fad5fe90070a46fd8ca9 (diff) | |
download | chromium_src-ac6eedd1e17ca1f42f60397cacb2762a09cce130.zip chromium_src-ac6eedd1e17ca1f42f60397cacb2762a09cce130.tar.gz chromium_src-ac6eedd1e17ca1f42f60397cacb2762a09cce130.tar.bz2 |
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
Diffstat (limited to 'remoting/host/continue_window_win.cc')
-rw-r--r-- | remoting/host/continue_window_win.cc | 31 |
1 files changed, 30 insertions, 1 deletions
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; |