diff options
author | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-23 23:39:50 +0000 |
---|---|---|
committer | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-23 23:39:50 +0000 |
commit | 1bafb3c7bef6bced676f2aa1988c58c61a57819e (patch) | |
tree | 60e9deaafa1898748c4a62207d762a2322cb2ce4 /remoting/host/continue_window_win.cc | |
parent | a048700eaea16ce65f9e13208db7cf406a13b48f (diff) | |
download | chromium_src-1bafb3c7bef6bced676f2aa1988c58c61a57819e.zip chromium_src-1bafb3c7bef6bced676f2aa1988c58c61a57819e.tar.gz chromium_src-1bafb3c7bef6bced676f2aa1988c58c61a57819e.tar.bz2 |
Refactor ContinueWindow::Show() to accept a callback parameter.
This gets rid of the DesktopEnvironment::OnPause() notification from the Host.
Instead, that code is moved to DesktopEnvironment::ContinueSession() and
provided as a callback function parameter to ContinueWindow::Show().
This will simplify a future CL to move the ContinueWindow/DisconnectWindow code
into an IT2Me-specific HostObserver subclass.
BUG=None
TEST=No change in functionality.
Review URL: http://codereview.chromium.org/8624009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111443 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/continue_window_win.cc')
-rw-r--r-- | remoting/host/continue_window_win.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/remoting/host/continue_window_win.cc b/remoting/host/continue_window_win.cc index 73a214a..190cc42 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, |