Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1092)

Unified Diff: remoting/host/continue_window.h

Issue 13461029: The continue window is owned by the desktop environment now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698