| 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_CURTAIN_MODE_H_ | 5 #ifndef REMOTING_HOST_CURTAIN_MODE_H_ |
| 6 #define REMOTING_HOST_CURTAIN_MODE_H_ | 6 #define REMOTING_HOST_CURTAIN_MODE_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 11 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 13 | 14 |
| 14 namespace base { | 15 namespace base { |
| 15 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
| 16 } // namespace base | 17 } // namespace base |
| 17 | 18 |
| 18 namespace remoting { | 19 namespace remoting { |
| 19 | 20 |
| 20 class ClientSessionControl; | 21 class ClientSessionControl; |
| 21 | 22 |
| 22 class CurtainMode { | 23 class CurtainMode { |
| 23 public: | 24 public: |
| 24 virtual ~CurtainMode() {} | 25 virtual ~CurtainMode() {} |
| 25 | 26 |
| 26 // Creates a platform-specific curtain mode implementation object that | 27 // Creates a platform-specific curtain mode implementation object that |
| 27 // "curtains" the current session making sure it is not accessible from | 28 // "curtains" the current session making sure it is not accessible from |
| 28 // the local console. |client_session_control| can be used to drop | 29 // the local console. |client_session_control| can be used to drop |
| 29 // the connection in the case if the session re-connects to the local console | 30 // the connection in the case if the session re-connects to the local console |
| 30 // in mid-flight. | 31 // in mid-flight. |
| 31 static scoped_ptr<CurtainMode> Create( | 32 static std::unique_ptr<CurtainMode> Create( |
| 32 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 33 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 33 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 34 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 34 base::WeakPtr<ClientSessionControl> client_session_control); | 35 base::WeakPtr<ClientSessionControl> client_session_control); |
| 35 | 36 |
| 36 // Activates the curtain mode. Returns true if successful. | 37 // Activates the curtain mode. Returns true if successful. |
| 37 virtual bool Activate() = 0; | 38 virtual bool Activate() = 0; |
| 38 | 39 |
| 39 protected: | 40 protected: |
| 40 CurtainMode() {} | 41 CurtainMode() {} |
| 41 | 42 |
| 42 private: | 43 private: |
| 43 DISALLOW_COPY_AND_ASSIGN(CurtainMode); | 44 DISALLOW_COPY_AND_ASSIGN(CurtainMode); |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 } // namespace remoting | 47 } // namespace remoting |
| 47 | 48 |
| 48 #endif | 49 #endif |
| OLD | NEW |