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

Unified Diff: ash/login/ui/lock_contents_view.cc

Issue 2876673002: mojo api for view based lockscreen (Closed)
Patch Set: comment Created 3 years, 7 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: ash/login/ui/lock_contents_view.cc
diff --git a/ash/login/ui/lock_contents_view.cc b/ash/login/ui/lock_contents_view.cc
index c676efb97b06675117c0f5b336b1f2d337ff4d07..65342e56bb8a69b3af9612910d9714ef51dd88f5 100644
--- a/ash/login/ui/lock_contents_view.cc
+++ b/ash/login/ui/lock_contents_view.cc
@@ -4,6 +4,9 @@
#include "ash/login/ui/lock_contents_view.h"
+#include "ash/login/lock_screen_controller.h"
+#include "ash/session/session_controller.h"
+#include "ash/shell.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/views/background.h"
#include "ui/views/border.h"
@@ -33,8 +36,15 @@ void LockContentsView::ButtonPressed(views::Button* sender,
const ui::Event& event) {
DCHECK(unlock_button_ == sender);
- // TODO: Run mojo call that talks to backend which unlocks the device.
- NOTIMPLEMENTED();
+ // TODO: user index shouldn't be hard coded here. Complete the implementation
+ // below.
+ const int kUserIndex = 0;
James Cook 2017/05/15 21:15:00 super nit: When we're using a const local just to
xiaoyinh(OOO Sep 11-29) 2017/05/16 17:32:50 Done.
+ SessionController* session_controller = Shell::Get()->session_controller();
+ const mojom::UserSession* const user_session =
+ session_controller->GetUserSession(kUserIndex);
James Cook 2017/05/15 21:15:00 nit: Just inline the call to Shell::Get()->session
xiaoyinh(OOO Sep 11-29) 2017/05/16 17:32:50 Done.
+ Shell::Get()->lock_screen_controller()->AuthenticateUser(
+ user_session->account_id, std::string(),
+ false /* authenticated_by_pin */);
James Cook 2017/05/15 21:15:00 Thanks for documenting what false means here! It m
}
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698