Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 "ash/login/views/lock_screen.h" | |
| 6 | |
| 7 #include "ash/login/views/contents_view.h" | |
| 8 #include "ash/public/interfaces/constants.mojom.h" | |
| 9 #include "ash/public/interfaces/session_controller.mojom.h" | |
| 10 #include "ash/shell.h" | |
| 11 #include "ash/shell_delegate.h" | |
| 12 #include "services/service_manager/public/cpp/connector.h" | |
| 13 #include "ui/views/widget/widget.h" | |
| 14 | |
| 15 namespace ash { | |
| 16 | |
| 17 void ShowLockScreenInWidget(views::Widget* widget) { | |
| 18 views::View* contents = new ContentsView(); | |
| 19 widget->SetContentsView(contents); | |
| 20 widget->Show(); | |
| 21 | |
| 22 // Lock screen has been displayed; upate session state so we do not timeout | |
| 23 // and crash. | |
| 24 ash::mojom::SessionInfoPtr info = ash::mojom::SessionInfo::New(); | |
| 25 info->state = session_manager::SessionState::LOCKED; | |
| 26 ash::mojom::SessionControllerPtr session_controller; | |
| 27 ash::Shell::Get()->shell_delegate()->GetShellConnector()->BindInterface( | |
| 28 ash::mojom::kServiceName, &session_controller); | |
| 29 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
| |
| 30 } | |
| 31 | |
| 32 } // namespace ash | |
| OLD | NEW |