OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_HOST_WINDOW_H_ | 5 #ifndef REMOTING_HOST_HOST_WINDOW_H_ |
6 #define REMOTING_HOST_HOST_WINDOW_H_ | 6 #define REMOTING_HOST_HOST_WINDOW_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
12 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
13 | 14 |
14 namespace remoting { | 15 namespace remoting { |
15 | 16 |
16 class ClientSessionControl; | 17 class ClientSessionControl; |
17 | 18 |
18 class HostWindow : public base::NonThreadSafe { | 19 class HostWindow : public base::NonThreadSafe { |
19 public: | 20 public: |
20 virtual ~HostWindow() {} | 21 virtual ~HostWindow() {} |
21 | 22 |
22 // Creates a platform-specific instance of the continue window. | 23 // Creates a platform-specific instance of the continue window. |
23 static scoped_ptr<HostWindow> CreateContinueWindow(); | 24 static std::unique_ptr<HostWindow> CreateContinueWindow(); |
24 | 25 |
25 // Creates a platform-specific instance of the disconnect window. | 26 // Creates a platform-specific instance of the disconnect window. |
26 static scoped_ptr<HostWindow> CreateDisconnectWindow(); | 27 static std::unique_ptr<HostWindow> CreateDisconnectWindow(); |
27 | 28 |
28 // Starts the UI state machine. |client_session_control| will be used to | 29 // Starts the UI state machine. |client_session_control| will be used to |
29 // notify the caller about the local user's actions. | 30 // notify the caller about the local user's actions. |
30 virtual void Start( | 31 virtual void Start( |
31 const base::WeakPtr<ClientSessionControl>& client_session_control) = 0; | 32 const base::WeakPtr<ClientSessionControl>& client_session_control) = 0; |
32 | 33 |
33 protected: | 34 protected: |
34 HostWindow() {} | 35 HostWindow() {} |
35 | 36 |
36 private: | 37 private: |
37 // Let |HostWindowProxy| to call DetachFromThread() when passing an instance | 38 // Let |HostWindowProxy| to call DetachFromThread() when passing an instance |
38 // of |HostWindow| to a different thread. | 39 // of |HostWindow| to a different thread. |
39 friend class HostWindowProxy; | 40 friend class HostWindowProxy; |
40 | 41 |
41 DISALLOW_COPY_AND_ASSIGN(HostWindow); | 42 DISALLOW_COPY_AND_ASSIGN(HostWindow); |
42 }; | 43 }; |
43 | 44 |
44 } // namespace remoting | 45 } // namespace remoting |
45 | 46 |
46 #endif // REMOTING_HOST_HOST_WINDOW_H_ | 47 #endif // REMOTING_HOST_HOST_WINDOW_H_ |
OLD | NEW |