Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 } | |
| OLD | NEW |