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

Unified Diff: chrome/browser/ui/ash/lock_screen_client_chromeos.cc

Issue 2876673002: mojo api for view based lockscreen (Closed)
Patch Set: 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: chrome/browser/ui/ash/lock_screen_client_chromeos.cc
diff --git a/chrome/browser/ui/ash/lock_screen_client_chromeos.cc b/chrome/browser/ui/ash/lock_screen_client_chromeos.cc
new file mode 100644
index 0000000000000000000000000000000000000000..42aa7054d5c56304b1669e8debc4444ea8513222
--- /dev/null
+++ b/chrome/browser/ui/ash/lock_screen_client_chromeos.cc
@@ -0,0 +1,48 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/ash/lock_screen_client_chromeos.h"
+
+#include "ash/public/interfaces/constants.mojom.h"
+#include "chrome/browser/chromeos/login/lock/screen_locker.h"
+#include "content/public/common/service_manager_connection.h"
+#include "services/service_manager/public/cpp/connector.h"
+
+namespace {
+LockScreenClientChromeOS* g_instance = nullptr;
+} // namespace
+
+LockScreenClientChromeOS::LockScreenClientChromeOS() : binding_(this) {
+ content::ServiceManagerConnection::GetForProcess()
+ ->GetConnector()
+ ->BindInterface(ash::mojom::kServiceName, &lock_screen_);
+ // Register this object as the client interface implementation.
+ lock_screen_->SetClient(binding_.CreateInterfacePtrAndBind());
+
+ DCHECK(!g_instance);
+ g_instance = this;
+}
+
+LockScreenClientChromeOS::~LockScreenClientChromeOS() {
+ DCHECK_EQ(this, g_instance);
+ g_instance = nullptr;
+}
+
+// static
+LockScreenClientChromeOS* LockScreenClientChromeOS::Get() {
+ return g_instance;
+}
+
+void LockScreenClientChromeOS::AuthenticateUser(const AccountId& account_id,
+ const std::string& password,
+ bool authenticated_by_pin) {
+ // TODO(xiaoyinh@): Complete the implementation below.
+ // It should be similar as SigninScreenHandler::HandleAuthenticateUser.
+ chromeos::UserContext user_context(account_id);
+ chromeos::ScreenLocker::default_screen_locker()->Authenticate(user_context);
+}
+
+void LockScreenClientChromeOS::ShowSignInError() {
+ lock_screen_->ShowSignInError();
+}

Powered by Google App Engine
This is Rietveld 408576698