Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Unified Diff: remoting/host/continue_window_win.cc

Issue 8624009: Refactor ContinueWindow::Show() to accept a callback parameter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Mac compile Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/host/continue_window_win.cc
diff --git a/remoting/host/continue_window_win.cc b/remoting/host/continue_window_win.cc
index 73a214a7882b56ac68dbbc2f15e8a3d092f13624..190cc42e16f1146d554946ebfadbe269a2c46336 100644
--- a/remoting/host/continue_window_win.cc
+++ b/remoting/host/continue_window_win.cc
@@ -32,7 +32,8 @@ class ContinueWindowWin : public ContinueWindow {
ContinueWindowWin();
virtual ~ContinueWindowWin();
- virtual void Show(remoting::ChromotingHost* host) OVERRIDE;
+ virtual void Show(remoting::ChromotingHost* host,
+ const ContinueSessionCallback& callback) OVERRIDE;
virtual void Hide() OVERRIDE;
private:
@@ -45,6 +46,7 @@ class ContinueWindowWin : public ContinueWindow {
void SetStrings(const UiStrings& strings);
remoting::ChromotingHost* host_;
+ ContinueSessionCallback callback_;
HWND hwnd_;
DISALLOW_COPY_AND_ASSIGN(ContinueWindowWin);
@@ -88,14 +90,12 @@ BOOL ContinueWindowWin::OnDialogMessage(HWND hwnd, UINT msg,
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_CONTINUE_DEFAULT:
- CHECK(host_);
- host_->PauseSession(false);
+ callback_.Run(true);
::EndDialog(hwnd, LOWORD(wParam));
hwnd_ = NULL;
return TRUE;
case IDC_CONTINUE_CANCEL:
- CHECK(host_);
- host_->Shutdown(base::Closure());
+ callback_.Run(false);
::EndDialog(hwnd, LOWORD(wParam));
hwnd_ = NULL;
return TRUE;
@@ -104,8 +104,10 @@ BOOL ContinueWindowWin::OnDialogMessage(HWND hwnd, UINT msg,
return FALSE;
}
-void ContinueWindowWin::Show(ChromotingHost* host) {
+void ContinueWindowWin::Show(ChromotingHost* host,
+ const ContinueSessionCallback& callback) {
host_ = host;
+ callback_ = callback;
CHECK(!hwnd_);
hwnd_ = CreateDialogParam(g_hModule, MAKEINTRESOURCE(IDD_CONTINUE), NULL,

Powered by Google App Engine
This is Rietveld 408576698