| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chromeos/dbus/session_manager_client.h" | 5 #include "chromeos/dbus/session_manager_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "dbus/bus.h" | 10 #include "dbus/bus.h" |
| 11 #include "dbus/message.h" | 11 #include "dbus/message.h" |
| 12 #include "dbus/object_path.h" | 12 #include "dbus/object_path.h" |
| 13 #include "dbus/object_proxy.h" | 13 #include "dbus/object_proxy.h" |
| 14 #include "third_party/cros_system_api/dbus/service_constants.h" | 14 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 15 | 15 |
| 16 namespace chromeos { | 16 namespace chromeos { |
| 17 | 17 |
| 18 // The SessionManagerClient implementation used in production. | 18 // The SessionManagerClient implementation used in production. |
| 19 class SessionManagerClientImpl : public SessionManagerClient { | 19 class SessionManagerClientImpl : public SessionManagerClient { |
| 20 public: | 20 public: |
| 21 explicit SessionManagerClientImpl(dbus::Bus* bus) | 21 explicit SessionManagerClientImpl(dbus::Bus* bus) |
| 22 : session_manager_proxy_(NULL), | 22 : session_manager_proxy_(NULL), |
| 23 screen_locked_(false), |
| 23 weak_ptr_factory_(this) { | 24 weak_ptr_factory_(this) { |
| 24 session_manager_proxy_ = bus->GetObjectProxy( | 25 session_manager_proxy_ = bus->GetObjectProxy( |
| 25 login_manager::kSessionManagerServiceName, | 26 login_manager::kSessionManagerServiceName, |
| 26 dbus::ObjectPath(login_manager::kSessionManagerServicePath)); | 27 dbus::ObjectPath(login_manager::kSessionManagerServicePath)); |
| 27 | 28 |
| 28 // Monitor the D-Bus signal for owner key changes. | |
| 29 session_manager_proxy_->ConnectToSignal( | 29 session_manager_proxy_->ConnectToSignal( |
| 30 chromium::kChromiumInterface, | 30 chromium::kChromiumInterface, |
| 31 chromium::kOwnerKeySetSignal, | 31 chromium::kOwnerKeySetSignal, |
| 32 base::Bind(&SessionManagerClientImpl::OwnerKeySetReceived, | 32 base::Bind(&SessionManagerClientImpl::OwnerKeySetReceived, |
| 33 weak_ptr_factory_.GetWeakPtr()), | 33 weak_ptr_factory_.GetWeakPtr()), |
| 34 base::Bind(&SessionManagerClientImpl::SignalConnected, | 34 base::Bind(&SessionManagerClientImpl::SignalConnected, |
| 35 weak_ptr_factory_.GetWeakPtr())); | 35 weak_ptr_factory_.GetWeakPtr())); |
| 36 | 36 |
| 37 // Monitor the D-Bus signal for property changes. | |
| 38 session_manager_proxy_->ConnectToSignal( | 37 session_manager_proxy_->ConnectToSignal( |
| 39 chromium::kChromiumInterface, | 38 chromium::kChromiumInterface, |
| 40 chromium::kPropertyChangeCompleteSignal, | 39 chromium::kPropertyChangeCompleteSignal, |
| 41 base::Bind(&SessionManagerClientImpl::PropertyChangeCompleteReceived, | 40 base::Bind(&SessionManagerClientImpl::PropertyChangeCompleteReceived, |
| 42 weak_ptr_factory_.GetWeakPtr()), | 41 weak_ptr_factory_.GetWeakPtr()), |
| 43 base::Bind(&SessionManagerClientImpl::SignalConnected, | 42 base::Bind(&SessionManagerClientImpl::SignalConnected, |
| 44 weak_ptr_factory_.GetWeakPtr())); | 43 weak_ptr_factory_.GetWeakPtr())); |
| 44 |
| 45 session_manager_proxy_->ConnectToSignal( |
| 46 chromium::kChromiumInterface, |
| 47 chromium::kLockScreenSignal, |
| 48 base::Bind(&SessionManagerClientImpl::ScreenLockReceived, |
| 49 weak_ptr_factory_.GetWeakPtr()), |
| 50 base::Bind(&SessionManagerClientImpl::SignalConnected, |
| 51 weak_ptr_factory_.GetWeakPtr())); |
| 52 |
| 53 session_manager_proxy_->ConnectToSignal( |
| 54 chromium::kChromiumInterface, |
| 55 chromium::kUnlockScreenSignal, |
| 56 base::Bind(&SessionManagerClientImpl::ScreenUnlockReceived, |
| 57 weak_ptr_factory_.GetWeakPtr()), |
| 58 base::Bind(&SessionManagerClientImpl::SignalConnected, |
| 59 weak_ptr_factory_.GetWeakPtr())); |
| 45 } | 60 } |
| 46 | 61 |
| 47 virtual ~SessionManagerClientImpl() { | 62 virtual ~SessionManagerClientImpl() { |
| 48 } | 63 } |
| 49 | 64 |
| 50 // SessionManagerClient override. | 65 // SessionManagerClient overrides: |
| 51 virtual void AddObserver(Observer* observer) OVERRIDE { | 66 virtual void AddObserver(Observer* observer) OVERRIDE { |
| 52 observers_.AddObserver(observer); | 67 observers_.AddObserver(observer); |
| 53 } | 68 } |
| 54 | 69 |
| 55 // SessionManagerClient override. | |
| 56 virtual void RemoveObserver(Observer* observer) OVERRIDE { | 70 virtual void RemoveObserver(Observer* observer) OVERRIDE { |
| 57 observers_.RemoveObserver(observer); | 71 observers_.RemoveObserver(observer); |
| 58 } | 72 } |
| 59 | 73 |
| 60 // SessionManagerClient override. | 74 virtual bool HasObserver(Observer* observer) OVERRIDE { |
| 61 virtual void EmitLoginPromptReady() OVERRIDE { | 75 return observers_.HasObserver(observer); |
| 62 dbus::MethodCall method_call( | |
| 63 login_manager::kSessionManagerInterface, | |
| 64 login_manager::kSessionManagerEmitLoginPromptReady); | |
| 65 session_manager_proxy_->CallMethod( | |
| 66 &method_call, | |
| 67 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | |
| 68 base::Bind(&SessionManagerClientImpl::OnEmitLoginPromptReady, | |
| 69 weak_ptr_factory_.GetWeakPtr())); | |
| 70 } | 76 } |
| 71 | 77 |
| 72 // SessionManagerClient override. | 78 virtual void EmitLoginPromptReady() OVERRIDE { |
| 73 virtual void EmitLoginPromptVisible() OVERRIDE { | 79 SimpleMethodCallToSessionManager( |
| 74 dbus::MethodCall method_call( | 80 login_manager::kSessionManagerEmitLoginPromptReady); |
| 75 login_manager::kSessionManagerInterface, | |
| 76 login_manager::kSessionManagerEmitLoginPromptVisible); | |
| 77 session_manager_proxy_->CallMethod( | |
| 78 &method_call, | |
| 79 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | |
| 80 base::Bind(&SessionManagerClientImpl::OnEmitLoginPromptVisible, | |
| 81 weak_ptr_factory_.GetWeakPtr())); | |
| 82 } | 81 } |
| 83 | 82 |
| 84 // SessionManagerClient override. | 83 virtual void EmitLoginPromptVisible() OVERRIDE { |
| 84 SimpleMethodCallToSessionManager( |
| 85 login_manager::kSessionManagerEmitLoginPromptVisible); |
| 86 } |
| 87 |
| 85 virtual void RestartJob(int pid, const std::string& command_line) OVERRIDE { | 88 virtual void RestartJob(int pid, const std::string& command_line) OVERRIDE { |
| 86 dbus::MethodCall method_call(login_manager::kSessionManagerInterface, | 89 dbus::MethodCall method_call(login_manager::kSessionManagerInterface, |
| 87 login_manager::kSessionManagerRestartJob); | 90 login_manager::kSessionManagerRestartJob); |
| 88 dbus::MessageWriter writer(&method_call); | 91 dbus::MessageWriter writer(&method_call); |
| 89 writer.AppendInt32(pid); | 92 writer.AppendInt32(pid); |
| 90 writer.AppendString(command_line); | 93 writer.AppendString(command_line); |
| 91 session_manager_proxy_->CallMethod( | 94 session_manager_proxy_->CallMethod( |
| 92 &method_call, | 95 &method_call, |
| 93 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 96 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
| 94 base::Bind(&SessionManagerClientImpl::OnRestartJob, | 97 base::Bind(&SessionManagerClientImpl::OnRestartJob, |
| 95 weak_ptr_factory_.GetWeakPtr())); | 98 weak_ptr_factory_.GetWeakPtr())); |
| 96 } | 99 } |
| 97 | 100 |
| 98 // SessionManagerClient override. | |
| 99 virtual void RestartEntd() OVERRIDE { | 101 virtual void RestartEntd() OVERRIDE { |
| 100 dbus::MethodCall method_call(login_manager::kSessionManagerInterface, | 102 SimpleMethodCallToSessionManager(login_manager::kSessionManagerRestartEntd); |
| 101 login_manager::kSessionManagerRestartEntd); | |
| 102 session_manager_proxy_->CallMethod( | |
| 103 &method_call, | |
| 104 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | |
| 105 base::Bind(&SessionManagerClientImpl::OnRestartEntd, | |
| 106 weak_ptr_factory_.GetWeakPtr())); | |
| 107 } | 103 } |
| 108 | 104 |
| 109 // SessionManagerClient override. | |
| 110 virtual void StartSession(const std::string& user_email) OVERRIDE { | 105 virtual void StartSession(const std::string& user_email) OVERRIDE { |
| 111 dbus::MethodCall method_call(login_manager::kSessionManagerInterface, | 106 dbus::MethodCall method_call(login_manager::kSessionManagerInterface, |
| 112 login_manager::kSessionManagerStartSession); | 107 login_manager::kSessionManagerStartSession); |
| 113 dbus::MessageWriter writer(&method_call); | 108 dbus::MessageWriter writer(&method_call); |
| 114 writer.AppendString(user_email); | 109 writer.AppendString(user_email); |
| 115 writer.AppendString(""); // Unique ID is deprecated | 110 writer.AppendString(""); // Unique ID is deprecated |
| 116 session_manager_proxy_->CallMethod( | 111 session_manager_proxy_->CallMethod( |
| 117 &method_call, | 112 &method_call, |
| 118 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 113 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
| 119 base::Bind(&SessionManagerClientImpl::OnStartSession, | 114 base::Bind(&SessionManagerClientImpl::OnStartSession, |
| 120 weak_ptr_factory_.GetWeakPtr())); | 115 weak_ptr_factory_.GetWeakPtr())); |
| 121 } | 116 } |
| 122 | 117 |
| 123 // SessionManagerClient override. | |
| 124 virtual void StopSession() OVERRIDE { | 118 virtual void StopSession() OVERRIDE { |
| 125 dbus::MethodCall method_call(login_manager::kSessionManagerInterface, | 119 dbus::MethodCall method_call(login_manager::kSessionManagerInterface, |
| 126 login_manager::kSessionManagerStopSession); | 120 login_manager::kSessionManagerStopSession); |
| 127 dbus::MessageWriter writer(&method_call); | 121 dbus::MessageWriter writer(&method_call); |
| 128 writer.AppendString(""); // Unique ID is deprecated | 122 writer.AppendString(""); // Unique ID is deprecated |
| 129 session_manager_proxy_->CallMethod( | 123 session_manager_proxy_->CallMethod( |
| 130 &method_call, | 124 &method_call, |
| 131 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 125 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
| 132 base::Bind(&SessionManagerClientImpl::OnStopSession, | 126 base::Bind(&SessionManagerClientImpl::OnStopSession, |
| 133 weak_ptr_factory_.GetWeakPtr())); | 127 weak_ptr_factory_.GetWeakPtr())); |
| 134 } | 128 } |
| 135 | 129 |
| 136 // SessionManagerClient override. | 130 virtual void RequestLockScreen() OVERRIDE { |
| 131 SimpleMethodCallToSessionManager(login_manager::kSessionManagerLockScreen); |
| 132 } |
| 133 |
| 134 virtual void RequestUnlockScreen() OVERRIDE { |
| 135 SimpleMethodCallToSessionManager( |
| 136 login_manager::kSessionManagerUnlockScreen); |
| 137 } |
| 138 |
| 139 virtual bool GetIsScreenLocked() OVERRIDE { |
| 140 return screen_locked_; |
| 141 } |
| 142 |
| 137 virtual void RetrieveDevicePolicy( | 143 virtual void RetrieveDevicePolicy( |
| 138 const RetrievePolicyCallback& callback) OVERRIDE { | 144 const RetrievePolicyCallback& callback) OVERRIDE { |
| 139 CallRetrievePolicy(login_manager::kSessionManagerRetrievePolicy, | 145 CallRetrievePolicy(login_manager::kSessionManagerRetrievePolicy, |
| 140 callback); | 146 callback); |
| 141 } | 147 } |
| 142 | 148 |
| 143 // SessionManagerClient override. | |
| 144 virtual void RetrieveUserPolicy( | 149 virtual void RetrieveUserPolicy( |
| 145 const RetrievePolicyCallback& callback) OVERRIDE { | 150 const RetrievePolicyCallback& callback) OVERRIDE { |
| 146 CallRetrievePolicy(login_manager::kSessionManagerRetrieveUserPolicy, | 151 CallRetrievePolicy(login_manager::kSessionManagerRetrieveUserPolicy, |
| 147 callback); | 152 callback); |
| 148 } | 153 } |
| 149 | 154 |
| 150 // SessionManagerClient override. | |
| 151 virtual void StoreDevicePolicy(const std::string& policy_blob, | 155 virtual void StoreDevicePolicy(const std::string& policy_blob, |
| 152 const StorePolicyCallback& callback) OVERRIDE { | 156 const StorePolicyCallback& callback) OVERRIDE { |
| 153 CallStorePolicy(login_manager::kSessionManagerStorePolicy, | 157 CallStorePolicy(login_manager::kSessionManagerStorePolicy, |
| 154 policy_blob, callback); | 158 policy_blob, callback); |
| 155 } | 159 } |
| 156 | 160 |
| 157 // SessionManagerClient override. | |
| 158 virtual void StoreUserPolicy(const std::string& policy_blob, | 161 virtual void StoreUserPolicy(const std::string& policy_blob, |
| 159 const StorePolicyCallback& callback) OVERRIDE { | 162 const StorePolicyCallback& callback) OVERRIDE { |
| 160 CallStorePolicy(login_manager::kSessionManagerStoreUserPolicy, | 163 CallStorePolicy(login_manager::kSessionManagerStoreUserPolicy, |
| 161 policy_blob, callback); | 164 policy_blob, callback); |
| 162 } | 165 } |
| 163 | 166 |
| 164 private: | 167 private: |
| 168 // Makes a method call to the session manager with no arguments and no |
| 169 // response. |
| 170 void SimpleMethodCallToSessionManager(const std::string& method_name) { |
| 171 dbus::MethodCall method_call(login_manager::kSessionManagerInterface, |
| 172 method_name); |
| 173 session_manager_proxy_->CallMethod( |
| 174 &method_call, |
| 175 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
| 176 dbus::ObjectProxy::EmptyResponseCallback()); |
| 177 } |
| 178 |
| 165 // Helper for Retrieve{User,Device}Policy. | 179 // Helper for Retrieve{User,Device}Policy. |
| 166 virtual void CallRetrievePolicy(const std::string& method_name, | 180 virtual void CallRetrievePolicy(const std::string& method_name, |
| 167 const RetrievePolicyCallback& callback) { | 181 const RetrievePolicyCallback& callback) { |
| 168 dbus::MethodCall method_call(login_manager::kSessionManagerInterface, | 182 dbus::MethodCall method_call(login_manager::kSessionManagerInterface, |
| 169 method_name); | 183 method_name); |
| 170 session_manager_proxy_->CallMethod( | 184 session_manager_proxy_->CallMethod( |
| 171 &method_call, | 185 &method_call, |
| 172 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 186 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
| 173 base::Bind(&SessionManagerClientImpl::OnRetrievePolicy, | 187 base::Bind(&SessionManagerClientImpl::OnRetrievePolicy, |
| 174 weak_ptr_factory_.GetWeakPtr(), | 188 weak_ptr_factory_.GetWeakPtr(), |
| (...skipping 13 matching lines...) Expand all Loading... |
| 188 reinterpret_cast<const uint8*>(policy_blob.data()), policy_blob.size()); | 202 reinterpret_cast<const uint8*>(policy_blob.data()), policy_blob.size()); |
| 189 session_manager_proxy_->CallMethod( | 203 session_manager_proxy_->CallMethod( |
| 190 &method_call, | 204 &method_call, |
| 191 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 205 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
| 192 base::Bind(&SessionManagerClientImpl::OnStorePolicy, | 206 base::Bind(&SessionManagerClientImpl::OnStorePolicy, |
| 193 weak_ptr_factory_.GetWeakPtr(), | 207 weak_ptr_factory_.GetWeakPtr(), |
| 194 method_name, | 208 method_name, |
| 195 callback)); | 209 callback)); |
| 196 } | 210 } |
| 197 | 211 |
| 198 // Called when kSessionManagerEmitLoginPromptReady method is complete. | |
| 199 void OnEmitLoginPromptReady(dbus::Response* response) { | |
| 200 LOG_IF(ERROR, !response) | |
| 201 << "Failed to call " | |
| 202 << login_manager::kSessionManagerEmitLoginPromptReady; | |
| 203 } | |
| 204 | |
| 205 // Called when kSessionManagerEmitLoginPromptVisible method is complete. | |
| 206 void OnEmitLoginPromptVisible(dbus::Response* response) { | |
| 207 LOG_IF(ERROR, !response) | |
| 208 << "Failed to call " | |
| 209 << login_manager::kSessionManagerEmitLoginPromptVisible; | |
| 210 } | |
| 211 | |
| 212 // Called when kSessionManagerRestartJob method is complete. | 212 // Called when kSessionManagerRestartJob method is complete. |
| 213 void OnRestartJob(dbus::Response* response) { | 213 void OnRestartJob(dbus::Response* response) { |
| 214 LOG_IF(ERROR, !response) | 214 LOG_IF(ERROR, !response) |
| 215 << "Failed to call " | 215 << "Failed to call " |
| 216 << login_manager::kSessionManagerRestartJob; | 216 << login_manager::kSessionManagerRestartJob; |
| 217 } | 217 } |
| 218 | 218 |
| 219 // Called when kSessionManagerRestartEntd method is complete. | |
| 220 void OnRestartEntd(dbus::Response* response) { | |
| 221 LOG_IF(ERROR, !response) | |
| 222 << "Failed to call " | |
| 223 << login_manager::kSessionManagerRestartEntd; | |
| 224 } | |
| 225 | |
| 226 // Called when kSessionManagerStartSession method is complete. | 219 // Called when kSessionManagerStartSession method is complete. |
| 227 void OnStartSession(dbus::Response* response) { | 220 void OnStartSession(dbus::Response* response) { |
| 228 LOG_IF(ERROR, !response) | 221 LOG_IF(ERROR, !response) |
| 229 << "Failed to call " | 222 << "Failed to call " |
| 230 << login_manager::kSessionManagerStartSession; | 223 << login_manager::kSessionManagerStartSession; |
| 231 } | 224 } |
| 232 | 225 |
| 233 // Called when kSessionManagerStopSession method is complete. | 226 // Called when kSessionManagerStopSession method is complete. |
| 234 void OnStopSession(dbus::Response* response) { | 227 void OnStopSession(dbus::Response* response) { |
| 235 LOG_IF(ERROR, !response) | 228 LOG_IF(ERROR, !response) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 dbus::MessageReader reader(signal); | 286 dbus::MessageReader reader(signal); |
| 294 std::string result_string; | 287 std::string result_string; |
| 295 if (!reader.PopString(&result_string)) { | 288 if (!reader.PopString(&result_string)) { |
| 296 LOG(ERROR) << "Invalid signal: " << signal->ToString(); | 289 LOG(ERROR) << "Invalid signal: " << signal->ToString(); |
| 297 return; | 290 return; |
| 298 } | 291 } |
| 299 const bool success = StartsWithASCII(result_string, "success", false); | 292 const bool success = StartsWithASCII(result_string, "success", false); |
| 300 FOR_EACH_OBSERVER(Observer, observers_, PropertyChangeComplete(success)); | 293 FOR_EACH_OBSERVER(Observer, observers_, PropertyChangeComplete(success)); |
| 301 } | 294 } |
| 302 | 295 |
| 296 void ScreenLockReceived(dbus::Signal* signal) { |
| 297 screen_locked_ = true; |
| 298 FOR_EACH_OBSERVER(Observer, observers_, LockScreen()); |
| 299 } |
| 300 |
| 301 void ScreenUnlockReceived(dbus::Signal* signal) { |
| 302 screen_locked_ = false; |
| 303 FOR_EACH_OBSERVER(Observer, observers_, UnlockScreen()); |
| 304 } |
| 305 |
| 303 // Called when the object is connected to the signal. | 306 // Called when the object is connected to the signal. |
| 304 void SignalConnected(const std::string& interface_name, | 307 void SignalConnected(const std::string& interface_name, |
| 305 const std::string& signal_name, | 308 const std::string& signal_name, |
| 306 bool success) { | 309 bool success) { |
| 307 LOG_IF(ERROR, !success) << "Failed to connect to " << signal_name; | 310 LOG_IF(ERROR, !success) << "Failed to connect to " << signal_name; |
| 308 } | 311 } |
| 309 | 312 |
| 310 dbus::ObjectProxy* session_manager_proxy_; | 313 dbus::ObjectProxy* session_manager_proxy_; |
| 311 ObserverList<Observer> observers_; | 314 ObserverList<Observer> observers_; |
| 315 bool screen_locked_; |
| 312 base::WeakPtrFactory<SessionManagerClientImpl> weak_ptr_factory_; | 316 base::WeakPtrFactory<SessionManagerClientImpl> weak_ptr_factory_; |
| 313 | 317 |
| 314 DISALLOW_COPY_AND_ASSIGN(SessionManagerClientImpl); | 318 DISALLOW_COPY_AND_ASSIGN(SessionManagerClientImpl); |
| 315 }; | 319 }; |
| 316 | 320 |
| 317 // The SessionManagerClient implementation used on Linux desktop, | 321 // The SessionManagerClient implementation used on Linux desktop, |
| 318 // which does nothing. | 322 // which does nothing. |
| 319 class SessionManagerClientStubImpl : public SessionManagerClient { | 323 class SessionManagerClientStubImpl : public SessionManagerClient { |
| 320 // SessionManagerClient overrides. | 324 // SessionManagerClient overrides. |
| 321 virtual void AddObserver(Observer* observer) OVERRIDE {} | 325 virtual void AddObserver(Observer* observer) OVERRIDE {} |
| 322 virtual void RemoveObserver(Observer* observer) OVERRIDE {} | 326 virtual void RemoveObserver(Observer* observer) OVERRIDE {} |
| 327 virtual bool HasObserver(Observer* observer) OVERRIDE { return false; } |
| 323 virtual void EmitLoginPromptReady() OVERRIDE {} | 328 virtual void EmitLoginPromptReady() OVERRIDE {} |
| 324 virtual void EmitLoginPromptVisible() OVERRIDE {} | 329 virtual void EmitLoginPromptVisible() OVERRIDE {} |
| 325 virtual void RestartJob(int pid, const std::string& command_line) OVERRIDE {} | 330 virtual void RestartJob(int pid, const std::string& command_line) OVERRIDE {} |
| 326 virtual void RestartEntd() OVERRIDE {} | 331 virtual void RestartEntd() OVERRIDE {} |
| 327 virtual void StartSession(const std::string& user_email) OVERRIDE {} | 332 virtual void StartSession(const std::string& user_email) OVERRIDE {} |
| 328 virtual void StopSession() OVERRIDE {} | 333 virtual void StopSession() OVERRIDE {} |
| 334 virtual void RequestLockScreen() OVERRIDE {} |
| 335 virtual void RequestUnlockScreen() OVERRIDE {} |
| 336 virtual bool GetIsScreenLocked() OVERRIDE { return false; } |
| 329 virtual void RetrieveDevicePolicy( | 337 virtual void RetrieveDevicePolicy( |
| 330 const RetrievePolicyCallback& callback) OVERRIDE { | 338 const RetrievePolicyCallback& callback) OVERRIDE { |
| 331 callback.Run(""); | 339 callback.Run(""); |
| 332 } | 340 } |
| 333 virtual void RetrieveUserPolicy( | 341 virtual void RetrieveUserPolicy( |
| 334 const RetrievePolicyCallback& callback) OVERRIDE { | 342 const RetrievePolicyCallback& callback) OVERRIDE { |
| 335 callback.Run(""); | 343 callback.Run(""); |
| 336 } | 344 } |
| 337 virtual void StoreDevicePolicy(const std::string& policy_blob, | 345 virtual void StoreDevicePolicy(const std::string& policy_blob, |
| 338 const StorePolicyCallback& callback) OVERRIDE { | 346 const StorePolicyCallback& callback) OVERRIDE { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 353 SessionManagerClient* SessionManagerClient::Create( | 361 SessionManagerClient* SessionManagerClient::Create( |
| 354 DBusClientImplementationType type, | 362 DBusClientImplementationType type, |
| 355 dbus::Bus* bus) { | 363 dbus::Bus* bus) { |
| 356 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 364 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
| 357 return new SessionManagerClientImpl(bus); | 365 return new SessionManagerClientImpl(bus); |
| 358 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 366 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
| 359 return new SessionManagerClientStubImpl(); | 367 return new SessionManagerClientStubImpl(); |
| 360 } | 368 } |
| 361 | 369 |
| 362 } // namespace chromeos | 370 } // namespace chromeos |
| OLD | NEW |