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

Unified Diff: remoting/host/curtaining_host_observer.cc

Issue 11275178: Enforce the RemoteAccessHostRequireCurtain policy on all platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing member to CurtainModeWin. Created 8 years, 1 month 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
« no previous file with comments | « remoting/host/curtaining_host_observer.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/curtaining_host_observer.cc
diff --git a/remoting/host/curtaining_host_observer.cc b/remoting/host/curtaining_host_observer.cc
index 298c5957a7ad36190072aa6a6e05d1a11380381e..6eacabe6c08be853ac9d92e798d8a63e347ab5ac 100644
--- a/remoting/host/curtaining_host_observer.cc
+++ b/remoting/host/curtaining_host_observer.cc
@@ -21,17 +21,19 @@ CurtainingHostObserver::~CurtainingHostObserver() {
curtain_->SetActivated(false);
}
-// TODO(jamiewalch): This code assumes at most one client connection at a time.
-// Add OnFirstClientConnected and OnLastClientDisconnected optional callbacks
-// to the HostStatusObserver interface to address this.
+void CurtainingHostObserver::SetEnableCurtaining(bool enable) {
+ enable_curtaining_ = enable;
+ curtain_->SetActivated(enable_curtaining_ && !active_clients_.empty());
+}
+
void CurtainingHostObserver::OnClientAuthenticated(const std::string& jid) {
- if (curtain_->required()) {
- curtain_->SetActivated(true);
- }
+ active_clients_.insert(jid);
+ curtain_->SetActivated(enable_curtaining_ && !active_clients_.empty());
}
void CurtainingHostObserver::OnClientDisconnected(const std::string& jid) {
- curtain_->SetActivated(false);
+ active_clients_.erase(jid);
+ curtain_->SetActivated(enable_curtaining_ && !active_clients_.empty());
}
} // namespace remoting
« no previous file with comments | « remoting/host/curtaining_host_observer.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698