From 2a4f9884f3b47a5af5bac0703251efa77810986e Mon Sep 17 00:00:00 2001 From: "hclam@chromium.org" Date: Tue, 15 Jun 2010 00:20:38 +0000 Subject: Cleanup some chromoting code Renamed SimpleHost to ChromotingHost as it's not simple any more and it's becoming mature enough to be the main host implementation. Review URL: http://codereview.chromium.org/2722010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49748 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/host/simple_host_process.cc | 45 +++++++----------------------------- 1 file changed, 8 insertions(+), 37 deletions(-) (limited to 'remoting/host/simple_host_process.cc') diff --git a/remoting/host/simple_host_process.cc b/remoting/host/simple_host_process.cc index 79db106..d32547f 100644 --- a/remoting/host/simple_host_process.cc +++ b/remoting/host/simple_host_process.cc @@ -25,7 +25,7 @@ #include "base/waitable_event.h" #include "remoting/host/capturer_fake.h" #include "remoting/host/encoder_verbatim.h" -#include "remoting/host/simple_host.h" +#include "remoting/host/chromoting_host.h" #if defined(OS_WIN) #include "remoting/host/capturer_gdi.h" @@ -38,35 +38,6 @@ #include "remoting/host/event_executor_mac.h" #endif -void SetConsoleEcho(bool on) { -#if defined(OS_WIN) - HANDLE hIn = GetStdHandle(STD_INPUT_HANDLE); - if ((hIn == INVALID_HANDLE_VALUE) || (hIn == NULL)) - return; - - DWORD mode; - if (!GetConsoleMode(hIn, &mode)) - return; - - if (on) { - mode = mode | ENABLE_ECHO_INPUT; - } else { - mode = mode & ~ENABLE_ECHO_INPUT; - } - - SetConsoleMode(hIn, mode); -#elif defined(OS_POSIX) - struct termios settings; - tcgetattr(STDIN_FILENO, &settings); - if (on) { - settings.c_lflag |= ECHO; - } else { - settings.c_lflag &= ~ECHO; - } - tcsetattr(STDIN_FILENO, TCSANOW, &settings); -#endif // defined(OS_WIN) -} - int main(int argc, char** argv) { base::AtExitManager exit_manager; @@ -131,15 +102,15 @@ int main(int argc, char** argv) { capturer.reset(new remoting::CapturerFake()); } - // Construct a simple host with username and auth_token. + // Construct a chromoting host with username and auth_token. // TODO(hclam): Allow the host to load saved credentials. base::WaitableEvent host_done(false, false); - scoped_refptr host - = new remoting::SimpleHost(username, auth_token, - capturer.release(), - encoder.release(), - executor.release(), - &host_done); + scoped_refptr host + = new remoting::ChromotingHost(username, auth_token, + capturer.release(), + encoder.release(), + executor.release(), + &host_done); host->Run(); host_done.Wait(); return 0; -- cgit v1.1