Index: components/proximity_auth/screenlock_bridge.cc |
diff --git a/components/proximity_auth/screenlock_bridge.cc b/components/proximity_auth/screenlock_bridge.cc |
index 2af83781dc0dfe986a4ffb3114cf1781361ab2ce..f0fc044f23846017800e1096726e7856fa3f135a 100644 |
--- a/components/proximity_auth/screenlock_bridge.cc |
+++ b/components/proximity_auth/screenlock_bridge.cc |
@@ -7,6 +7,7 @@ |
#include "base/logging.h" |
#include "base/strings/string16.h" |
#include "components/proximity_auth/proximity_auth_client.h" |
+#include "components/user_manager/user_id.h" |
#if defined(OS_CHROMEOS) |
#include "chromeos/dbus/dbus_thread_manager.h" |
@@ -50,7 +51,7 @@ std::string GetIdForIcon(ScreenlockBridge::UserPodCustomIcon icon) { |
} // namespace |
ScreenlockBridge::ScreenlockBridge(ProximityAuthClient* client) |
- : client_(client), lock_handler_(nullptr) { |
+ : client_(client), lock_handler_(nullptr), focused_user_id_(std::string(), std::string()) { |
DCHECK(client_); |
} |
@@ -139,7 +140,7 @@ void ScreenlockBridge::SetLockHandler(LockHandler* lock_handler) { |
FOR_EACH_OBSERVER(Observer, observers_, OnScreenDidUnlock(screen_type)); |
} |
-void ScreenlockBridge::SetFocusedUser(const std::string& user_id) { |
+void ScreenlockBridge::SetFocusedUser(const user_manager::UserID& user_id) { |
if (user_id == focused_user_id_) |
return; |
focused_user_id_ = user_id; |
@@ -161,8 +162,10 @@ void ScreenlockBridge::Lock(content::BrowserContext* browser_context) { |
} |
void ScreenlockBridge::Unlock(content::BrowserContext* browser_context) { |
- if (lock_handler_) |
- lock_handler_->Unlock(client_->GetAuthenticatedUsername(browser_context)); |
+ if (lock_handler_) { |
+ const user_manager::UserID user_id(user_manager::UserID::FromUserEmail(client_->GetAuthenticatedUsername(browser_context))); |
+ lock_handler_->Unlock(user_id); |
+ } |
} |
void ScreenlockBridge::AddObserver(Observer* observer) { |