Chromium Code Reviews| Index: remoting/host/desktop_environment.cc |
| diff --git a/remoting/host/desktop_environment.cc b/remoting/host/desktop_environment.cc |
| index c838a0f2c187ab463b7cbf5ffc21e1e177623717..48db5f114636b775680025326315c45520c3e656 100644 |
| --- a/remoting/host/desktop_environment.cc |
| +++ b/remoting/host/desktop_environment.cc |
| @@ -108,8 +108,6 @@ void DesktopEnvironment::OnLastDisconnect() { |
| } |
| void DesktopEnvironment::OnPause(bool pause) { |
| - ui_thread_proxy_.PostTask(FROM_HERE, base::Bind( |
| - &DesktopEnvironment::ProcessOnPause, base::Unretained(this), pause)); |
| } |
| void DesktopEnvironment::ProcessOnConnect(const std::string& username) { |
| @@ -129,13 +127,6 @@ void DesktopEnvironment::ProcessOnLastDisconnect() { |
| StartContinueWindowTimer(false); |
| } |
| -void DesktopEnvironment::ProcessOnPause(bool pause) { |
| - if (!pause) { |
| - timer_task_.reset(); |
| - StartContinueWindowTimer(true); |
| - } |
| -} |
| - |
| void DesktopEnvironment::MonitorLocalInputs(bool enable) { |
| DCHECK(context_->ui_message_loop()->BelongsToCurrentThread()); |
| @@ -164,12 +155,25 @@ void DesktopEnvironment::ShowContinueWindow(bool show) { |
| DCHECK(context_->ui_message_loop()->BelongsToCurrentThread()); |
| if (show) { |
| - continue_window_->Show(host_); |
| + continue_window_->Show(host_, base::Bind( |
| + &DesktopEnvironment::ContinueSession, base::Unretained(this))); |
|
Wez
2011/11/23 18:26:02
The intent is for ShowContinueWindow() and Continu
Lambros
2011/11/23 19:39:28
Yep.
|
| } else { |
| continue_window_->Hide(); |
| } |
| } |
| +void DesktopEnvironment::ContinueSession(bool continue_session) { |
| + DCHECK(context_->ui_message_loop()->BelongsToCurrentThread()); |
| + |
| + if (continue_session) { |
| + host_->PauseSession(false); |
| + timer_task_.reset(); |
| + StartContinueWindowTimer(true); |
| + } else { |
| + host_->Shutdown(base::Closure()); |
|
Wez
2011/11/23 18:26:02
Shouldn't this be a call to OnShutdownHostTimer(),
Lambros
2011/11/23 19:39:28
It could be. I simply copied the implementation s
|
| + } |
| +} |
| + |
| void DesktopEnvironment::StartContinueWindowTimer(bool start) { |
| DCHECK(context_->ui_message_loop()->BelongsToCurrentThread()); |