Index: components/signin/content/screenlock_bridge.cc |
diff --git a/chrome/browser/signin/screenlock_bridge.cc b/components/signin/content/screenlock_bridge.cc |
similarity index 86% |
rename from chrome/browser/signin/screenlock_bridge.cc |
rename to components/signin/content/screenlock_bridge.cc |
index c8db7a3c6d5dbfa360842ac4957e9961cf157a88..66a3e0b47390ee1aa7afa12f68ef0ab66f045860 100644 |
--- a/chrome/browser/signin/screenlock_bridge.cc |
+++ b/components/signin/content/screenlock_bridge.cc |
@@ -2,13 +2,10 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/browser/signin/screenlock_bridge.h" |
+#include "components/signin/content/screenlock_bridge.h" |
Ilya Sherman
2015/04/21 23:02:39
I think the proximity_auth component is more appro
|
#include "base/logging.h" |
#include "base/strings/string16.h" |
-#include "chrome/browser/profiles/profile_window.h" |
-#include "chrome/browser/signin/signin_manager_factory.h" |
-#include "components/signin/core/browser/signin_manager.h" |
#if defined(OS_CHROMEOS) |
#include "chromeos/dbus/dbus_thread_manager.h" |
@@ -64,7 +61,8 @@ ScreenlockBridge::UserPodCustomIconOptions::UserPodCustomIconOptions() |
is_trial_run_(false) { |
} |
-ScreenlockBridge::UserPodCustomIconOptions::~UserPodCustomIconOptions() {} |
+ScreenlockBridge::UserPodCustomIconOptions::~UserPodCustomIconOptions() { |
+} |
scoped_ptr<base::DictionaryValue> |
ScreenlockBridge::UserPodCustomIconOptions::ToDictionaryValue() const { |
@@ -116,16 +114,6 @@ void ScreenlockBridge::UserPodCustomIconOptions::SetTrialRun() { |
is_trial_run_ = true; |
} |
-// static |
-std::string ScreenlockBridge::GetAuthenticatedUserEmail( |
- const Profile* profile) { |
- // |profile| has to be a signed-in profile with SigninManager already |
- // created. Otherwise, just crash to collect stack. |
- const SigninManagerBase* signin_manager = |
- SigninManagerFactory::GetForProfileIfExists(profile); |
- return signin_manager->GetAuthenticatedUsername(); |
-} |
- |
ScreenlockBridge::ScreenlockBridge() : lock_handler_(NULL) { |
} |
@@ -166,19 +154,20 @@ bool ScreenlockBridge::IsLocked() const { |
return lock_handler_ != NULL; |
} |
-void ScreenlockBridge::Lock(Profile* profile) { |
+void ScreenlockBridge::Lock(content::BrowserContext* browser_context) { |
#if defined(OS_CHROMEOS) |
chromeos::SessionManagerClient* session_manager = |
chromeos::DBusThreadManager::Get()->GetSessionManagerClient(); |
session_manager->RequestLockScreen(); |
#else |
- profiles::LockProfile(profile); |
+ if (lock_handler_) |
+ lock_handler_->Lock(browser_context); |
#endif |
} |
-void ScreenlockBridge::Unlock(Profile* profile) { |
+void ScreenlockBridge::Unlock(content::BrowserContext* browser_context) { |
if (lock_handler_) |
- lock_handler_->Unlock(GetAuthenticatedUserEmail(profile)); |
+ lock_handler_->Unlock(browser_context); |
} |
void ScreenlockBridge::AddObserver(Observer* observer) { |