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

Unified Diff: remoting/host/chromoting_host.cc

Issue 7089015: Call the DisconnectWindow interface methods on the UI thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows build Created 9 years, 6 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
« no previous file with comments | « remoting/host/chromoting_host.h ('k') | remoting/host/chromoting_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host.cc
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index 7f3cadd24de9411605b8446be262038672ef696e..44b2281a24675b3cee335237ecfc5ddcf88fbc00 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -372,7 +372,7 @@ void ChromotingHost::OnClientDisconnected(ConnectionToClient* connection) {
if (!HasAuthenticatedClients()) {
EnableCurtainMode(false);
if (is_me2mom_)
- desktop_environment_->disconnect_window()->Hide();
+ ShowDisconnectWindow(false, std::string());
}
}
@@ -471,7 +471,7 @@ void ChromotingHost::LocalLoginSucceeded(
size_t pos = username.find('/');
if (pos != std::string::npos)
username.replace(pos, std::string::npos, "");
- desktop_environment_->disconnect_window()->Show(this, username);
+ ShowDisconnectWindow(true, username);
}
}
@@ -503,4 +503,21 @@ void ChromotingHost::ProcessPreAuthentication(
client->get()->OnAuthorizationComplete(true);
}
+void ChromotingHost::ShowDisconnectWindow(bool show,
+ const std::string& username) {
+ if (context_->ui_message_loop() != MessageLoop::current()) {
+ context_->ui_message_loop()->PostTask(
+ FROM_HERE,
+ NewRunnableMethod(this, &ChromotingHost::ShowDisconnectWindow,
+ show, username));
+ return;
+ }
+
+ if (show) {
+ desktop_environment_->disconnect_window()->Show(this, username);
+ } else {
+ desktop_environment_->disconnect_window()->Hide();
+ }
+}
+
} // namespace remoting
« no previous file with comments | « remoting/host/chromoting_host.h ('k') | remoting/host/chromoting_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698