Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1241)

Unified Diff: remoting/host/curtain_mode_mac.h

Issue 10829306: Make curtain-mode controllable by policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing ifdef. Removed unnecessary change. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/host/curtain_mode_mac.h
diff --git a/remoting/host/curtain_mode_mac.h b/remoting/host/curtain_mode_mac.h
index 3d21805e81dff278fe9bec687fb3231171a12998..b439b1140fda341f36affbbf23361abe7b8e468f 100644
--- a/remoting/host/curtain_mode_mac.h
+++ b/remoting/host/curtain_mode_mac.h
@@ -17,27 +17,46 @@ namespace remoting {
class CurtainMode : public HostStatusObserver {
public:
- CurtainMode();
+ // Set callbacks to be invoked when the switched-out session is switched back
+ // to the console, or in case of errors activating curtain-mode. Typically,
+ // remote clients should be disconnected in both cases: for errors, because
+ // the privacy guarantee of curtain-mode cannot be honoured; for switch-in,
+ // to ensure that only one connection (console or remote) exists to a session.
+ // Note that only the session's owner (or someone who knows the password) can
+ // attach it to the console, so this is safe.
+ CurtainMode(const base::Closure& on_session_activate,
+ const base::Closure& on_error);
virtual ~CurtainMode();
- // Set the callback to be invoked when the switched-out remote session is
- // switched back to the console. Typically, remote connections should be
- // closed in this event to make sure that only one connection (console or
- // remote) exists to a session at any time to ensure privacy. Note that
- // only the session's owner (or someone who knows the owner's password)
- // can attach it to the console, so this is safe.
- bool Init(const base::Closure& on_session_activate);
+ // Enable or disable curtain-mode. Note that disabling curtain-mode does not
+ // deactivate the curtain, but it does remove the switch-in handler, meaning
+ // that on_session_activate will not be invoked if curtain-mode is disabled.
+ // Conversely, enabling curtain-mode *does* activate the curtain if there is
+ // a connected client at the time.
+ void SetEnabled(bool enabled);
// Overridden from HostStatusObserver
virtual void OnClientAuthenticated(const std::string& jid) OVERRIDE;
+ virtual void OnClientDisconnected(const std::string& jid) OVERRIDE;
private:
+ // If the current session is attached to the console and is not showing
+ // the logon screen then switch it out to ensure privacy.
+ bool ActivateCurtain();
+
+ // Add or remove the switch-in event handler.
+ bool InstallEventHandler();
+ bool RemoveEventHandler();
+
+ // Handlers for the switch-in event.
static OSStatus SessionActivateHandler(EventHandlerCallRef handler,
EventRef event,
void* user_data);
void OnSessionActivate();
base::Closure on_session_activate_;
+ base::Closure on_error_;
+ bool connection_active_;
EventHandlerRef event_handler_;
};

Powered by Google App Engine
This is Rietveld 408576698