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

Unified Diff: chrome/browser/signin/proximity_auth_facade.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/easy_unlock_service.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/proximity_auth_facade.cc
diff --git a/chrome/browser/signin/proximity_auth_facade.cc b/chrome/browser/signin/proximity_auth_facade.cc
index bef11432ff50e1d4b97580820f0a1517ae330ed6..71de2e8c3f792a308daba7b7ea9de1d04dcfd92a 100644
--- a/chrome/browser/signin/proximity_auth_facade.cc
+++ b/chrome/browser/signin/proximity_auth_facade.cc
@@ -5,46 +5,10 @@
#include "chrome/browser/signin/proximity_auth_facade.h"
#include "base/lazy_instance.h"
-#include "base/logging.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/profiles/profile_window.h"
-#include "chrome/browser/signin/signin_manager_factory.h"
-#include "components/proximity_auth/proximity_auth_client.h"
#include "components/proximity_auth/screenlock_bridge.h"
-#include "components/signin/core/browser/signin_manager_base.h"
namespace {
-// A Chrome-specific implementation of the ProximityAuthClient.
-class ChromeProximityAuthClient : public proximity_auth::ProximityAuthClient {
- public:
- ChromeProximityAuthClient() {}
- ~ChromeProximityAuthClient() override {}
-
- // proximity_auth::ProximityAuthClient implementation:
- std::string GetAuthenticatedUsername(
- content::BrowserContext* browser_context) const override;
- void Lock(content::BrowserContext* browser_context) override;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ChromeProximityAuthClient);
-};
-
-std::string ChromeProximityAuthClient::GetAuthenticatedUsername(
- content::BrowserContext* browser_context) const {
- Profile* profile = Profile::FromBrowserContext(browser_context);
- 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();
-}
-
-void ChromeProximityAuthClient::Lock(content::BrowserContext* browser_context) {
- profiles::LockProfile(Profile::FromBrowserContext(browser_context));
-}
-
// A facade class that is the glue required to initialize and manage the
// lifecycle of various objects of the Proximity Auth component.
class ProximityAuthFacade {
@@ -57,10 +21,9 @@ class ProximityAuthFacade {
friend struct base::DefaultLazyInstanceTraits<ProximityAuthFacade>;
friend struct base::DefaultDeleter<ProximityAuthFacade>;
- ProximityAuthFacade() : screenlock_bridge_(&proximity_auth_client_) {}
+ ProximityAuthFacade() {}
~ProximityAuthFacade() {}
- ChromeProximityAuthClient proximity_auth_client_;
proximity_auth::ScreenlockBridge screenlock_bridge_;
DISALLOW_COPY_AND_ASSIGN(ProximityAuthFacade);
« no previous file with comments | « chrome/browser/signin/easy_unlock_service.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698