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

Unified Diff: chrome/browser/extensions/api/screenlock_private/screenlock_private_api.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 | « no previous file | chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc
diff --git a/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc b/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc
index b55a9cb74b11df28ad9d26eafc3856ea233e16cf..cc2001833a4ea4de0a54d18725c614afc3589fb0 100644
--- a/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc
+++ b/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc
@@ -7,6 +7,7 @@
#include "base/lazy_instance.h"
#include "base/values.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/signin/chrome_proximity_auth_client.h"
#include "chrome/browser/signin/easy_unlock_service.h"
#include "chrome/browser/signin/proximity_auth_facade.h"
#include "chrome/common/extensions/api/screenlock_private.h"
@@ -65,6 +66,7 @@ bool ScreenlockPrivateSetLockedFunction::RunAsync() {
scoped_ptr<screenlock::SetLocked::Params> params(
screenlock::SetLocked::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
+ EasyUnlockService* service = EasyUnlockService::Get(GetProfile());
if (params->locked) {
if (extension()->id() == extension_misc::kEasyUnlockAppId &&
AppWindowRegistry::Get(browser_context())
@@ -73,13 +75,12 @@ bool ScreenlockPrivateSetLockedFunction::RunAsync() {
// Mark the Easy Unlock behaviour on the lock screen as the one initiated
// by the Easy Unlock setup app as a trial one.
// TODO(tbarzic): Move this logic to a new easyUnlockPrivate function.
- EasyUnlockService* service = EasyUnlockService::Get(GetProfile());
- if (service)
- service->SetTrialRun();
+ service->SetTrialRun();
}
- GetScreenlockBridgeInstance()->Lock(GetProfile());
+ GetScreenlockBridgeInstance()->Lock();
} else {
- GetScreenlockBridgeInstance()->Unlock(GetProfile());
+ GetScreenlockBridgeInstance()->Unlock(
+ service->proximity_auth_client()->GetAuthenticatedUsername());
}
SendResponse(error_.empty());
return true;
« no previous file with comments | « no previous file | chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698