| 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/enrollment_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/system/chromeos/devicetype_utils.h" | 9 #include "ash/common/system/chromeos/devicetype_utils.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 password_fd.get(), | 557 password_fd.get(), |
| 558 base::Bind(&EnrollmentScreenHandler::HandleAdDomainJoin, | 558 base::Bind(&EnrollmentScreenHandler::HandleAdDomainJoin, |
| 559 weak_ptr_factory_.GetWeakPtr(), | 559 weak_ptr_factory_.GetWeakPtr(), |
| 560 machine_name, | 560 machine_name, |
| 561 user_name)); | 561 user_name)); |
| 562 } | 562 } |
| 563 | 563 |
| 564 void EnrollmentScreenHandler::HandleAdDomainJoin( | 564 void EnrollmentScreenHandler::HandleAdDomainJoin( |
| 565 const std::string& machine_name, | 565 const std::string& machine_name, |
| 566 const std::string& user_name, | 566 const std::string& user_name, |
| 567 int code) { | 567 authpolicy::ErrorType code) { |
| 568 if (code == 0) { | 568 switch (code) { |
| 569 controller_->OnAdJoined(gaia::ExtractDomainName(user_name)); | 569 case authpolicy::ERROR_NONE: |
| 570 return; | 570 controller_->OnAdJoined(gaia::ExtractDomainName(user_name)); |
| 571 return; |
| 572 case authpolicy::ERROR_UNKNOWN: |
| 573 case authpolicy::ERROR_DBUS_FAILURE: |
| 574 case authpolicy::ERROR_PARSE_UPN_FAILED: |
| 575 case authpolicy::ERROR_BAD_USER_NAME: |
| 576 case authpolicy::ERROR_BAD_PASSWORD: |
| 577 case authpolicy::ERROR_PASSWORD_EXPIRED: |
| 578 case authpolicy::ERROR_CANNOT_RESOLVE_KDC: |
| 579 case authpolicy::ERROR_KINIT_FAILED: |
| 580 case authpolicy::ERROR_NET_FAILED: |
| 581 case authpolicy::ERROR_SMBCLIENT_FAILED: |
| 582 case authpolicy::ERROR_PARSE_FAILED: |
| 583 case authpolicy::ERROR_PARSE_PREG_FAILED: |
| 584 case authpolicy::ERROR_BAD_GPOS: |
| 585 case authpolicy::ERROR_LOCAL_IO: |
| 586 case authpolicy::ERROR_NOT_JOINED: |
| 587 case authpolicy::ERROR_NOT_LOGGED_IN: |
| 588 case authpolicy::ERROR_STORE_POLICY_FAILED: |
| 589 // TODO(rsorokin): Add passing/displaying error codes. (see |
| 590 // crbug.com/659984) |
| 591 CallJS("invalidateAd", machine_name, user_name); |
| 592 return; |
| 593 default: |
| 594 LOG(WARNING) << "Unhandled error code: " << code; |
| 595 CallJS("invalidateAd", machine_name, user_name); |
| 596 return; |
| 571 } | 597 } |
| 572 // TODO(rsorokin): Add passing/displaying error codes. (see crbug.com/659984) | |
| 573 CallJS("invalidateAd", machine_name, user_name); | |
| 574 } | 598 } |
| 575 | 599 |
| 576 void EnrollmentScreenHandler::HandleRetry() { | 600 void EnrollmentScreenHandler::HandleRetry() { |
| 577 DCHECK(controller_); | 601 DCHECK(controller_); |
| 578 controller_->OnRetry(); | 602 controller_->OnRetry(); |
| 579 } | 603 } |
| 580 | 604 |
| 581 void EnrollmentScreenHandler::HandleFrameLoadingCompleted() { | 605 void EnrollmentScreenHandler::HandleFrameLoadingCompleted() { |
| 582 if (network_state_informer_->state() != NetworkStateInformer::ONLINE) | 606 if (network_state_informer_->state() != NetworkStateInformer::ONLINE) |
| 583 return; | 607 return; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 | 658 |
| 635 ShowScreenWithData(OobeScreen::SCREEN_OOBE_ENROLLMENT, &screen_data); | 659 ShowScreenWithData(OobeScreen::SCREEN_OOBE_ENROLLMENT, &screen_data); |
| 636 if (first_show_) { | 660 if (first_show_) { |
| 637 first_show_ = false; | 661 first_show_ = false; |
| 638 UpdateStateInternal(NetworkError::ERROR_REASON_UPDATE, true); | 662 UpdateStateInternal(NetworkError::ERROR_REASON_UPDATE, true); |
| 639 } | 663 } |
| 640 histogram_helper_->OnScreenShow(); | 664 histogram_helper_->OnScreenShow(); |
| 641 } | 665 } |
| 642 | 666 |
| 643 } // namespace chromeos | 667 } // namespace chromeos |
| OLD | NEW |