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

Side by Side Diff: chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.cc

Issue 265563002: Revert of Use new people.get api instead of oauth2/v1/userinfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | chrome/browser/chromeos/policy/wildcard_login_checker.cc » ('j') | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/policy_oauth2_token_fetcher.h" 5 #include "chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 void PolicyOAuth2TokenFetcher::StartFetchingRefreshToken() { 51 void PolicyOAuth2TokenFetcher::StartFetchingRefreshToken() {
52 refresh_token_fetcher_.reset(new GaiaAuthFetcher( 52 refresh_token_fetcher_.reset(new GaiaAuthFetcher(
53 this, GaiaConstants::kChromeSource, auth_context_getter_.get())); 53 this, GaiaConstants::kChromeSource, auth_context_getter_.get()));
54 refresh_token_fetcher_->StartCookieForOAuthLoginTokenExchange(std::string()); 54 refresh_token_fetcher_->StartCookieForOAuthLoginTokenExchange(std::string());
55 } 55 }
56 56
57 void PolicyOAuth2TokenFetcher::StartFetchingAccessToken() { 57 void PolicyOAuth2TokenFetcher::StartFetchingAccessToken() {
58 std::vector<std::string> scopes; 58 std::vector<std::string> scopes;
59 scopes.push_back(GaiaConstants::kDeviceManagementServiceOAuth); 59 scopes.push_back(GaiaConstants::kDeviceManagementServiceOAuth);
60 scopes.push_back(GaiaConstants::kOAuthWrapBridgeUserInfoScope); 60 scopes.push_back(GaiaConstants::kOAuthWrapBridgeUserInfoScope);
61 scopes.push_back(GaiaConstants::kGoogleUserInfoEmail);
62 scopes.push_back(GaiaConstants::kGoogleUserInfoProfile);
63 access_token_fetcher_.reset( 61 access_token_fetcher_.reset(
64 new OAuth2AccessTokenFetcherImpl(this, 62 new OAuth2AccessTokenFetcherImpl(this,
65 system_context_getter_.get(), 63 system_context_getter_.get(),
66 oauth2_refresh_token_)); 64 oauth2_refresh_token_));
67 access_token_fetcher_->Start( 65 access_token_fetcher_->Start(
68 GaiaUrls::GetInstance()->oauth2_chrome_client_id(), 66 GaiaUrls::GetInstance()->oauth2_chrome_client_id(),
69 GaiaUrls::GetInstance()->oauth2_chrome_client_secret(), 67 GaiaUrls::GetInstance()->oauth2_chrome_client_secret(),
70 scopes); 68 scopes);
71 } 69 }
72 70
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 125 }
128 126
129 void PolicyOAuth2TokenFetcher::ForwardPolicyToken( 127 void PolicyOAuth2TokenFetcher::ForwardPolicyToken(
130 const std::string& token, 128 const std::string& token,
131 const GoogleServiceAuthError& error) { 129 const GoogleServiceAuthError& error) {
132 if (!callback_.is_null()) 130 if (!callback_.is_null())
133 callback_.Run(token, error); 131 callback_.Run(token, error);
134 } 132 }
135 133
136 } // namespace policy 134 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/wildcard_login_checker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698