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

Unified Diff: ash/login/views/lock_screen.cc

Issue 2859363003: cros: Initial structure for views-based lock. (Closed)
Patch Set: Initial upload 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
« no previous file with comments | « ash/login/views/lock_screen.h ('k') | chrome/browser/chromeos/login/lock/screen_locker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ash/login/views/lock_screen.h ('k') | chrome/browser/chromeos/login/lock/screen_locker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698