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(); |
+} |