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

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

Issue 2685793004: Chromad: Wire up displayName and givenName (Closed)
Patch Set: Combine SetDisplayName and SetGivenName into SetDisplayAndGiveName 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/gaia_screen_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h"
6 6
7 #include "ash/common/system/chromeos/devicetype_utils.h" 7 #include "ash/common/system/chromeos/devicetype_utils.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/guid.h" 10 #include "base/guid.h"
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 authenticated_email, id, account_type); 496 authenticated_email, id, account_type);
497 497
498 if (account_id.GetUserEmail() != canonicalized_email) { 498 if (account_id.GetUserEmail() != canonicalized_email) {
499 LOG(WARNING) << "Existing user '" << account_id.GetUserEmail() 499 LOG(WARNING) << "Existing user '" << account_id.GetUserEmail()
500 << "' authenticated by alias '" << canonicalized_email << "'."; 500 << "' authenticated by alias '" << canonicalized_email << "'.";
501 } 501 }
502 502
503 return account_id; 503 return account_id;
504 } 504 }
505 505
506 void GaiaScreenHandler::DoAdAuth(const std::string& username, 506 void GaiaScreenHandler::DoAdAuth(
507 const Key& key, 507 const std::string& username,
508 authpolicy::ErrorType error, 508 const Key& key,
509 const std::string& uid) { 509 authpolicy::ErrorType error,
510 const authpolicy::ActiveDirectoryAccountData& account_data) {
510 switch (error) { 511 switch (error) {
511 case authpolicy::ERROR_NONE: { 512 case authpolicy::ERROR_NONE: {
512 DCHECK(!uid.empty()); 513 DCHECK(!account_data.has_account_id() &&
513 const AccountId account_id( 514 !account_data.account_id().empty());
514 GetAccountId(username, uid, AccountType::ACTIVE_DIRECTORY)); 515 const AccountId account_id(GetAccountId(
516 username, account_data.account_id(), AccountType::ACTIVE_DIRECTORY));
517 Delegate()->SetDisplayAndGivenName(account_data.display_name(),
518 account_data.given_name());
515 UserContext user_context(account_id); 519 UserContext user_context(account_id);
516 user_context.SetKey(key); 520 user_context.SetKey(key);
517 user_context.SetAuthFlow(UserContext::AUTH_FLOW_ACTIVE_DIRECTORY); 521 user_context.SetAuthFlow(UserContext::AUTH_FLOW_ACTIVE_DIRECTORY);
518 user_context.SetIsUsingOAuth(false); 522 user_context.SetIsUsingOAuth(false);
519 user_context.SetUserType( 523 user_context.SetUserType(
520 user_manager::UserType::USER_TYPE_ACTIVE_DIRECTORY); 524 user_manager::UserType::USER_TYPE_ACTIVE_DIRECTORY);
521 Delegate()->CompleteLogin(user_context); 525 Delegate()->CompleteLogin(user_context);
522 break; 526 break;
523 } 527 }
524 case authpolicy::ERROR_PASSWORD_EXPIRED: 528 case authpolicy::ERROR_PASSWORD_EXPIRED:
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 bool GaiaScreenHandler::IsRestrictiveProxy() const { 972 bool GaiaScreenHandler::IsRestrictiveProxy() const {
969 return !disable_restrictive_proxy_check_for_test_ && 973 return !disable_restrictive_proxy_check_for_test_ &&
970 !IsOnline(captive_portal_status_); 974 !IsOnline(captive_portal_status_);
971 } 975 }
972 976
973 void GaiaScreenHandler::DisableRestrictiveProxyCheckForTest() { 977 void GaiaScreenHandler::DisableRestrictiveProxyCheckForTest() {
974 disable_restrictive_proxy_check_for_test_ = true; 978 disable_restrictive_proxy_check_for_test_ = true;
975 } 979 }
976 980
977 } // namespace chromeos 981 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698