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

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

Issue 257773002: Use new people.get api instead of oauth2/v1/userinfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix user image manager tests 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
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);
61 access_token_fetcher_.reset( 63 access_token_fetcher_.reset(
62 new OAuth2AccessTokenFetcherImpl(this, 64 new OAuth2AccessTokenFetcherImpl(this,
63 system_context_getter_.get(), 65 system_context_getter_.get(),
64 oauth2_refresh_token_)); 66 oauth2_refresh_token_));
65 access_token_fetcher_->Start( 67 access_token_fetcher_->Start(
66 GaiaUrls::GetInstance()->oauth2_chrome_client_id(), 68 GaiaUrls::GetInstance()->oauth2_chrome_client_id(),
67 GaiaUrls::GetInstance()->oauth2_chrome_client_secret(), 69 GaiaUrls::GetInstance()->oauth2_chrome_client_secret(),
68 scopes); 70 scopes);
69 } 71 }
70 72
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 127 }
126 128
127 void PolicyOAuth2TokenFetcher::ForwardPolicyToken( 129 void PolicyOAuth2TokenFetcher::ForwardPolicyToken(
128 const std::string& token, 130 const std::string& token,
129 const GoogleServiceAuthError& error) { 131 const GoogleServiceAuthError& error) {
130 if (!callback_.is_null()) 132 if (!callback_.is_null())
131 callback_.Run(token, error); 133 callback_.Run(token, error);
132 } 134 }
133 135
134 } // namespace policy 136 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698