OLD | NEW |
| (Empty) |
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_IT2ME_HOST_USER_INTERFACE_H_ | |
6 #define REMOTING_HOST_IT2ME_HOST_USER_INTERFACE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "base/callback.h" | |
12 #include "base/compiler_specific.h" | |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/memory/weak_ptr.h" | |
15 | |
16 #include "remoting/host/host_user_interface.h" | |
17 | |
18 namespace remoting { | |
19 | |
20 class ContinueWindow; | |
21 | |
22 // This class implements the IT2Me-specific parts of the ChromotingHost: | |
23 // Disconnect and Continue window popups. | |
24 // IT2Me-specific handling of multiple connection attempts. | |
25 class It2MeHostUserInterface : public HostUserInterface { | |
26 public: | |
27 It2MeHostUserInterface( | |
28 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner, | |
29 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | |
30 const UiStrings& ui_strings); | |
31 virtual ~It2MeHostUserInterface(); | |
32 | |
33 // HostUserInterface overrides. | |
34 virtual void Init() OVERRIDE; | |
35 | |
36 protected: | |
37 virtual void ProcessOnClientAuthenticated( | |
38 const std::string& username) OVERRIDE; | |
39 virtual void ProcessOnClientDisconnected() OVERRIDE; | |
40 | |
41 // Provide a user interface requiring the user to periodically re-confirm | |
42 // the connection. | |
43 scoped_ptr<ContinueWindow> continue_window_; | |
44 | |
45 private: | |
46 class TimerTask; | |
47 | |
48 // Called by the ContinueWindow implementation (on the UI thread) when the | |
49 // user dismisses the Continue prompt. | |
50 void ContinueSession(bool continue_session); | |
51 void OnContinueWindowTimer(); | |
52 void OnShutdownHostTimer(); | |
53 | |
54 // Show or hide the Continue Sharing window on the UI thread. | |
55 void ShowContinueWindow(bool show); | |
56 void StartContinueWindowTimer(bool start); | |
57 | |
58 // Weak pointer factory used to abandon the "continue session" timer when | |
59 // hiding the "continue session" dialog, or tearing down the IT2Me UI. | |
60 base::WeakPtrFactory<It2MeHostUserInterface> timer_weak_factory_; | |
61 | |
62 DISALLOW_COPY_AND_ASSIGN(It2MeHostUserInterface); | |
63 }; | |
64 | |
65 } // namespace remoting | |
66 | |
67 #endif // REMOTING_HOST_IT2ME_HOST_USER_INTERFACE_H_ | |
OLD | NEW |