| 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/shell/example_session_controller_client.h" |
| 6 |
| 7 #include "ash/shell.h" |
| 8 #include "ash/shell/example_factory.h" |
| 9 #include "base/logging.h" |
| 10 |
| 11 namespace ash { |
| 12 namespace shell { |
| 13 |
| 14 namespace { |
| 15 |
| 16 ExampleSessionControllerClient* instance = nullptr; |
| 17 |
| 18 } // namespace |
| 19 |
| 20 ExampleSessionControllerClient::ExampleSessionControllerClient( |
| 21 SessionController* controller) |
| 22 : TestSessionControllerClient(controller) { |
| 23 DCHECK_EQ(instance, nullptr); |
| 24 DCHECK(controller); |
| 25 instance = this; |
| 26 } |
| 27 |
| 28 ExampleSessionControllerClient::~ExampleSessionControllerClient() { |
| 29 DCHECK_EQ(instance, this); |
| 30 instance = nullptr; |
| 31 } |
| 32 |
| 33 // static |
| 34 ExampleSessionControllerClient* ExampleSessionControllerClient::Get() { |
| 35 return instance; |
| 36 } |
| 37 |
| 38 void ExampleSessionControllerClient::Initialize() { |
| 39 // ash_shell has 2 users. |
| 40 CreatePredefinedUserSessions(2); |
| 41 } |
| 42 |
| 43 void ExampleSessionControllerClient::RequestLockScreen() { |
| 44 TestSessionControllerClient::RequestLockScreen(); |
| 45 shell::CreateLockScreen(); |
| 46 Shell::GetInstance()->UpdateShelfVisibility(); |
| 47 } |
| 48 |
| 49 void ExampleSessionControllerClient::UnlockScreen() { |
| 50 TestSessionControllerClient::UnlockScreen(); |
| 51 Shell::GetInstance()->UpdateShelfVisibility(); |
| 52 } |
| 53 |
| 54 } // namespace shell |
| 55 } // namespace ash |
| OLD | NEW |