OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "remoting/test/access_token_fetcher.h" | 5 #include "remoting/test/access_token_fetcher.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // This callback should not be called as we do not request the user's email. | 116 // This callback should not be called as we do not request the user's email. |
117 NOTREACHED(); | 117 NOTREACHED(); |
118 } | 118 } |
119 | 119 |
120 void AccessTokenFetcher::OnGetUserIdResponse(const std::string& user_id) { | 120 void AccessTokenFetcher::OnGetUserIdResponse(const std::string& user_id) { |
121 // This callback should not be called as we do not request the user's id. | 121 // This callback should not be called as we do not request the user's id. |
122 NOTREACHED(); | 122 NOTREACHED(); |
123 } | 123 } |
124 | 124 |
125 void AccessTokenFetcher::OnGetUserInfoResponse( | 125 void AccessTokenFetcher::OnGetUserInfoResponse( |
126 scoped_ptr<base::DictionaryValue> user_info) { | 126 std::unique_ptr<base::DictionaryValue> user_info) { |
127 // This callback should not be called as we do not request user info. | 127 // This callback should not be called as we do not request user info. |
128 NOTREACHED(); | 128 NOTREACHED(); |
129 } | 129 } |
130 | 130 |
131 void AccessTokenFetcher::OnGetTokenInfoResponse( | 131 void AccessTokenFetcher::OnGetTokenInfoResponse( |
132 scoped_ptr<base::DictionaryValue> token_info) { | 132 std::unique_ptr<base::DictionaryValue> token_info) { |
133 VLOG(1) << "AccessTokenFetcher::OnGetTokenInfoResponse() Called"; | 133 VLOG(1) << "AccessTokenFetcher::OnGetTokenInfoResponse() Called"; |
134 | 134 |
135 std::string error_string; | 135 std::string error_string; |
136 std::string error_description; | 136 std::string error_description; |
137 | 137 |
138 // Check to see if the token_info we received had any errors, | 138 // Check to see if the token_info we received had any errors, |
139 // otherwise we will assume that it is valid for our purposes. | 139 // otherwise we will assume that it is valid for our purposes. |
140 if (token_info->HasKey("error")) { | 140 if (token_info->HasKey("error")) { |
141 token_info->GetString("error", &error_string); | 141 token_info->GetString("error", &error_string); |
142 token_info->GetString("error_description", &error_description); | 142 token_info->GetString("error_description", &error_description); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 VLOG(2) << "Calling GetTokenInfo to validate access token"; | 179 VLOG(2) << "Calling GetTokenInfo to validate access token"; |
180 | 180 |
181 // Create a new GaiaOAuthClient for each request to GAIA. | 181 // Create a new GaiaOAuthClient for each request to GAIA. |
182 CreateNewGaiaOAuthClientInstance(); | 182 CreateNewGaiaOAuthClientInstance(); |
183 auth_client_->GetTokenInfo(access_token_, kMaxGetTokensRetries, | 183 auth_client_->GetTokenInfo(access_token_, kMaxGetTokensRetries, |
184 this); // GaiaOAuthClient::Delegate* delegate | 184 this); // GaiaOAuthClient::Delegate* delegate |
185 } | 185 } |
186 | 186 |
187 } // namespace test | 187 } // namespace test |
188 } // namespace remoting | 188 } // namespace remoting |
OLD | NEW |