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

Unified Diff: chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc

Issue 1767443002: Add enterprise enrollment support for fake users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Check instance before derefing it Created 4 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/saml/saml_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc
diff --git a/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc b/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc
index 8c18f34f2e3bbd5ff1e18d82d6950e145fcbaa85..87f19a8edd3c1e0143c5e2031d1ab84b9087568c 100644
--- a/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc
+++ b/chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc
@@ -92,7 +92,7 @@ void EnterpriseEnrollmentHelperImpl::EnrollUsingAuthCode(
bool fetch_additional_token) {
DCHECK(!started_);
started_ = true;
- oauth_fetcher_.reset(new policy::PolicyOAuth2TokenFetcher());
+ oauth_fetcher_.reset(policy::PolicyOAuth2TokenFetcher::CreateInstance());
oauth_fetcher_->StartWithAuthCode(
auth_code, g_browser_process->system_request_context(),
base::Bind(&EnterpriseEnrollmentHelperImpl::OnTokenFetched,
@@ -114,11 +114,11 @@ void EnterpriseEnrollmentHelperImpl::ClearAuth(const base::Closure& callback) {
(new TokenRevoker())->Start(additional_token_);
if (oauth_fetcher_) {
- if (!oauth_fetcher_->oauth2_access_token().empty())
- (new TokenRevoker())->Start(oauth_fetcher_->oauth2_access_token());
+ if (!oauth_fetcher_->OAuth2AccessToken().empty())
+ (new TokenRevoker())->Start(oauth_fetcher_->OAuth2AccessToken());
- if (!oauth_fetcher_->oauth2_refresh_token().empty())
- (new TokenRevoker())->Start(oauth_fetcher_->oauth2_refresh_token());
+ if (!oauth_fetcher_->OAuth2RefreshToken().empty())
+ (new TokenRevoker())->Start(oauth_fetcher_->OAuth2RefreshToken());
oauth_fetcher_.reset();
} else if (oauth_token_.length()) {
@@ -210,8 +210,8 @@ void EnterpriseEnrollmentHelperImpl::OnTokenFetched(
}
additional_token_ = token;
- std::string refresh_token = oauth_fetcher_->oauth2_refresh_token();
- oauth_fetcher_.reset(new policy::PolicyOAuth2TokenFetcher());
+ std::string refresh_token = oauth_fetcher_->OAuth2RefreshToken();
+ oauth_fetcher_.reset(policy::PolicyOAuth2TokenFetcher::CreateInstance());
oauth_fetcher_->StartWithRefreshToken(
refresh_token, g_browser_process->system_request_context(),
base::Bind(&EnterpriseEnrollmentHelperImpl::OnTokenFetched,
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/saml/saml_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698