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

Unified Diff: chrome/browser/chromeos/login/auth/chrome_login_performer.cc

Issue 1108983002: Fetch policy with refresh token. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix user_cloud_policy_manager_chromeos_unittest Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/auth/chrome_login_performer.cc
diff --git a/chrome/browser/chromeos/login/auth/chrome_login_performer.cc b/chrome/browser/chromeos/login/auth/chrome_login_performer.cc
index fcb226b2efbfec59cf239677b3af876b084ee039..8ae1ce559773e709551213bac097bff129eed15d 100644
--- a/chrome/browser/chromeos/login/auth/chrome_login_performer.cc
+++ b/chrome/browser/chromeos/login/auth/chrome_login_performer.cc
@@ -94,6 +94,7 @@ bool ChromeLoginPerformer::IsUserWhitelisted(const std::string& user_id,
void ChromeLoginPerformer::RunOnlineWhitelistCheck(
const std::string& user_id,
bool wildcard_match,
+ const std::string& refresh_token,
const base::Closure& success_callback,
const base::Closure& failure_callback) {
// On enterprise devices, reconfirm login permission with the server.
@@ -102,12 +103,19 @@ void ChromeLoginPerformer::RunOnlineWhitelistCheck(
if (connector->IsEnterpriseManaged() && wildcard_match &&
!connector->IsNonEnterpriseUser(user_id)) {
wildcard_login_checker_.reset(new policy::WildcardLoginChecker());
- wildcard_login_checker_->Start(
- ProfileHelper::GetSigninProfile()->GetRequestContext(),
- base::Bind(&ChromeLoginPerformer::OnlineWildcardLoginCheckCompleted,
- weak_factory_.GetWeakPtr(),
- success_callback,
- failure_callback));
+ if (refresh_token.empty()) {
+ wildcard_login_checker_->Start(
+ ProfileHelper::GetSigninProfile()->GetRequestContext(),
+ base::Bind(&ChromeLoginPerformer::OnlineWildcardLoginCheckCompleted,
+ weak_factory_.GetWeakPtr(), success_callback,
+ failure_callback));
+ } else {
+ wildcard_login_checker_->StartWithRefreshToken(
+ refresh_token,
+ base::Bind(&ChromeLoginPerformer::OnlineWildcardLoginCheckCompleted,
+ weak_factory_.GetWeakPtr(), success_callback,
+ failure_callback));
+ }
} else {
success_callback.Run();
}

Powered by Google App Engine
This is Rietveld 408576698