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

Unified Diff: chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc

Issue 1021383002: cros: Transfer auth cookies for SAML webview sign-in. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comment Created 5 years, 9 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/policy/user_cloud_policy_manager_chromeos.cc
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc
index b0a29592e3ee17e5aca849f35371d2c647c423df..392968018c716d363f7168a304d3e52208971dd3 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc
@@ -12,10 +12,10 @@
#include "base/sequenced_task_runner.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/chromeos/login/helper.h"
#include "chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h"
#include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h"
#include "chrome/browser/chromeos/policy/wildcard_login_checker.h"
-#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/common/chrome_content_client.h"
#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
@@ -212,7 +212,7 @@ void UserCloudPolicyManagerChromeOS::OnInitializationCompleted(
// access token is already available.
if (!client()->is_registered()) {
if (wait_for_policy_fetch_) {
- FetchPolicyOAuthTokenUsingSigninProfile();
+ FetchPolicyOAuthTokenUsingSigninContext();
} else if (!access_token_.empty()) {
OnAccessTokenAvailable(access_token_);
}
@@ -286,13 +286,11 @@ void UserCloudPolicyManagerChromeOS::GetChromePolicy(PolicyMap* policy_map) {
SetEnterpriseUsersDefaults(policy_map);
}
-void UserCloudPolicyManagerChromeOS::FetchPolicyOAuthTokenUsingSigninProfile() {
- scoped_refptr<net::URLRequestContextGetter> signin_context;
- Profile* signin_profile = chromeos::ProfileHelper::GetSigninProfile();
- if (signin_profile)
- signin_context = signin_profile->GetRequestContext();
+void UserCloudPolicyManagerChromeOS::FetchPolicyOAuthTokenUsingSigninContext() {
+ scoped_refptr<net::URLRequestContextGetter> signin_context =
+ chromeos::login::GetSigninContext();
if (!signin_context.get()) {
- LOG(ERROR) << "No signin Profile for policy oauth token fetch!";
+ LOG(ERROR) << "No signin context for policy oauth token fetch!";
OnOAuth2PolicyTokenFetched(
std::string(), GoogleServiceAuthError(GoogleServiceAuthError::NONE));
return;

Powered by Google App Engine
This is Rietveld 408576698