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.
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"
12 ChromeProximityAuthClient::ChromeProximityAuthClient(Profile
* profile
)
16 ChromeProximityAuthClient::~ChromeProximityAuthClient() {
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();