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

Unified Diff: chrome/browser/chromeos/login/screen_locker.cc

Issue 168623003: Add chrome.screenlockPrivate API functions to handle alternate auth types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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
Index: chrome/browser/chromeos/login/screen_locker.cc
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc
index 01a018c39116705744f122388b3ac97bd29a5f0c..b0ed12585ade7a212ac0a2cf20967c94ef9e0246 100644
--- a/chrome/browser/chromeos/login/screen_locker.cc
+++ b/chrome/browser/chromeos/login/screen_locker.cc
@@ -262,11 +262,10 @@ void ScreenLocker::Authenticate(const UserContext& user_context) {
delegate_->SetInputEnabled(false);
delegate_->OnAuthenticate();
- // Send authentication request to app using chrome.screenlockPrivate API
+ // Send authentication request to chrome.screenlockPrivate API event router
// if the authentication type is not the system password.
LoginDisplay::AuthType auth_type = GetAuthType(user_context.username);
if (auth_type != LoginDisplay::OFFLINE_PASSWORD) {
- // Find the user that is authenticating.
const User* unlock_user = NULL;
for (UserList::const_iterator it = users_.begin();
it != users_.end();
@@ -278,8 +277,11 @@ void ScreenLocker::Authenticate(const UserContext& user_context) {
}
LOG_ASSERT(unlock_user);
- // TODO(tengs): dispatch auth attempted event to the screenlockPrivate
- // API's event router.
+ Profile* profile = UserManager::Get()->GetProfileByUser(unlock_user);
+ extensions::ScreenlockPrivateEventRouter* router =
+ extensions::ScreenlockPrivateEventRouter::GetFactoryInstance()
+ ->GetForProfile(profile);
+ router->OnAuthAttempted(auth_type, user_context.password);
return;
}

Powered by Google App Engine
This is Rietveld 408576698