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

Unified Diff: mash/shell/shell_application_delegate.cc

Issue 1810713002: Cascade shutdown of instances (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@55all_users
Patch Set: . Created 4 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 | « mash/shell/shell_application_delegate.h ('k') | mojo/services/catalog/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_);
« no previous file with comments | « mash/shell/shell_application_delegate.h ('k') | mojo/services/catalog/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698