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

Unified Diff: remoting/host/simple_host_process.cc

Issue 2722010: Cleanup some chromoting code (Closed)
Patch Set: Created 10 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/simple_host_process.cc
diff --git a/remoting/host/simple_host_process.cc b/remoting/host/simple_host_process.cc
index 79db1069a68fd1bf336df2697968ab2d8f8183bc..d32547fe1192233d7a1888cdcd0646d182427b47 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<remoting::SimpleHost> host
- = new remoting::SimpleHost(username, auth_token,
- capturer.release(),
- encoder.release(),
- executor.release(),
- &host_done);
+ scoped_refptr<remoting::ChromotingHost> host
+ = new remoting::ChromotingHost(username, auth_token,
+ capturer.release(),
+ encoder.release(),
+ executor.release(),
+ &host_done);
host->Run();
host_done.Wait();
return 0;
« no previous file with comments | « remoting/host/chromoting_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698