OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/webui/chromeos/login/enterprise_oauth_enrollment_scr
een_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/enterprise_oauth_enrollment_scr
een_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" |
10 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
11 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
12 #include "chrome/browser/chromeos/login/authenticator.h" | 13 #include "chrome/browser/chromeos/login/authenticator.h" |
13 #include "chrome/browser/chromeos/login/login_utils.h" | 14 #include "chrome/browser/chromeos/login/login_utils.h" |
14 #include "chrome/browser/net/gaia/gaia_oauth_fetcher.h" | 15 #include "chrome/browser/net/gaia/gaia_oauth_fetcher.h" |
15 #include "chrome/browser/policy/auto_enrollment_client.h" | 16 #include "chrome/browser/policy/auto_enrollment_client.h" |
16 #include "chrome/browser/policy/enterprise_metrics.h" | 17 #include "chrome/browser/policy/enterprise_metrics.h" |
17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/common/chrome_switches.h" |
18 #include "chrome/common/net/gaia/gaia_constants.h" | 20 #include "chrome/common/net/gaia/gaia_constants.h" |
19 #include "chrome/common/net/gaia/gaia_urls.h" | 21 #include "chrome/common/net/gaia/gaia_urls.h" |
20 #include "chrome/common/net/gaia/google_service_auth_error.h" | 22 #include "chrome/common/net/gaia/google_service_auth_error.h" |
21 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
22 #include "grit/chromium_strings.h" | 24 #include "grit/chromium_strings.h" |
23 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
24 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
25 | 27 |
26 namespace { | 28 namespace { |
27 | 29 |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 new TokenRevoker(wrap_token_, "", profile); | 507 new TokenRevoker(wrap_token_, "", profile); |
506 wrap_token_.clear(); | 508 wrap_token_.clear(); |
507 } | 509 } |
508 } | 510 } |
509 | 511 |
510 void EnterpriseOAuthEnrollmentScreenHandler::DoShow() { | 512 void EnterpriseOAuthEnrollmentScreenHandler::DoShow() { |
511 DictionaryValue screen_data; | 513 DictionaryValue screen_data; |
512 screen_data.SetString("signin_url", kGaiaExtStartPage); | 514 screen_data.SetString("signin_url", kGaiaExtStartPage); |
513 screen_data.SetString("gaiaOrigin", | 515 screen_data.SetString("gaiaOrigin", |
514 GaiaUrls::GetInstance()->gaia_origin_url()); | 516 GaiaUrls::GetInstance()->gaia_origin_url()); |
| 517 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGaiaUrlPath)) { |
| 518 screen_data.SetString("gaiaUrlPath", |
| 519 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 520 switches::kGaiaUrlPath)); |
| 521 } |
515 screen_data.SetBoolean("is_auto_enrollment", is_auto_enrollment_); | 522 screen_data.SetBoolean("is_auto_enrollment", is_auto_enrollment_); |
516 if (!test_email_.empty()) { | 523 if (!test_email_.empty()) { |
517 screen_data.SetString("test_email", test_email_); | 524 screen_data.SetString("test_email", test_email_); |
518 screen_data.SetString("test_password", test_password_); | 525 screen_data.SetString("test_password", test_password_); |
519 } | 526 } |
520 | 527 |
521 ShowScreen("oauth-enrollment", &screen_data); | 528 ShowScreen("oauth-enrollment", &screen_data); |
522 | 529 |
523 if (is_auto_enrollment_ && !enrollment_failed_once_) | 530 if (is_auto_enrollment_ && !enrollment_failed_once_) |
524 EnrollAfterLogin(); | 531 EnrollAfterLogin(); |
(...skipping 12 matching lines...) Expand all Loading... |
537 controller_->OnConfirmationClosed(back_to_signin); | 544 controller_->OnConfirmationClosed(back_to_signin); |
538 } | 545 } |
539 | 546 |
540 void EnterpriseOAuthEnrollmentScreenHandler::UMAFailure(int sample) { | 547 void EnterpriseOAuthEnrollmentScreenHandler::UMAFailure(int sample) { |
541 if (is_auto_enrollment_) | 548 if (is_auto_enrollment_) |
542 sample = policy::kMetricEnrollmentAutoFailed; | 549 sample = policy::kMetricEnrollmentAutoFailed; |
543 UMA(sample); | 550 UMA(sample); |
544 } | 551 } |
545 | 552 |
546 } // namespace chromeos | 553 } // namespace chromeos |
OLD | NEW |