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

Unified Diff: ash/shell/example_session_controller_client.cc

Issue 2734933004: ash: Use SessionController instead of SessionStateDelegate (Closed)
Patch Set: rebase to get WorkspaceLayoutManagerSoloTest change Created 3 years, 9 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/shell/example_session_controller_client.h ('k') | ash/shell/lock_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell/example_session_controller_client.cc
diff --git a/ash/shell/example_session_controller_client.cc b/ash/shell/example_session_controller_client.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9da0c2ae97aea2a468f4bee6c6fdb4b14f02914b
--- /dev/null
+++ b/ash/shell/example_session_controller_client.cc
@@ -0,0 +1,55 @@
+// 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/shell/example_session_controller_client.h"
+
+#include "ash/shell.h"
+#include "ash/shell/example_factory.h"
+#include "base/logging.h"
+
+namespace ash {
+namespace shell {
+
+namespace {
+
+ExampleSessionControllerClient* instance = nullptr;
+
+} // namespace
+
+ExampleSessionControllerClient::ExampleSessionControllerClient(
+ SessionController* controller)
+ : TestSessionControllerClient(controller) {
+ DCHECK_EQ(instance, nullptr);
+ DCHECK(controller);
+ instance = this;
+}
+
+ExampleSessionControllerClient::~ExampleSessionControllerClient() {
+ DCHECK_EQ(instance, this);
+ instance = nullptr;
+}
+
+// static
+ExampleSessionControllerClient* ExampleSessionControllerClient::Get() {
+ return instance;
+}
+
+void ExampleSessionControllerClient::Initialize() {
+ // ash_shell has 2 users.
+ CreatePredefinedUserSessions(2);
+}
+
+void ExampleSessionControllerClient::RequestLockScreen() {
+ TestSessionControllerClient::RequestLockScreen();
+ shell::CreateLockScreen();
+ Shell::GetInstance()->UpdateShelfVisibility();
+}
+
+void ExampleSessionControllerClient::UnlockScreen() {
+ TestSessionControllerClient::UnlockScreen();
+ Shell::GetInstance()->UpdateShelfVisibility();
+}
+
+} // namespace shell
+} // namespace ash
« no previous file with comments | « ash/shell/example_session_controller_client.h ('k') | ash/shell/lock_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698