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

Side by Side 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: 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 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/chromeos/policy/user_cloud_policy_manager_chromeos.h" 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/metrics/sparse_histogram.h" 11 #include "base/metrics/sparse_histogram.h"
12 #include "base/sequenced_task_runner.h" 12 #include "base/sequenced_task_runner.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
15 #include "chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h" 16 #include "chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h"
16 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h" 17 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h"
17 #include "chrome/browser/chromeos/policy/wildcard_login_checker.h" 18 #include "chrome/browser/chromeos/policy/wildcard_login_checker.h"
18 #include "chrome/browser/chromeos/profiles/profile_helper.h"
19 #include "chrome/browser/lifetime/application_lifetime.h" 19 #include "chrome/browser/lifetime/application_lifetime.h"
20 #include "chrome/common/chrome_content_client.h" 20 #include "chrome/common/chrome_content_client.h"
21 #include "components/policy/core/common/cloud/cloud_external_data_manager.h" 21 #include "components/policy/core/common/cloud/cloud_external_data_manager.h"
22 #include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h" 22 #include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h"
23 #include "components/policy/core/common/cloud/device_management_service.h" 23 #include "components/policy/core/common/cloud/device_management_service.h"
24 #include "components/policy/core/common/cloud/system_policy_request_context.h" 24 #include "components/policy/core/common/cloud/system_policy_request_context.h"
25 #include "components/policy/core/common/policy_map.h" 25 #include "components/policy/core/common/policy_map.h"
26 #include "components/policy/core/common/policy_pref_names.h" 26 #include "components/policy/core/common/policy_pref_names.h"
27 #include "components/policy/core/common/policy_types.h" 27 #include "components/policy/core/common/policy_types.h"
28 #include "components/user_manager/user_manager.h" 28 #include "components/user_manager/user_manager.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 // If the store has a verified policy blob received from the server then apply 281 // If the store has a verified policy blob received from the server then apply
282 // the defaults for policies that haven't been configured by the administrator 282 // the defaults for policies that haven't been configured by the administrator
283 // given that this is an enterprise user. 283 // given that this is an enterprise user.
284 if (!store()->has_policy()) 284 if (!store()->has_policy())
285 return; 285 return;
286 SetEnterpriseUsersDefaults(policy_map); 286 SetEnterpriseUsersDefaults(policy_map);
287 } 287 }
288 288
289 void UserCloudPolicyManagerChromeOS::FetchPolicyOAuthTokenUsingSigninProfile() { 289 void UserCloudPolicyManagerChromeOS::FetchPolicyOAuthTokenUsingSigninProfile() {
290 scoped_refptr<net::URLRequestContextGetter> signin_context; 290 scoped_refptr<net::URLRequestContextGetter> signin_context =
291 Profile* signin_profile = chromeos::ProfileHelper::GetSigninProfile(); 291 chromeos::UserSessionManager::GetInstance()->GetAuthRequestContext();
292 if (signin_profile)
293 signin_context = signin_profile->GetRequestContext();
294 if (!signin_context.get()) { 292 if (!signin_context.get()) {
295 LOG(ERROR) << "No signin Profile for policy oauth token fetch!"; 293 LOG(ERROR) << "No signin Profile for policy oauth token fetch!";
296 OnOAuth2PolicyTokenFetched( 294 OnOAuth2PolicyTokenFetched(
297 std::string(), GoogleServiceAuthError(GoogleServiceAuthError::NONE)); 295 std::string(), GoogleServiceAuthError(GoogleServiceAuthError::NONE));
298 return; 296 return;
299 } 297 }
300 298
301 token_fetcher_.reset(new PolicyOAuth2TokenFetcher( 299 token_fetcher_.reset(new PolicyOAuth2TokenFetcher(
302 signin_context.get(), 300 signin_context.get(),
303 g_browser_process->system_request_context(), 301 g_browser_process->system_request_context(),
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 // OnComponentCloudPolicyUpdated() once it's ready. 386 // OnComponentCloudPolicyUpdated() once it's ready.
389 return; 387 return;
390 } 388 }
391 389
392 core()->StartRefreshScheduler(); 390 core()->StartRefreshScheduler();
393 core()->TrackRefreshDelayPref(local_state_, 391 core()->TrackRefreshDelayPref(local_state_,
394 policy_prefs::kUserPolicyRefreshRate); 392 policy_prefs::kUserPolicyRefreshRate);
395 } 393 }
396 394
397 } // namespace policy 395 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698