diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-10 01:03:46 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-10 01:03:46 +0000 |
commit | 2fc8ec7219b72a02978fb853bdca011e37feb52f (patch) | |
tree | 87a27a160e5882066c349b0b9ddbe02a8dc9abb2 /remoting | |
parent | cb84d644eccdc493dbfd55809cffb4c4410be12d (diff) | |
download | chromium_src-2fc8ec7219b72a02978fb853bdca011e37feb52f.zip chromium_src-2fc8ec7219b72a02978fb853bdca011e37feb52f.tar.gz chromium_src-2fc8ec7219b72a02978fb853bdca011e37feb52f.tar.bz2 |
Fix chromoting windows build
This change also changes the CapturerGdi to output 32bit instead of 24bit.
Review URL: http://codereview.chromium.org/2771007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49351 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/client/client_util.cc | 35 | ||||
-rw-r--r-- | remoting/client/client_util.h | 4 | ||||
-rw-r--r-- | remoting/host/capturer_gdi.cc | 4 |
3 files changed, 8 insertions, 35 deletions
diff --git a/remoting/client/client_util.cc b/remoting/client/client_util.cc index 66906f8..a6bf1877 100644 --- a/remoting/client/client_util.cc +++ b/remoting/client/client_util.cc @@ -6,37 +6,12 @@ #include <iostream> -static void SetConsoleEcho(bool on) { -#ifdef WIN32 - 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); -#else - if (on) - system("stty echo"); - else - system("stty -echo"); -#endif -} - namespace remoting { // Get host JID from command line arguments, or stdin if not specified. bool GetLoginInfo(std::string& host_jid, std::string& username, - std::string& password) { + std::string& auth_token) { std::cout << "Host JID: "; std::cin >> host_jid; std::cin.ignore(); // Consume the leftover '\n' @@ -64,11 +39,9 @@ bool GetLoginInfo(std::string& host_jid, return 1; } - // Get password (with console echo turned off). - SetConsoleEcho(false); - std::cout << "Password: "; - getline(std::cin, password); - SetConsoleEcho(true); + // Get authenication token (with console echo turned off). + std::cout << "Auth token: "; + getline(std::cin, auth_token); std::cout << std::endl; return true; } diff --git a/remoting/client/client_util.h b/remoting/client/client_util.h index 4c2902e..ba9fefe 100644 --- a/remoting/client/client_util.h +++ b/remoting/client/client_util.h @@ -10,9 +10,9 @@ namespace remoting { // Get the login info from the console and writes into |host_jid|, |username| -// and |password|. Return true if successful. +// and |auth_token|. Return true if successful. bool GetLoginInfo(std::string& host_jid, std::string& username, - std::string& password); + std::string& auth_token); } // namespace remoting diff --git a/remoting/host/capturer_gdi.cc b/remoting/host/capturer_gdi.cc index af32f9b..35a8c43 100644 --- a/remoting/host/capturer_gdi.cc +++ b/remoting/host/capturer_gdi.cc @@ -11,7 +11,7 @@ namespace remoting { // 3780 pixels per meter is equivalent to 96 DPI, typical on desktop monitors. static const int kPixelsPerMeter = 3780; // 24 bit RGB is 3 bytes per pixel. -static const int kBytesPerPixel = 3; +static const int kBytesPerPixel = 4; CapturerGdi::CapturerGdi() : initialized_(false) { @@ -84,7 +84,7 @@ void CapturerGdi::InitializeBuffers() { int rounded_width = (width_ + 3) & (~3); // Dimensions of screen. - pixel_format_ = PixelFormatRgb24; + pixel_format_ = PixelFormatRgb32; bytes_per_pixel_ = kBytesPerPixel; bytes_per_row_ = rounded_width * bytes_per_pixel_; |