summaryrefslogtreecommitdiffstats
path: root/remoting/host/desktop_environment.cc
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/host/desktop_environment.cc')
-rw-r--r--remoting/host/desktop_environment.cc24
1 files changed, 14 insertions, 10 deletions
diff --git a/remoting/host/desktop_environment.cc b/remoting/host/desktop_environment.cc
index c838a0f..48db5f1 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)));
} 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());
+ }
+}
+
void DesktopEnvironment::StartContinueWindowTimer(bool start) {
DCHECK(context_->ui_message_loop()->BelongsToCurrentThread());