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

Unified Diff: chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
Index: chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc
diff --git a/chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc b/chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc
index ed4e0f4b0b8d8d9516013665cbeb178121e87ca4..9ce59c49a357151ef3477b9dd3b3ca67b9c4e7e5 100644
--- a/chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc
+++ b/chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
+#include "components/user_manager/user_id.h"
#include "google_apis/gaia/gaia_constants.h"
#include "google_apis/gaia/gaia_oauth_client.h"
#include "google_apis/gaia/gaia_urls.h"
@@ -63,7 +64,7 @@ class SupervisedUserRefreshTokenFetcherImpl
~SupervisedUserRefreshTokenFetcherImpl() override;
// SupervisedUserRefreshTokenFetcher implementation:
- void Start(const std::string& supervised_user_id,
+ void Start(const user_manager::UserID& supervised_user_id,
const std::string& device_name,
const TokenCallback& callback) override;
@@ -101,7 +102,7 @@ class SupervisedUserRefreshTokenFetcherImpl
URLRequestContextGetter* context_;
std::string device_name_;
- std::string supervised_user_id_;
+ user_manager::UserID supervised_user_id_;
TokenCallback callback_;
scoped_ptr<OAuth2TokenService::Request> access_token_request_;
@@ -121,13 +122,14 @@ SupervisedUserRefreshTokenFetcherImpl::SupervisedUserRefreshTokenFetcherImpl(
account_id_(account_id),
device_id_(device_id),
context_(context),
+ supervised_user_id_(std::string(), std::string()),
access_token_expired_(false) {}
SupervisedUserRefreshTokenFetcherImpl::
~SupervisedUserRefreshTokenFetcherImpl() {}
void SupervisedUserRefreshTokenFetcherImpl::Start(
- const std::string& supervised_user_id,
+ const user_manager::UserID& supervised_user_id,
const std::string& device_name,
const TokenCallback& callback) {
DCHECK(callback_.is_null());
@@ -170,7 +172,7 @@ void SupervisedUserRefreshTokenFetcherImpl::OnGetTokenSuccess(
net::EscapeUrlEncodedData(
GaiaUrls::GetInstance()->oauth2_chrome_client_id(), true).c_str(),
net::EscapeUrlEncodedData(kChromeSyncSupervisedOAuth2Scope, true).c_str(),
- net::EscapeUrlEncodedData(supervised_user_id_, true).c_str(),
+ net::EscapeUrlEncodedData(supervised_user_id_.GetUserEmail(), true).c_str(),
net::EscapeUrlEncodedData(device_name_, true).c_str());
if (!device_id_.empty()) {
body.append(base::StringPrintf(

Powered by Google App Engine
This is Rietveld 408576698