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

Unified Diff: mash/session/session.cc

Issue 2569953002: Removes example code that isn't correctly wired up (Closed)
Patch Set: Created 4 years 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/session/session.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/session/session.cc
diff --git a/mash/session/session.cc b/mash/session/session.cc
index a28ac333e3f4f07f99002579331cb8961e3a11b5..9306c365cc703eea3bfff16230c29cf98da05116 100644
--- a/mash/session/session.cc
+++ b/mash/session/session.cc
@@ -9,10 +9,7 @@
#include "base/message_loop/message_loop.h"
#include "content/public/common/service_names.mojom.h"
#include "mash/common/config.h"
-#include "mash/login/public/interfaces/constants.mojom.h"
-#include "mash/login/public/interfaces/login.mojom.h"
#include "mash/quick_launch/public/interfaces/constants.mojom.h"
-#include "mash/screenlock/public/interfaces/constants.mojom.h"
#include "services/service_manager/public/cpp/connection.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/service_manager/public/cpp/interface_registry.h"
@@ -31,7 +28,7 @@ void LogAndCallServiceRestartCallback(const std::string& url,
namespace mash {
namespace session {
-Session::Session() : screen_locked_(false) {}
+Session::Session() {}
Session::~Session() {}
void Session::OnStart() {
@@ -44,60 +41,9 @@ void Session::OnStart() {
bool Session::OnConnect(const service_manager::ServiceInfo& remote_info,
service_manager::InterfaceRegistry* registry) {
- registry->AddInterface<mojom::Session>(this);
return true;
}
-void Session::Logout() {
- // TODO(beng): Notify connected listeners that login is happening, potentially
- // give them the option to stop it.
- mash::login::mojom::LoginPtr login;
- context()->connector()->ConnectToInterface(login::mojom::kServiceName,
- &login);
- login->ShowLoginUI();
- // This kills the user environment.
- base::MessageLoop::current()->QuitWhenIdle();
-}
-
-void Session::SwitchUser() {
- mash::login::mojom::LoginPtr login;
- context()->connector()->ConnectToInterface(login::mojom::kServiceName,
- &login);
- login->SwitchUser();
-}
-
-void Session::AddScreenlockStateListener(
- mojom::ScreenlockStateListenerPtr listener) {
- listener->ScreenlockStateChanged(screen_locked_);
- screenlock_listeners_.AddPtr(std::move(listener));
-}
-
-void Session::LockScreen() {
- if (screen_locked_)
- return;
- screen_locked_ = true;
- screenlock_listeners_.ForAllPtrs(
- [](mojom::ScreenlockStateListener* listener) {
- listener->ScreenlockStateChanged(true);
- });
- StartScreenlock();
-}
-void Session::UnlockScreen() {
- if (!screen_locked_)
- return;
- screen_locked_ = false;
- screenlock_listeners_.ForAllPtrs(
- [](mojom::ScreenlockStateListener* listener) {
- listener->ScreenlockStateChanged(false);
- });
- StopScreenlock();
-}
-
-void Session::Create(const service_manager::Identity& remote_identity,
- mojom::SessionRequest request) {
- bindings_.AddBinding(this, std::move(request));
-}
-
void Session::StartWindowManager() {
StartRestartableService(
common::GetWindowManagerServiceName(),
@@ -112,19 +58,6 @@ void Session::StartQuickLaunch() {
base::Unretained(this)));
}
-void Session::StartScreenlock() {
- StartRestartableService(
- screenlock::mojom::kServiceName,
- base::Bind(&Session::StartScreenlock,
- base::Unretained(this)));
-}
-
-void Session::StopScreenlock() {
- auto connection = connections_.find("screenlock");
- DCHECK(connections_.end() != connection);
- connections_.erase(connection);
-}
-
void Session::StartRestartableService(
const std::string& url,
const base::Closure& restart_callback) {
« no previous file with comments | « mash/session/session.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698