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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/chrome_proximity_auth_client.cc
diff --git a/chrome/browser/signin/chrome_proximity_auth_client.cc b/chrome/browser/signin/chrome_proximity_auth_client.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4877b4cab9f1dff469843c863aea4f51e89dbde7
--- /dev/null
+++ b/chrome/browser/signin/chrome_proximity_auth_client.cc
@@ -0,0 +1,26 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/logging.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_window.h"
+#include "chrome/browser/signin/chrome_proximity_auth_client.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
+#include "components/signin/core/browser/signin_manager_base.h"
+
+ChromeProximityAuthClient::ChromeProximityAuthClient(Profile* profile)
+ : profile_(profile) {
+}
+
+ChromeProximityAuthClient::~ChromeProximityAuthClient() {
+}
+
+std::string ChromeProximityAuthClient::GetAuthenticatedUsername() const {
+ const SigninManagerBase* signin_manager =
+ SigninManagerFactory::GetForProfileIfExists(profile_);
+ // |profile_| has to be a signed-in profile with SigninManager already
+ // created. Otherwise, just crash to collect stack.
+ DCHECK(signin_manager);
+ return signin_manager->GetAuthenticatedUsername();
+}
« 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