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 default: | |
573 LOG(WARNING) << "Unhandled error code: " << code; | |
stevenjb
2016/12/29 21:09:54
default should still be after any cases. We could
Roman Sorokin (ftl)
2016/12/30 11:25:58
Done.
| |
574 case authpolicy::ERROR_UNKNOWN: | |
575 case authpolicy::ERROR_DBUS_FAILURE: | |
576 case authpolicy::ERROR_PARSE_UPN_FAILED: | |
577 case authpolicy::ERROR_BAD_USER_NAME: | |
578 case authpolicy::ERROR_BAD_PASSWORD: | |
579 case authpolicy::ERROR_PASSWORD_EXPIRED: | |
580 case authpolicy::ERROR_CANNOT_RESOLVE_KDC: | |
581 case authpolicy::ERROR_KINIT_FAILED: | |
582 case authpolicy::ERROR_NET_FAILED: | |
583 case authpolicy::ERROR_SMBCLIENT_FAILED: | |
584 case authpolicy::ERROR_PARSE_FAILED: | |
585 case authpolicy::ERROR_PARSE_PREG_FAILED: | |
586 case authpolicy::ERROR_BAD_GPOS: | |
587 case authpolicy::ERROR_LOCAL_IO: | |
588 case authpolicy::ERROR_NOT_JOINED: | |
589 case authpolicy::ERROR_NOT_LOGGED_IN: | |
590 case authpolicy::ERROR_STORE_POLICY_FAILED: | |
591 // TODO(rsorokin): Add passing/displaying error codes. (see | |
592 // crbug.com/659984) | |
593 CallJS("invalidateAd", machine_name, user_name); | |
594 return; | |
571 } | 595 } |
572 // TODO(rsorokin): Add passing/displaying error codes. (see crbug.com/659984) | |
573 CallJS("invalidateAd", machine_name, user_name); | |
574 } | 596 } |
575 | 597 |
576 void EnrollmentScreenHandler::HandleRetry() { | 598 void EnrollmentScreenHandler::HandleRetry() { |
577 DCHECK(controller_); | 599 DCHECK(controller_); |
578 controller_->OnRetry(); | 600 controller_->OnRetry(); |
579 } | 601 } |
580 | 602 |
581 void EnrollmentScreenHandler::HandleFrameLoadingCompleted() { | 603 void EnrollmentScreenHandler::HandleFrameLoadingCompleted() { |
582 if (network_state_informer_->state() != NetworkStateInformer::ONLINE) | 604 if (network_state_informer_->state() != NetworkStateInformer::ONLINE) |
583 return; | 605 return; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
634 | 656 |
635 ShowScreenWithData(OobeScreen::SCREEN_OOBE_ENROLLMENT, &screen_data); | 657 ShowScreenWithData(OobeScreen::SCREEN_OOBE_ENROLLMENT, &screen_data); |
636 if (first_show_) { | 658 if (first_show_) { |
637 first_show_ = false; | 659 first_show_ = false; |
638 UpdateStateInternal(NetworkError::ERROR_REASON_UPDATE, true); | 660 UpdateStateInternal(NetworkError::ERROR_REASON_UPDATE, true); |
639 } | 661 } |
640 histogram_helper_->OnScreenShow(); | 662 histogram_helper_->OnScreenShow(); |
641 } | 663 } |
642 | 664 |
643 } // namespace chromeos | 665 } // namespace chromeos |
OLD | NEW |