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

Side by Side Diff: chrome/browser/chromeos/login/easy_unlock/bootstrap_user_context_initializer.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/login/easy_unlock/bootstrap_user_context_initi alizer.h" 5 #include "chrome/browser/chromeos/login/easy_unlock/bootstrap_user_context_initi alizer.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 kMaxGaiaRetries, this); 160 kMaxGaiaRetries, this);
161 } 161 }
162 162
163 void BootstrapUserContextInitializer::OnRefreshTokenResponse( 163 void BootstrapUserContextInitializer::OnRefreshTokenResponse(
164 const std::string& access_token, 164 const std::string& access_token,
165 int expires_in_seconds) { 165 int expires_in_seconds) {
166 token_fetcher_->GetUserInfo(access_token, kMaxGaiaRetries, this); 166 token_fetcher_->GetUserInfo(access_token, kMaxGaiaRetries, this);
167 } 167 }
168 168
169 void BootstrapUserContextInitializer::OnGetUserInfoResponse( 169 void BootstrapUserContextInitializer::OnGetUserInfoResponse(
170 scoped_ptr<base::DictionaryValue> user_info) { 170 std::unique_ptr<base::DictionaryValue> user_info) {
171 std::string email; 171 std::string email;
172 std::string gaia_id; 172 std::string gaia_id;
173 if (!user_info->GetString("email", &email) || 173 if (!user_info->GetString("email", &email) ||
174 !user_info->GetString("id", &gaia_id)) { 174 !user_info->GetString("id", &gaia_id)) {
175 LOG(ERROR) << "Bad user info."; 175 LOG(ERROR) << "Bad user info.";
176 Notify(false); 176 Notify(false);
177 return; 177 return;
178 } 178 }
179 179
180 user_context_.SetAccountId(user_manager::known_user::GetAccountId( 180 user_context_.SetAccountId(user_manager::known_user::GetAccountId(
(...skipping 22 matching lines...) Expand all
203 EasyUnlockService::Get(ProfileHelper::GetSigninProfile()); 203 EasyUnlockService::Get(ProfileHelper::GetSigninProfile());
204 service->RemoveObserver(this); 204 service->RemoveObserver(this);
205 205
206 service->AttemptAuth( 206 service->AttemptAuth(
207 user_context_.GetAccountId(), 207 user_context_.GetAccountId(),
208 base::Bind(&BootstrapUserContextInitializer::OnEasyUnlockAuthenticated, 208 base::Bind(&BootstrapUserContextInitializer::OnEasyUnlockAuthenticated,
209 weak_ptr_factory_.GetWeakPtr())); 209 weak_ptr_factory_.GetWeakPtr()));
210 } 210 }
211 211
212 } // namespace chromeos 212 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698