summaryrefslogtreecommitdiffstats
path: root/mash/shell/shell_application_delegate.cc
diff options
context:
space:
mode:
Diffstat (limited to 'mash/shell/shell_application_delegate.cc')
-rw-r--r--mash/shell/shell_application_delegate.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/mash/shell/shell_application_delegate.cc b/mash/shell/shell_application_delegate.cc
index 8c217bc..408ec7f 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_);