From bf974e15691b9a0477b776faafe426eeed271685 Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Fri, 21 Oct 2011 04:14:03 +0000 Subject: Always show continue window. Problem was that the timer function was checking Time::Now() to verify whether it should run or not. On some systems the task may be called several milliseconds before the target time, which means that Time::Now() would return time before |continue_timer_target_time_| and the window wouldn't show. BUG=100729 TEST=Continue windows shows every time. Review URL: http://codereview.chromium.org/8366011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106672 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/host/desktop_environment.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'remoting/host/desktop_environment.h') diff --git a/remoting/host/desktop_environment.h b/remoting/host/desktop_environment.h index e0ed196..31335f5 100644 --- a/remoting/host/desktop_environment.h +++ b/remoting/host/desktop_environment.h @@ -58,11 +58,7 @@ class DesktopEnvironment { void OnPause(bool pause); private: - enum ContinueTimerState { - INACTIVE, // The timer is not running or has been cancelled. - SHOW_DIALOG, // Show the continue dialog when the timer expires. - SHUTDOWN_HOST // Shutdown the Chromoting host when the timer expires. - }; + class TimerTask; void ProcessOnConnect(const std::string& username); void ProcessOnLastDisconnect(); @@ -79,7 +75,8 @@ class DesktopEnvironment { void StartContinueWindowTimer(bool start); - void ContinueWindowTimerFunc(); + void OnContinueWindowTimer(); + void OnShutdownHostTimer(); // The host that owns this DesktopEnvironment. ChromotingHost* host_; @@ -111,8 +108,7 @@ class DesktopEnvironment { bool is_monitoring_local_inputs_; // Timer controlling the "continue session" dialog. - ContinueTimerState continue_timer_state_; - base::Time continue_timer_target_time_; + scoped_ptr timer_task_; ScopedThreadProxy ui_thread_proxy_; -- cgit v1.1