Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / remoting / host / continue_window.h
blob4a48e16358ba7da6c22ad54e2fcfaf54ea5a411c
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef REMOTING_HOST_CONTINUE_WINDOW_H_
6 #define REMOTING_HOST_CONTINUE_WINDOW_H_
8 #include "base/basictypes.h"
9 #include "base/memory/weak_ptr.h"
10 #include "base/timer/timer.h"
11 #include "remoting/host/host_window.h"
13 namespace remoting {
15 class ContinueWindow : public HostWindow {
16 public:
17 virtual ~ContinueWindow();
19 // HostWindow override.
20 virtual void Start(
21 const base::WeakPtr<ClientSessionControl>& client_session_control)
22 OVERRIDE;
24 // Resumes paused client session.
25 void ContinueSession();
27 // Disconnects the client session.
28 void DisconnectSession();
30 protected:
31 ContinueWindow();
33 // Shows and hides the UI.
34 virtual void ShowUi() = 0;
35 virtual void HideUi() = 0;
37 private:
38 // Invoked periodically to ask for the local user whether the session should
39 // be continued.
40 void OnSessionExpired();
42 // Used to disconnect the client session.
43 base::WeakPtr<ClientSessionControl> client_session_control_;
45 // Used to disconnect the client session when timeout expires.
46 base::OneShotTimer<ContinueWindow> disconnect_timer_;
48 // Used to ask the local user whether the session should be continued.
49 base::OneShotTimer<ContinueWindow> session_expired_timer_;
51 DISALLOW_COPY_AND_ASSIGN(ContinueWindow);
54 } // namespace remoting
56 #endif // REMOTING_HOST_CONTINUE_WINDOW_H_