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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc

Issue 2587993002: Chromad: Switch AuthPolicyClient to use cros_system_api enums. (Closed)
Patch Set: add return into case statement. Created 3 years, 11 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 unified diff | Download patch
OLDNEW
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
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 NOTREACHED();
stevenjb 2016/12/28 18:12:43 As mentioned, either make this LOG(WARNING) or rem
Roman Sorokin (ftl) 2016/12/29 07:21:42 Done.
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698