OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_HOST_DISCONNECT_WINDOW_H | 5 #ifndef REMOTING_HOST_DISCONNECT_WINDOW_H_ |
6 #define REMOTING_HOST_DISCONNECT_WINDOW_H | 6 #define REMOTING_HOST_DISCONNECT_WINDOW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 | 12 |
13 namespace remoting { | 13 namespace remoting { |
14 | 14 |
15 class ChromotingHost; | 15 class ChromotingHost; |
16 | 16 |
17 class DisconnectWindow { | 17 class DisconnectWindow { |
18 public: | 18 public: |
19 | |
20 enum { | 19 enum { |
21 kMaximumConnectedNameWidthInPixels = 400 | 20 kMaximumConnectedNameWidthInPixels = 400 |
22 }; | 21 }; |
23 | 22 |
24 // DisconnectCallback is called when the user clicks on the Disconnect button | 23 // DisconnectCallback is called when the user clicks on the Disconnect button |
25 // to disconnect the session. This callback is provided as a parameter to the | 24 // to disconnect the session. This callback is provided as a parameter to the |
26 // Show() method, and will be triggered on the UI thread. | 25 // Show() method, and will be triggered on the UI thread. |
27 typedef base::Callback<void(void)> DisconnectCallback; | 26 typedef base::Callback<void(void)> DisconnectCallback; |
28 | 27 |
29 virtual ~DisconnectWindow() {} | 28 virtual ~DisconnectWindow() {} |
30 | 29 |
31 // Show the disconnect window allowing the user to shut down |host|. | 30 // Show the disconnect window allowing the user to shut down |host|. |
32 virtual void Show(ChromotingHost* host, | 31 virtual void Show(ChromotingHost* host, |
33 const DisconnectCallback& disconnect_callback, | 32 const DisconnectCallback& disconnect_callback, |
34 const std::string& username) = 0; | 33 const std::string& username) = 0; |
35 | 34 |
36 // Hide the disconnect window. | 35 // Hide the disconnect window. |
37 virtual void Hide() = 0; | 36 virtual void Hide() = 0; |
38 | 37 |
39 static scoped_ptr<DisconnectWindow> Create(); | 38 static scoped_ptr<DisconnectWindow> Create(); |
40 }; | 39 }; |
41 | 40 |
42 } | 41 } // namespace remoting |
43 | 42 |
44 #endif // REMOTING_HOST_DISCONNECT_WINDOW_H | 43 #endif // REMOTING_HOST_DISCONNECT_WINDOW_H_ |
OLD | NEW |