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

Side by Side Diff: remoting/client/simple_client.cc

Issue 2724010: Revert 49298 - Broke compile - Token-based authentication for chromoting.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/client/host_connection.cc ('k') | remoting/host/simple_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // A simple client implements a minimalize Chromoting client and shows 5 // A simple client implements a minimalize Chromoting client and shows
6 // network traffic for debugging. 6 // network traffic for debugging.
7 7
8 #include <iostream> 8 #include <iostream>
9 #include <list> 9 #include <list>
10 10
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 std::cout << "JID [" << default_username << "]: "; 169 std::cout << "JID [" << default_username << "]: ";
170 getline(std::cin, username); 170 getline(std::cin, username);
171 if (username.length() == 0) { 171 if (username.length() == 0) {
172 username = default_username; 172 username = default_username;
173 } 173 }
174 if (username.length() == 0) { 174 if (username.length() == 0) {
175 std::cerr << "Error: Expected valid JID username" << std::endl; 175 std::cerr << "Error: Expected valid JID username" << std::endl;
176 return 1; 176 return 1;
177 } 177 }
178 178
179 // Get auth token. 179 // Get password (with console echo turned off).
180 std::string auth_token; 180 std::string password;
181 std::cout << "Auth Token: "; 181 SetConsoleEcho(false);
182 getline(std::cin, auth_token); 182 std::cout << "Password: ";
183 getline(std::cin, password);
184 SetConsoleEcho(true);
185 std::cout << std::endl;
183 186
184 // The message loop that everything runs on. 187 // The message loop that everything runs on.
185 MessageLoop main_loop; 188 MessageLoop main_loop;
186 SimpleHostEventHandler handler(&main_loop); 189 SimpleHostEventHandler handler(&main_loop);
187 HostConnection connection(new ProtocolDecoder(), &handler); 190 HostConnection connection(new ProtocolDecoder(), &handler);
188 connection.Connect(username, auth_token, host_jid); 191 connection.Connect(username, password, host_jid);
189 192
190 // Run the message. 193 // Run the message.
191 main_loop.Run(); 194 main_loop.Run();
192 return 0; 195 return 0;
193 } 196 }
OLDNEW
« no previous file with comments | « remoting/client/host_connection.cc ('k') | remoting/host/simple_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698