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

Side by Side Diff: chrome/browser/signin/chrome_proximity_auth_client.cc

Issue 1209193003: [Proximity Auth] Create one ProximityAuthClient per profile, rather than one global one. (Closed) 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/logging.h"
6 #include "chrome/browser/profiles/profile.h"
7 #include "chrome/browser/profiles/profile_window.h"
8 #include "chrome/browser/signin/chrome_proximity_auth_client.h"
9 #include "chrome/browser/signin/signin_manager_factory.h"
10 #include "components/signin/core/browser/signin_manager_base.h"
11
12 ChromeProximityAuthClient::ChromeProximityAuthClient(Profile* profile)
13 : profile_(profile) {
14 }
15
16 ChromeProximityAuthClient::~ChromeProximityAuthClient() {
17 }
18
19 std::string ChromeProximityAuthClient::GetAuthenticatedUsername() const {
20 const SigninManagerBase* signin_manager =
21 SigninManagerFactory::GetForProfileIfExists(profile_);
22 // |profile_| has to be a signed-in profile with SigninManager already
23 // created. Otherwise, just crash to collect stack.
24 DCHECK(signin_manager);
25 return signin_manager->GetAuthenticatedUsername();
Mike Lerman 2015/06/26 13:09:51 Please use GetAuthenticatedAccountId() to uniquely
Ilya Sherman 2015/06/27 08:18:00 Hmm, I'm hesitant to change this, as there seems t
26 }
27
28 void ChromeProximityAuthClient::Lock() {
29 profiles::LockProfile(profile_);
Mike Lerman 2015/06/26 13:09:51 Before calling Lock(), perhaps DCHECK IsProfileLoc
Ilya Sherman 2015/06/27 08:18:00 Acknowledged.
30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698