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

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

Issue 2677563005: Chromad: Use DM server reply to determine enrollment type (Closed)
Patch Set: Created 3 years, 10 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 } 179 }
180 180
181 void EnrollmentScreenHandler::Hide() { 181 void EnrollmentScreenHandler::Hide() {
182 } 182 }
183 183
184 void EnrollmentScreenHandler::ShowSigninScreen() { 184 void EnrollmentScreenHandler::ShowSigninScreen() {
185 observe_network_failure_ = true; 185 observe_network_failure_ = true;
186 ShowStep(kEnrollmentStepSignin); 186 ShowStep(kEnrollmentStepSignin);
187 } 187 }
188 188
189 void EnrollmentScreenHandler::ShowAdJoin() { 189 void EnrollmentScreenHandler::ShowAdJoin(
190 OnAdJoinedCallback on_joined_callback) {
191 on_joined_callback_ = std::move(on_joined_callback);
190 observe_network_failure_ = false; 192 observe_network_failure_ = false;
191 ShowStep(kEnrollmentStepAdJoin); 193 ShowStep(kEnrollmentStepAdJoin);
192 } 194 }
193 195
194 void EnrollmentScreenHandler::ShowAttributePromptScreen( 196 void EnrollmentScreenHandler::ShowAttributePromptScreen(
195 const std::string& asset_id, 197 const std::string& asset_id,
196 const std::string& location) { 198 const std::string& location) {
197 CallJS("showAttributePromptStep", asset_id, location); 199 CallJS("showAttributePromptStep", asset_id, location);
198 } 200 }
199 201
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 machine_name, 573 machine_name,
572 user_name)); 574 user_name));
573 } 575 }
574 576
575 void EnrollmentScreenHandler::HandleAdDomainJoin( 577 void EnrollmentScreenHandler::HandleAdDomainJoin(
576 const std::string& machine_name, 578 const std::string& machine_name,
577 const std::string& user_name, 579 const std::string& user_name,
578 authpolicy::ErrorType code) { 580 authpolicy::ErrorType code) {
579 switch (code) { 581 switch (code) {
580 case authpolicy::ERROR_NONE: 582 case authpolicy::ERROR_NONE:
581 controller_->OnAdJoined(gaia::ExtractDomainName(user_name)); 583 ShowEnrollmentSpinnerScreen();
584 std::move(on_joined_callback_).Run(gaia::ExtractDomainName(user_name));
achuithb 2017/02/07 20:27:17 Is this your way of setting on_joined_callback_ to
Roman Sorokin (ftl) 2017/02/10 14:57:10 This is the way to consume OnceCallbacks according
achuithb 2017/02/13 13:39:02 Acknowledged.
582 return; 585 return;
583 case authpolicy::ERROR_UNKNOWN: 586 case authpolicy::ERROR_UNKNOWN:
584 case authpolicy::ERROR_DBUS_FAILURE: 587 case authpolicy::ERROR_DBUS_FAILURE:
585 case authpolicy::ERROR_NET_FAILED: 588 case authpolicy::ERROR_NET_FAILED:
586 case authpolicy::ERROR_SMBCLIENT_FAILED: 589 case authpolicy::ERROR_SMBCLIENT_FAILED:
587 case authpolicy::ERROR_PARSE_FAILED: 590 case authpolicy::ERROR_PARSE_FAILED:
588 case authpolicy::ERROR_PARSE_PREG_FAILED: 591 case authpolicy::ERROR_PARSE_PREG_FAILED:
589 case authpolicy::ERROR_BAD_GPOS: 592 case authpolicy::ERROR_BAD_GPOS:
590 case authpolicy::ERROR_LOCAL_IO: 593 case authpolicy::ERROR_LOCAL_IO:
591 case authpolicy::ERROR_STORE_POLICY_FAILED: 594 case authpolicy::ERROR_STORE_POLICY_FAILED:
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 695
693 ShowScreenWithData(OobeScreen::SCREEN_OOBE_ENROLLMENT, &screen_data); 696 ShowScreenWithData(OobeScreen::SCREEN_OOBE_ENROLLMENT, &screen_data);
694 if (first_show_) { 697 if (first_show_) {
695 first_show_ = false; 698 first_show_ = false;
696 UpdateStateInternal(NetworkError::ERROR_REASON_UPDATE, true); 699 UpdateStateInternal(NetworkError::ERROR_REASON_UPDATE, true);
697 } 700 }
698 histogram_helper_->OnScreenShow(); 701 histogram_helper_->OnScreenShow();
699 } 702 }
700 703
701 } // namespace chromeos 704 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698