Index: remoting/host/continue_window.h |
diff --git a/remoting/host/continue_window.h b/remoting/host/continue_window.h |
index fa1ae2588fbfcf96463843717d7ffadd4e25f9e0..478cf0c324774dcf56127beaf187ae95d038389b 100644 |
--- a/remoting/host/continue_window.h |
+++ b/remoting/host/continue_window.h |
@@ -5,30 +5,50 @@ |
#ifndef REMOTING_HOST_CONTINUE_WINDOW_H_ |
#define REMOTING_HOST_CONTINUE_WINDOW_H_ |
-#include "base/callback.h" |
+#include "base/basictypes.h" |
+#include "base/memory/weak_ptr.h" |
+#include "base/timer.h" |
+#include "remoting/host/host_window.h" |
namespace remoting { |
-struct UiStrings; |
- |
-class ContinueWindow { |
+class ContinueWindow : public HostWindow { |
public: |
- // ContinueSessionCallback is called when the user clicks on the |
- // Continue button to resume the session, or dismisses the window to |
- // terminate the session. This callback is provided as a parameter to the |
- // Show() method, and will be triggered on the UI thread. |
- typedef base::Callback<void(bool)> ContinueSessionCallback; |
+ virtual ~ContinueWindow(); |
+ |
+ // HostWindow override. |
+ virtual void Start( |
+ const base::WeakPtr<ClientSessionControl>& client_session_control) |
+ OVERRIDE; |
+ |
+ // Resumes paused client session. |
+ void ContinueSession(); |
+ |
+ // Disconnects the client session. |
+ void DisconnectSession(); |
+ |
+ protected: |
+ ContinueWindow(); |
+ |
+ // Shows and hides the UI. |
+ virtual void ShowUi() = 0; |
+ virtual void HideUi() = 0; |
+ |
+ private: |
+ // Invoked periodically to ask for the local user whether the session should |
+ // be continued. |
+ void OnSessionExpired(); |
- virtual ~ContinueWindow() {} |
+ // Used to disconnect the client session. |
+ base::WeakPtr<ClientSessionControl> client_session_control_; |
- // Show the continuation window requesting that the user approve continuing |
- // the session. |
- virtual void Show(const ContinueSessionCallback& callback) = 0; |
+ // Used to disconnect the client session when timeout expires. |
+ base::OneShotTimer<ContinueWindow> disconnect_timer_; |
- // Hide the continuation window if it is visible. |
- virtual void Hide() = 0; |
+ // Used to ask the local user whether the session should be continued. |
+ base::OneShotTimer<ContinueWindow> session_expired_timer_; |
- static scoped_ptr<ContinueWindow> Create(const UiStrings* ui_strings); |
+ DISALLOW_COPY_AND_ASSIGN(ContinueWindow); |
}; |
} // namespace remoting |