| Index: mash/shell/shell_application_delegate.cc
|
| diff --git a/mash/shell/shell_application_delegate.cc b/mash/shell/shell_application_delegate.cc
|
| index 8c217bc381306d33db3af615292833b45131e526..408ec7f9986d8b8d4ff4b41c7e02d39a508bf800 100644
|
| --- a/mash/shell/shell_application_delegate.cc
|
| +++ b/mash/shell/shell_application_delegate.cc
|
| @@ -6,6 +6,8 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/command_line.h"
|
| +#include "base/message_loop/message_loop.h"
|
| +#include "mash/login/public/interfaces/login.mojom.h"
|
| #include "mojo/shell/public/cpp/connection.h"
|
| #include "mojo/shell/public/cpp/connector.h"
|
|
|
| @@ -32,6 +34,22 @@ bool ShellApplicationDelegate::AcceptConnection(mojo::Connection* connection) {
|
| return true;
|
| }
|
|
|
| +void ShellApplicationDelegate::Logout() {
|
| + // TODO(beng): Notify connected listeners that login is happening, potentially
|
| + // give them the option to stop it.
|
| + mash::login::mojom::LoginPtr login;
|
| + connector_->ConnectToInterface("mojo:login", &login);
|
| + login->ShowLoginUI();
|
| + // This kills the user environment.
|
| + base::MessageLoop::current()->QuitWhenIdle();
|
| +}
|
| +
|
| +void ShellApplicationDelegate::SwitchUser() {
|
| + mash::login::mojom::LoginPtr login;
|
| + connector_->ConnectToInterface("mojo:login", &login);
|
| + login->SwitchUser();
|
| +}
|
| +
|
| void ShellApplicationDelegate::AddScreenlockStateListener(
|
| mojom::ScreenlockStateListenerPtr listener) {
|
| listener->ScreenlockStateChanged(screen_locked_);
|
|
|