summaryrefslogtreecommitdiffstats
path: root/cloud_print
diff options
context:
space:
mode:
authormaksymb@chromium.org <maksymb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-26 17:05:15 +0000
committermaksymb@chromium.org <maksymb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-26 17:05:15 +0000
commitc371abb6456360e99689c16861b0a019170179a8 (patch)
treee2d8a91de7d4ee3520ab8b51ac99a1bbf4e8f324 /cloud_print
parent585cb9be13e74f24594bef5d83c108f0f1c33d00 (diff)
downloadchromium_src-c371abb6456360e99689c16861b0a019170179a8.zip
chromium_src-c371abb6456360e99689c16861b0a019170179a8.tar.gz
chromium_src-c371abb6456360e99689c16861b0a019170179a8.tar.bz2
GCP2.0 Device: Command line switch for disabling confirmation.
BUG= Review URL: https://chromiumcodereview.appspot.com/20384003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213940 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cloud_print')
-rw-r--r--cloud_print/gcp20/prototype/printer.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/cloud_print/gcp20/prototype/printer.cc b/cloud_print/gcp20/prototype/printer.cc
index 1dc1359..2a0086b 100644
--- a/cloud_print/gcp20/prototype/printer.cc
+++ b/cloud_print/gcp20/prototype/printer.cc
@@ -201,12 +201,17 @@ PrivetHttpServer::RegistrationErrorStatus Printer::RegistrationStart(
reg_info_.user = user;
reg_info_.state = RegistrationInfo::DEV_REG_REGISTRATION_STARTED;
- printf(kUserConfirmationTitle);
- base::Time valid_until = base::Time::Now() +
- base::TimeDelta::FromSeconds(kUserConfirmationTimeout);
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&Printer::WaitUserConfirmation, AsWeakPtr(), valid_until));
+ if (CommandLine::ForCurrentProcess()->HasSwitch("disable-confirmation")) {
+ reg_info_.confirmation_state = RegistrationInfo::CONFIRMATION_CONFIRMED;
+ LOG(INFO) << "Registration confirmed by default.";
+ } else {
+ printf("%s", kUserConfirmationTitle);
+ base::Time valid_until = base::Time::Now() +
+ base::TimeDelta::FromSeconds(kUserConfirmationTimeout);
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(&Printer::WaitUserConfirmation, AsWeakPtr(), valid_until));
+ }
requester_->StartRegistration(GenerateProxyId(), kPrinterName, user, kCdd);