OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_HOST_CURTAIN_MODE_MAC_H_ |
| 6 #define REMOTING_HOST_CURTAIN_MODE_MAC_H_ |
| 7 |
| 8 #include <Carbon/Carbon.h> |
| 9 |
| 10 #include <string> |
| 11 |
| 12 #include "base/callback.h" |
| 13 #include "base/compiler_specific.h" |
| 14 #include "remoting/host/host_status_observer.h" |
| 15 |
| 16 namespace remoting { |
| 17 |
| 18 class CurtainMode : public HostStatusObserver { |
| 19 public: |
| 20 CurtainMode(); |
| 21 virtual ~CurtainMode(); |
| 22 |
| 23 // Set the callback to be invoked when the switched-out remote session is |
| 24 // switched back to the console. Typically, remote connections should be |
| 25 // closed in this event to make sure that only one connection (console or |
| 26 // remote) exists to a session at any time to ensure privacy. Note that |
| 27 // only the session's owner (or someone who knows the owner's password) |
| 28 // can attach it to the console, so this is safe. |
| 29 bool Init(const base::Closure& on_session_activate); |
| 30 |
| 31 // Overridden from HostStatusObserver |
| 32 virtual void OnClientAuthenticated(const std::string& jid) OVERRIDE; |
| 33 |
| 34 private: |
| 35 static OSStatus SessionActivateHandler(EventHandlerCallRef handler, |
| 36 EventRef event, |
| 37 void* user_data); |
| 38 void OnSessionActivate(); |
| 39 |
| 40 base::Closure on_session_activate_; |
| 41 EventHandlerRef event_handler_; |
| 42 }; |
| 43 |
| 44 } |
| 45 |
| 46 #endif |
OLD | NEW |