| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This is an application of a minimal host process in a Chromoting | 5 // This is an application of a minimal host process in a Chromoting |
| 6 // system. It serves the purpose of gluing different pieces together | 6 // system. It serves the purpose of gluing different pieces together |
| 7 // to make a functional host process for testing. | 7 // to make a functional host process for testing. |
| 8 // | 8 // |
| 9 // It peforms the following functionality: | 9 // It peforms the following functionality: |
| 10 // 1. Connect to the GTalk network and register the machine as a host. | 10 // 1. Connect to the GTalk network and register the machine as a host. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "remoting/host/capturer_fake.h" | 25 #include "remoting/host/capturer_fake.h" |
| 26 #include "remoting/host/encoder_verbatim.h" | 26 #include "remoting/host/encoder_verbatim.h" |
| 27 #include "remoting/host/simple_host.h" | 27 #include "remoting/host/simple_host.h" |
| 28 | 28 |
| 29 #if defined(OS_WIN) | 29 #if defined(OS_WIN) |
| 30 #include "remoting/host/capturer_gdi.h" | 30 #include "remoting/host/capturer_gdi.h" |
| 31 #include "remoting/host/event_executor_win.h" | 31 #include "remoting/host/event_executor_win.h" |
| 32 #elif defined(OS_LINUX) | 32 #elif defined(OS_LINUX) |
| 33 #include "remoting/host/capturer_linux.h" | 33 #include "remoting/host/capturer_linux.h" |
| 34 #include "remoting/host/event_executor_linux.h" | 34 #include "remoting/host/event_executor_linux.h" |
| 35 #elif defined(OS_MAC) | 35 #elif defined(OS_MACOSX) |
| 36 #include "remoting/host/capturer_mac.h" | 36 #include "remoting/host/capturer_mac.h" |
| 37 #include "remoting/host/event_executor_mac.h" | 37 #include "remoting/host/event_executor_mac.h" |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 void SetConsoleEcho(bool on) { | 40 void SetConsoleEcho(bool on) { |
| 41 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
| 42 HANDLE hIn = GetStdHandle(STD_INPUT_HANDLE); | 42 HANDLE hIn = GetStdHandle(STD_INPUT_HANDLE); |
| 43 if ((hIn == INVALID_HANDLE_VALUE) || (hIn == NULL)) | 43 if ((hIn == INVALID_HANDLE_VALUE) || (hIn == NULL)) |
| 44 return; | 44 return; |
| 45 | 45 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 scoped_ptr<remoting::Capturer> capturer; | 89 scoped_ptr<remoting::Capturer> capturer; |
| 90 scoped_ptr<remoting::Encoder> encoder; | 90 scoped_ptr<remoting::Encoder> encoder; |
| 91 scoped_ptr<remoting::EventExecutor> executor; | 91 scoped_ptr<remoting::EventExecutor> executor; |
| 92 #if defined(OS_WIN) | 92 #if defined(OS_WIN) |
| 93 capturer.reset(new remoting::CapturerGdi()); | 93 capturer.reset(new remoting::CapturerGdi()); |
| 94 executor.reset(new remoting::EventExecutorWin()); | 94 executor.reset(new remoting::EventExecutorWin()); |
| 95 #elif defined(OS_LINUX) | 95 #elif defined(OS_LINUX) |
| 96 capturer.reset(new remoting::CapturerLinux()); | 96 capturer.reset(new remoting::CapturerLinux()); |
| 97 executor.reset(new remoting::EventExecutorLinux()); | 97 executor.reset(new remoting::EventExecutorLinux()); |
| 98 #elif defined(OS_MAC) | 98 #elif defined(OS_MACOSX) |
| 99 capturer.reset(new remoting::CapturerMac()); | 99 capturer.reset(new remoting::CapturerMac()); |
| 100 executor.reset(new remoting::EventExecutorMac()); | 100 executor.reset(new remoting::EventExecutorMac()); |
| 101 #endif | 101 #endif |
| 102 encoder.reset(new remoting::EncoderVerbatim()); | 102 encoder.reset(new remoting::EncoderVerbatim()); |
| 103 | 103 |
| 104 if (fake) { | 104 if (fake) { |
| 105 // Inject a fake capturer. | 105 // Inject a fake capturer. |
| 106 capturer.reset(new remoting::CapturerFake()); | 106 capturer.reset(new remoting::CapturerFake()); |
| 107 } | 107 } |
| 108 | 108 |
| 109 // Construct a simple host with username and password. | 109 // Construct a simple host with username and password. |
| 110 // TODO(hclam): Allow the host to load saved credentials. | 110 // TODO(hclam): Allow the host to load saved credentials. |
| 111 scoped_refptr<remoting::SimpleHost> host | 111 scoped_refptr<remoting::SimpleHost> host |
| 112 = new remoting::SimpleHost(username, password, | 112 = new remoting::SimpleHost(username, password, |
| 113 capturer.release(), | 113 capturer.release(), |
| 114 encoder.release(), | 114 encoder.release(), |
| 115 executor.release()); | 115 executor.release()); |
| 116 host->Run(); | 116 host->Run(); |
| 117 return 0; | 117 return 0; |
| 118 } | 118 } |
| OLD | NEW |