aed28635fd3c2fb0e25f8984a957c5f09c493b04
[platform/framework/web/crosswalk.git] / src / remoting / host / continue_window.h
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.
4
5 #ifndef REMOTING_HOST_CONTINUE_WINDOW_H_
6 #define REMOTING_HOST_CONTINUE_WINDOW_H_
7
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"
12
13 namespace remoting {
14
15 class ContinueWindow : public HostWindow {
16  public:
17   ~ContinueWindow() override;
18
19   // HostWindow override.
20   void Start(const base::WeakPtr<ClientSessionControl>& client_session_control)
21       override;
22
23   // Resumes paused client session.
24   void ContinueSession();
25
26   // Disconnects the client session.
27   void DisconnectSession();
28
29  protected:
30   ContinueWindow();
31
32   // Shows and hides the UI.
33   virtual void ShowUi() = 0;
34   virtual void HideUi() = 0;
35
36  private:
37   // Invoked periodically to ask for the local user whether the session should
38   // be continued.
39   void OnSessionExpired();
40
41   // Used to disconnect the client session.
42   base::WeakPtr<ClientSessionControl> client_session_control_;
43
44   // Used to disconnect the client session when timeout expires.
45   base::OneShotTimer<ContinueWindow> disconnect_timer_;
46
47   // Used to ask the local user whether the session should be continued.
48   base::OneShotTimer<ContinueWindow> session_expired_timer_;
49
50   DISALLOW_COPY_AND_ASSIGN(ContinueWindow);
51 };
52
53 }  // namespace remoting
54
55 #endif  // REMOTING_HOST_CONTINUE_WINDOW_H_