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

Unified Diff: remoting/host/setup/start_host.cc

Issue 11185037: [Chromoting] Let the Linux start-host app take a redirect-URL parameter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows include. Created 8 years, 2 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/setup/oauth_helper_unittest.cc ('k') | remoting/host/setup/win/auth_code_getter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/setup/start_host.cc
diff --git a/remoting/host/setup/start_host.cc b/remoting/host/setup/start_host.cc
index 2c311a730f29979cf018b25bbca495ae19853d8f..07db7483996993635e3a2ab1fed13b925f7a6861 100644
--- a/remoting/host/setup/start_host.cc
+++ b/remoting/host/setup/start_host.cc
@@ -12,6 +12,7 @@
#include "base/threading/thread.h"
#include "net/url_request/url_request_context_getter.h"
#include "remoting/host/setup/host_starter.h"
+#include "remoting/host/setup/oauth_helper.h"
#include "remoting/host/setup/pin_validator.h"
#include "remoting/host/url_request_context.h"
@@ -92,10 +93,12 @@ int main(int argc, char** argv) {
std::string host_name = command_line->GetSwitchValueASCII("name");
std::string host_pin = command_line->GetSwitchValueASCII("pin");
std::string auth_code = command_line->GetSwitchValueASCII("code");
+ std::string redirect_url = command_line->GetSwitchValueASCII("redirect-url");
if (host_name.empty()) {
fprintf(stderr,
- "Usage: %s --name=<hostname> [--code=<auth-code>] [--pin=<PIN>]\n",
+ "Usage: %s --name=<hostname> [--code=<auth-code>] [--pin=<PIN>] "
+ "[--redirect-url=<redirectURL>]\n",
argv[0]);
return 1;
}
@@ -154,7 +157,10 @@ int main(int argc, char** argv) {
// Start the host.
scoped_ptr<HostStarter> host_starter(
HostStarter::Create(url_request_context_getter));
- host_starter->StartHost(host_name, host_pin, true, auth_code,
+ if (redirect_url.empty()) {
+ redirect_url = remoting::GetDefaultOauthRedirectUrl();
+ }
+ host_starter->StartHost(host_name, host_pin, true, auth_code, redirect_url,
base::Bind(&OnDone));
// Run the message loop until the StartHost completion callback.
« no previous file with comments | « remoting/host/setup/oauth_helper_unittest.cc ('k') | remoting/host/setup/win/auth_code_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698