Index: remoting/host/remoting_me2me_host.cc |
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc |
index be25fa363bd9e0e28aa3ef1fa00777313f1a5ae9..fd7227a5151a8fc109e90f58f5eae97cd14f3d6f 100644 |
--- a/remoting/host/remoting_me2me_host.cc |
+++ b/remoting/host/remoting_me2me_host.cc |
@@ -248,8 +248,19 @@ class HostProcess |
return kInvalidHostConfigurationExitCode; |
} |
-#if defined(OS_MACOSX) || defined(OS_WIN) |
+#if defined(OS_WIN) |
host_user_interface_.reset(new HostUserInterface(context_.get())); |
Jamie
2012/08/24 21:40:35
Can you refactor a little so that we don't need to
Lambros
2012/08/27 20:26:44
Done.
|
+#elif defined(OS_MACOSX) |
+ // Don't try to display any UI on top of the system's login screen as this |
+ // is rejected by the Window Server on OS X 10.7.4, and prevents the |
+ // capturer from working (http://crbug.com/140984). |
+ base::mac::ScopedCFTypeRef<CFDictionaryRef> session( |
+ CGSessionCopyCurrentDictionary()); |
+ const void* logged_in = CFDictionaryGetValue(session, |
+ kCGSessionLoginDoneKey); |
Jamie
2012/08/24 21:40:35
We now use this in a couple of places. Is it worth
Lambros
2012/08/27 20:26:44
We should move this into a separate utility class,
|
+ if (logged_in == kCFBooleanTrue) { |
+ host_user_interface_.reset(new HostUserInterface(context_.get())); |
+ } |
#endif |
StartWatchingPolicy(); |
@@ -519,11 +530,11 @@ class HostProcess |
new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); |
host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); |
-#if defined(OS_MACOSX) || defined(OS_WIN) |
- host_user_interface_->Start( |
- host_, base::Bind(&HostProcess::OnDisconnectRequested, |
- base::Unretained(this))); |
-#endif |
+ if (host_user_interface_.get()) { |
+ host_user_interface_->Start( |
+ host_, base::Bind(&HostProcess::OnDisconnectRequested, |
+ base::Unretained(this))); |
+ } |
host_->Start(); |