| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // Creates a CurtainMode object, with callbacks to be invoked when the | 22 // Creates a CurtainMode object, with callbacks to be invoked when the |
| 23 // switched-out session is switched back to the console, or in case of errors | 23 // switched-out session is switched back to the console, or in case of errors |
| 24 // activating the curtain. Typically, remote clients should be disconnected in | 24 // activating the curtain. Typically, remote clients should be disconnected in |
| 25 // both cases: for errors, because the privacy guarantee of curtain-mode | 25 // both cases: for errors, because the privacy guarantee of curtain-mode |
| 26 // cannot be honoured; for switch-in, to ensure that only one connection | 26 // cannot be honoured; for switch-in, to ensure that only one connection |
| 27 // (console or remote) exists to a session. | 27 // (console or remote) exists to a session. |
| 28 static scoped_ptr<CurtainMode> Create( | 28 static scoped_ptr<CurtainMode> Create( |
| 29 const base::Closure& on_session_activate, | 29 const base::Closure& on_session_activate, |
| 30 const base::Closure& on_error); | 30 const base::Closure& on_error); |
| 31 | 31 |
| 32 // Sets/gets whether the curtain mode is required by policy. | |
| 33 // TODO(rmsousa): Remove this piece of implementation from the interface once | |
| 34 // we have a good way to do so. | |
| 35 void set_required(bool required) { required_ = required; } | |
| 36 bool required() { return required_; } | |
| 37 | |
| 38 // Activate or deactivate curtain mode. | 32 // Activate or deactivate curtain mode. |
| 39 // If activated is true (meaning a remote client has just logged in), the | 33 // If activated is true (meaning a remote client has just logged in), the |
| 40 // implementation must immediately activate the curtain, or call on_error if | 34 // implementation must immediately activate the curtain, or call on_error if |
| 41 // it cannot do so. If a console user logs in while the curtain is activated, | 35 // it cannot do so. If a console user logs in while the curtain is activated, |
| 42 // the implementation must call on_session_activate (from any thread). | 36 // the implementation must call on_session_activate (from any thread). |
| 43 // If activated is false (meaning the remote client has disconnected), the | 37 // If activated is false (meaning the remote client has disconnected), the |
| 44 // implementation must not remove the curtain (since at this point we can make | 38 // implementation must not remove the curtain (since at this point we can make |
| 45 // no guarantees about whether the user intended to leave the console locked), | 39 // no guarantees about whether the user intended to leave the console locked), |
| 46 // and must not call on_session_activate when the console user logs in. | 40 // and must not call on_session_activate when the console user logs in. |
| 47 virtual void SetActivated(bool activated) = 0; | 41 virtual void SetActivated(bool activated) = 0; |
| 48 | 42 |
| 49 protected: | 43 protected: |
| 50 CurtainMode() : required_(false) {} | 44 CurtainMode() {} |
| 51 | 45 |
| 52 private: | 46 private: |
| 53 bool required_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(CurtainMode); | 47 DISALLOW_COPY_AND_ASSIGN(CurtainMode); |
| 56 }; | 48 }; |
| 57 | 49 |
| 58 } // namespace remoting | 50 } // namespace remoting |
| 59 | 51 |
| 60 #endif | 52 #endif |
| OLD | NEW |