| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mash/session/session.h" | 5 #include "mash/session/session.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "mash/login/public/interfaces/login.mojom.h" | 10 #include "mash/login/public/interfaces/login.mojom.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 namespace mash { | 24 namespace mash { |
| 25 namespace session { | 25 namespace session { |
| 26 | 26 |
| 27 Session::Session() : screen_locked_(false) {} | 27 Session::Session() : screen_locked_(false) {} |
| 28 Session::~Session() {} | 28 Session::~Session() {} |
| 29 | 29 |
| 30 void Session::OnStart(const shell::Identity& identity) { | 30 void Session::OnStart(const shell::Identity& identity) { |
| 31 StartAppDriver(); | 31 StartAppDriver(); |
| 32 StartWindowManager(); | 32 StartWindowManager(); |
| 33 StartQuickLaunch(); | 33 StartQuickLaunch(); |
| 34 StartIMEDriver(); |
| 34 // Launch a chrome window for dev convience; don't do this in the long term. | 35 // Launch a chrome window for dev convience; don't do this in the long term. |
| 35 connector()->Connect("exe:chrome"); | 36 connector()->Connect("exe:chrome"); |
| 36 } | 37 } |
| 37 | 38 |
| 38 bool Session::OnConnect(const shell::Identity& remote_identity, | 39 bool Session::OnConnect(const shell::Identity& remote_identity, |
| 39 shell::InterfaceRegistry* registry) { | 40 shell::InterfaceRegistry* registry) { |
| 40 registry->AddInterface<mojom::Session>(this); | 41 registry->AddInterface<mojom::Session>(this); |
| 41 return true; | 42 return true; |
| 42 } | 43 } |
| 43 | 44 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 base::Bind(&Session::StartAppDriver, base::Unretained(this))); | 103 base::Bind(&Session::StartAppDriver, base::Unretained(this))); |
| 103 } | 104 } |
| 104 | 105 |
| 105 void Session::StartQuickLaunch() { | 106 void Session::StartQuickLaunch() { |
| 106 StartRestartableService( | 107 StartRestartableService( |
| 107 "mojo:quick_launch", | 108 "mojo:quick_launch", |
| 108 base::Bind(&Session::StartQuickLaunch, | 109 base::Bind(&Session::StartQuickLaunch, |
| 109 base::Unretained(this))); | 110 base::Unretained(this))); |
| 110 } | 111 } |
| 111 | 112 |
| 113 void Session::StartIMEDriver() { |
| 114 StartRestartableService( |
| 115 "mojo:test_ime_driver", |
| 116 base::Bind(&Session::StartIMEDriver, base::Unretained(this))); |
| 117 } |
| 118 |
| 112 void Session::StartScreenlock() { | 119 void Session::StartScreenlock() { |
| 113 StartRestartableService( | 120 StartRestartableService( |
| 114 "mojo:screenlock", | 121 "mojo:screenlock", |
| 115 base::Bind(&Session::StartScreenlock, | 122 base::Bind(&Session::StartScreenlock, |
| 116 base::Unretained(this))); | 123 base::Unretained(this))); |
| 117 } | 124 } |
| 118 | 125 |
| 119 void Session::StopScreenlock() { | 126 void Session::StopScreenlock() { |
| 120 auto connection = connections_.find("mojo:screenlock"); | 127 auto connection = connections_.find("mojo:screenlock"); |
| 121 DCHECK(connections_.end() != connection); | 128 DCHECK(connections_.end() != connection); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 132 // Note: |connection| may be null if we've lost our connection to the shell. | 139 // Note: |connection| may be null if we've lost our connection to the shell. |
| 133 if (connection) { | 140 if (connection) { |
| 134 connection->SetConnectionLostClosure( | 141 connection->SetConnectionLostClosure( |
| 135 base::Bind(&LogAndCallServiceRestartCallback, url, restart_callback)); | 142 base::Bind(&LogAndCallServiceRestartCallback, url, restart_callback)); |
| 136 connections_[url] = std::move(connection); | 143 connections_[url] = std::move(connection); |
| 137 } | 144 } |
| 138 } | 145 } |
| 139 | 146 |
| 140 } // namespace session | 147 } // namespace session |
| 141 } // namespace main | 148 } // namespace main |
| OLD | NEW |