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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/ash/lock_screen_client_chromeos.h"
6
7 #include "ash/public/interfaces/constants.mojom.h"
8 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
9 #include "content/public/common/service_manager_connection.h"
10 #include "services/service_manager/public/cpp/connector.h"
11
12 namespace {
13 LockScreenClientChromeOS* g_instance = nullptr;
14 } // namespace
15
16 LockScreenClientChromeOS::LockScreenClientChromeOS() : binding_(this) {
17 content::ServiceManagerConnection::GetForProcess()
18 ->GetConnector()
19 ->BindInterface(ash::mojom::kServiceName, &lock_screen_);
20 // Register this object as the client interface implementation.
21 lock_screen_->SetClient(binding_.CreateInterfacePtrAndBind());
22
23 DCHECK(!g_instance);
24 g_instance = this;
25 }
26
27 LockScreenClientChromeOS::~LockScreenClientChromeOS() {
28 DCHECK_EQ(this, g_instance);
29 g_instance = nullptr;
30 }
31
32 // static
33 LockScreenClientChromeOS* LockScreenClientChromeOS::Get() {
34 return g_instance;
35 }
36
37 void LockScreenClientChromeOS::AuthenticateUser(const AccountId& account_id,
38 const std::string& password,
39 bool authenticated_by_pin) {
40 // TODO(xiaoyinh@): Complete the implementation below.
41 // It should be similar as SigninScreenHandler::HandleAuthenticateUser.
42 chromeos::UserContext user_context(account_id);
43 chromeos::ScreenLocker::default_screen_locker()->Authenticate(user_context);
44 }
45
46 void LockScreenClientChromeOS::ShowSignInError() {
47 lock_screen_->ShowSignInError();
48 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698