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

Side by Side Diff: chrome/browser/signin/signin_manager.cc

Issue 12217135: Avoid trying to load policy on re-auth. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/signin/signin_manager.h" 5 #include "chrome/browser/signin/signin_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 if (type_ == SIGNIN_TYPE_WITH_CREDENTIALS && 675 if (type_ == SIGNIN_TYPE_WITH_CREDENTIALS &&
676 !gaia::AreEmailsSame(display_email_iter->second, 676 !gaia::AreEmailsSame(display_email_iter->second,
677 possibly_invalid_username_)) { 677 possibly_invalid_username_)) {
678 OnGetUserInfoKeyNotFound(kGetInfoDisplayEmailKey); 678 OnGetUserInfoKeyNotFound(kGetInfoDisplayEmailKey);
679 return; 679 return;
680 } 680 }
681 681
682 possibly_invalid_username_ = email_iter->second; 682 possibly_invalid_username_ = email_iter->second;
683 683
684 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) 684 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS)
685 // TODO(atwilson): Refactor this to expose an observer interface to allow 685 // TODO(atwilson): Move this code out to OneClickSignin instead of having
686 // UserPolicySigninService and OneClickSignin to display UI here, instead 686 // it embedded in SigninManager - we don't want UI logic in SigninManager.
687 // of having this logic in SigninManager. 687 // If this is a new signin (authenticated_username_ is not set) and we have
688 // If we have an OAuth token, try loading policy for this user now, before 688 // an OAuth token, try loading policy for this user now, before any signed in
689 // any signed in services are initialized. If there's no oauth token (the 689 // services are initialized. If there's no oauth token (the user is using the
690 // user is using the old ClientLogin flow) then policy will get loaded once 690 // old ClientLogin flow) then policy will get loaded once the TokenService
691 // the TokenService finishes initializing (not ideal, but it's a reasonable 691 // finishes initializing (not ideal, but it's a reasonable fallback).
692 // fallback). 692 if (authenticated_username_.empty() &&
693 if (!temp_oauth_login_tokens_.refresh_token.empty()) { 693 !temp_oauth_login_tokens_.refresh_token.empty()) {
694 policy::UserPolicySigninService* policy_service = 694 policy::UserPolicySigninService* policy_service =
695 policy::UserPolicySigninServiceFactory::GetForProfile(profile_); 695 policy::UserPolicySigninServiceFactory::GetForProfile(profile_);
696 policy_service->RegisterPolicyClient( 696 policy_service->RegisterPolicyClient(
697 possibly_invalid_username_, 697 possibly_invalid_username_,
698 temp_oauth_login_tokens_.refresh_token, 698 temp_oauth_login_tokens_.refresh_token,
699 base::Bind(&SigninManager::OnRegisteredForPolicy, 699 base::Bind(&SigninManager::OnRegisteredForPolicy,
700 weak_pointer_factory_.GetWeakPtr())); 700 weak_pointer_factory_.GetWeakPtr()));
701 return; 701 return;
702 } 702 }
703 #endif 703 #endif
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 NotifySigninValueChanged(field, value)); 916 NotifySigninValueChanged(field, value));
917 } 917 }
918 918
919 void SigninManager::NotifyDiagnosticsObservers( 919 void SigninManager::NotifyDiagnosticsObservers(
920 const TimedSigninStatusField& field, 920 const TimedSigninStatusField& field,
921 const std::string& value) { 921 const std::string& value) {
922 FOR_EACH_OBSERVER(SigninDiagnosticsObserver, 922 FOR_EACH_OBSERVER(SigninDiagnosticsObserver,
923 signin_diagnostics_observers_, 923 signin_diagnostics_observers_,
924 NotifySigninValueChanged(field, value)); 924 NotifySigninValueChanged(field, value));
925 } 925 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698