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 struct UiStrings; | 15 struct UiStrings; |
16 | 16 |
17 class DisconnectWindow { | 17 class DisconnectWindow { |
18 public: | 18 public: |
19 enum { | 19 enum { |
20 kMaximumConnectedNameWidthInPixels = 400 | 20 kMaximumConnectedNameWidthInPixels = 400 |
21 }; | 21 }; |
22 | 22 |
23 virtual ~DisconnectWindow() {} | 23 virtual ~DisconnectWindow() {} |
24 | 24 |
25 // Shows the disconnect window, allowing the user to disconnect the session. | 25 // Shows the disconnect window, allowing the user to disconnect the session. |
26 // The window will display text from |ui_strings| and |username|. | |
27 // |disconnect_callback| will be invoked on the calling UI thread when the | 26 // |disconnect_callback| will be invoked on the calling UI thread when the |
28 // user chooses to disconnect, or if the window is closed by any means other | 27 // user chooses to disconnect, or if the window is closed by any means other |
29 // than Hide(), or deletion of the DisconnectWindow instance. | 28 // than Hide(), or deletion of the DisconnectWindow instance. |
30 // Show returns false if the window cannot be shown, in which case the | 29 // Show returns false if the window cannot be shown, in which case the |
31 // callback will not be invoked. | 30 // callback will not be invoked. |
32 virtual bool Show(const UiStrings& ui_strings, | 31 virtual bool Show(const base::Closure& disconnect_callback, |
33 const base::Closure& disconnect_callback, | |
34 const std::string& username) = 0; | 32 const std::string& username) = 0; |
35 | 33 |
36 // Hides the disconnect window. The disconnect callback will not be invoked. | 34 // Hides the disconnect window. The disconnect callback will not be invoked. |
37 virtual void Hide() = 0; | 35 virtual void Hide() = 0; |
38 | 36 |
39 static scoped_ptr<DisconnectWindow> Create(); | 37 // |ui_strings| specifies localized strings to be used by the window. |
| 38 // |ui_strings| must outlive the returned object. |
| 39 static scoped_ptr<DisconnectWindow> Create(const UiStrings* ui_strings); |
40 }; | 40 }; |
41 | 41 |
42 } // namespace remoting | 42 } // namespace remoting |
43 | 43 |
44 #endif // REMOTING_HOST_DISCONNECT_WINDOW_H_ | 44 #endif // REMOTING_HOST_DISCONNECT_WINDOW_H_ |
OLD | NEW |