Chromium Code Reviews| Index: ash/login/views/lock_screen.cc |
| diff --git a/ash/login/views/lock_screen.cc b/ash/login/views/lock_screen.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..eefdb5cfdddf200b7b139e5d189ef13adb8a9ac4 |
| --- /dev/null |
| +++ b/ash/login/views/lock_screen.cc |
| @@ -0,0 +1,32 @@ |
| +// 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 "ash/login/views/lock_screen.h" |
| + |
| +#include "ash/login/views/contents_view.h" |
| +#include "ash/public/interfaces/constants.mojom.h" |
| +#include "ash/public/interfaces/session_controller.mojom.h" |
| +#include "ash/shell.h" |
| +#include "ash/shell_delegate.h" |
| +#include "services/service_manager/public/cpp/connector.h" |
| +#include "ui/views/widget/widget.h" |
| + |
| +namespace ash { |
| + |
| +void ShowLockScreenInWidget(views::Widget* widget) { |
| + views::View* contents = new ContentsView(); |
| + widget->SetContentsView(contents); |
| + widget->Show(); |
| + |
| + // Lock screen has been displayed; upate session state so we do not timeout |
| + // and crash. |
| + ash::mojom::SessionInfoPtr info = ash::mojom::SessionInfo::New(); |
| + info->state = session_manager::SessionState::LOCKED; |
| + ash::mojom::SessionControllerPtr session_controller; |
| + ash::Shell::Get()->shell_delegate()->GetShellConnector()->BindInterface( |
| + ash::mojom::kServiceName, &session_controller); |
| + session_controller->SetSessionInfo(std::move(info)); |
|
xiyuan
2017/05/08 17:11:50
In current code, the session state code originates
jdufault
2017/05/08 20:46:51
Done; discussed offline. login will stay in ash wi
|
| +} |
| + |
| +} // namespace ash |