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 | |
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')
-rw-r--r-- | remoting/host/continue_window_win.cc | 31 | ||||
-rw-r--r-- | remoting/host/plugin/host_plugin.rc | 9 | ||||
-rw-r--r-- | remoting/host/plugin/host_plugin_resource.h | 5 |
3 files changed, 38 insertions, 7 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; diff --git a/remoting/host/plugin/host_plugin.rc b/remoting/host/plugin/host_plugin.rc index ca17d81..173e88f 100644 --- a/remoting/host/plugin/host_plugin.rc +++ b/remoting/host/plugin/host_plugin.rc @@ -103,13 +103,14 @@ BEGIN END
IDD_CONTINUE DIALOGEX 0, 0, 221, 58
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
EXSTYLE WS_EX_TOPMOST
-CAPTION "Continue Sharing"
+CAPTION "kTitle"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- DEFPUSHBUTTON "Yes, continue sharing",IDC_CONTINUE,61,38,90,14
- LTEXT "You are currently sharing this machine with another user. Please confirm that you want to continue sharing.",IDC_CONTINUE_TEXT,7,7,201,30
+ DEFPUSHBUTTON "kDefault",IDC_CONTINUE_DEFAULT,117,38,69,14
+ LTEXT "kMessage",IDC_CONTINUE_MESSAGE,7,7,207,30
+ PUSHBUTTON "kCancel",IDC_CONTINUE_CANCEL,33,38,69,14
END
diff --git a/remoting/host/plugin/host_plugin_resource.h b/remoting/host/plugin/host_plugin_resource.h index 67f33a3..de91dab 100644 --- a/remoting/host/plugin/host_plugin_resource.h +++ b/remoting/host/plugin/host_plugin_resource.h @@ -7,8 +7,9 @@ #define IDC_DISCONNECT 1001 #define IDC_DISCONNECT_SHARINGWITH 1002 #define IDC_DISCONNECT_USERNAME 1003 -#define IDC_CONTINUE_TEXT 1004 -#define IDC_CONTINUE 1005 +#define IDC_CONTINUE_MESSAGE 1004 +#define IDC_CONTINUE_DEFAULT 1005 +#define IDC_CONTINUE_CANCEL 1007 // Next default values for new objects // |