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

Unified Diff: chrome/browser/signin/easy_unlock_service.cc

Issue 608693006: [Easy Unlock] When hardlocking, show a different icon on user (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 3 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.h ('k') | chrome/browser/signin/easy_unlock_service_regular.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/easy_unlock_service.cc
diff --git a/chrome/browser/signin/easy_unlock_service.cc b/chrome/browser/signin/easy_unlock_service.cc
index 8d205f2e8f612dbe0022e6adedd418e2fd96bb1f..8130f9b01f85f2e3bcc89bbc06f316c2f8572014 100644
--- a/chrome/browser/signin/easy_unlock_service.cc
+++ b/chrome/browser/signin/easy_unlock_service.cc
@@ -22,6 +22,7 @@
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
+#include "components/user_manager/user.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "extensions/browser/event_router.h"
@@ -31,6 +32,7 @@
#include "grit/browser_resources.h"
#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/power_manager_client.h"
#endif
@@ -52,6 +54,19 @@ EasyUnlockService* EasyUnlockService::Get(Profile* profile) {
return EasyUnlockServiceFactory::GetForProfile(profile);
}
+// static
+EasyUnlockService* EasyUnlockService::GetForUser(
+ const user_manager::User& user) {
+#if defined(OS_CHROMEOS)
+ Profile* profile = chromeos::ProfileHelper::Get()->GetProfileByUser(&user);
+ if (!profile)
+ return NULL;
+ return EasyUnlockService::Get(profile);
+#else
+ return NULL;
+#endif
+}
+
class EasyUnlockService::BluetoothDetector
: public device::BluetoothAdapter::Observer {
public:
@@ -197,6 +212,7 @@ EasyUnlockScreenlockStateHandler*
if (!screenlock_state_handler_) {
screenlock_state_handler_.reset(new EasyUnlockScreenlockStateHandler(
GetUserEmail(),
+ IsHardlocked(),
GetType() == TYPE_REGULAR ? profile_->GetPrefs() : NULL,
ScreenlockBridge::Get()));
}
@@ -376,6 +392,13 @@ void EasyUnlockService::ResetScreenlockState() {
auth_attempt_.reset();
}
+void EasyUnlockService::SetScreenlockHardlockedState(bool value) {
+ if (screenlock_state_handler_)
+ screenlock_state_handler_->SetHardlocked(value);
+ if (value)
+ auth_attempt_.reset();
+}
+
void EasyUnlockService::Initialize() {
InitializeInternal();
« no previous file with comments | « chrome/browser/signin/easy_unlock_service.h ('k') | chrome/browser/signin/easy_unlock_service_regular.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698