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

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: Disable tests on non-ChromeOS, since there's nothing left to test on the other platforms Created 5 years, 5 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();
26 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/chrome_proximity_auth_client.h ('k') | chrome/browser/signin/easy_unlock_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698