1 // Automatic generation of D-Bus interfaces: 2 // - org.chromium.SessionManagerInterface 3 #ifndef ____CHROMEOS_DBUS_BINDING____________________BUILD_LINK_VAR_CACHE_PORTAGE_CHROMEOS_BASE_CHROMEOS_LOGIN_OUT_DEFAULT_GEN_INCLUDE_SESSION_MANAGER_DBUS_PROXIES_H 4 #define ____CHROMEOS_DBUS_BINDING____________________BUILD_LINK_VAR_CACHE_PORTAGE_CHROMEOS_BASE_CHROMEOS_LOGIN_OUT_DEFAULT_GEN_INCLUDE_SESSION_MANAGER_DBUS_PROXIES_H 5 #include <memory> 6 #include <string> 7 #include <vector> 8 9 #include <base/bind.h> 10 #include <base/callback.h> 11 #include <base/logging.h> 12 #include <base/macros.h> 13 #include <base/memory/ref_counted.h> 14 #include <brillo/any.h> 15 #include <brillo/dbus/dbus_method_invoker.h> 16 #include <brillo/dbus/dbus_property.h> 17 #include <brillo/dbus/dbus_signal_handler.h> 18 #include <brillo/errors/error.h> 19 #include <brillo/variant_dictionary.h> 20 #include <dbus/bus.h> 21 #include <dbus/message.h> 22 #include <dbus/object_manager.h> 23 #include <dbus/object_path.h> 24 #include <dbus/object_proxy.h> 25 26 namespace org { 27 namespace chromium { 28 29 // Abstract interface proxy for org::chromium::SessionManagerInterface. 30 class SessionManagerInterfaceProxyInterface { 31 public: 32 virtual ~SessionManagerInterfaceProxyInterface() = default; 33 34 virtual bool EmitLoginPromptVisible( 35 brillo::ErrorPtr* error, 36 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 37 38 virtual void EmitLoginPromptVisibleAsync( 39 const base::Callback<void()>& success_callback, 40 const base::Callback<void(brillo::Error*)>& error_callback, 41 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 42 43 virtual bool EnableChromeTesting( 44 bool in_force_relaunch, 45 const std::vector<std::string>& in_extra_arguments, 46 std::string* out_filepath, 47 brillo::ErrorPtr* error, 48 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 49 50 virtual void EnableChromeTestingAsync( 51 bool in_force_relaunch, 52 const std::vector<std::string>& in_extra_arguments, 53 const base::Callback<void(const std::string& /*filepath*/)>& success_callback, 54 const base::Callback<void(brillo::Error*)>& error_callback, 55 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 56 57 virtual bool StartSession( 58 const std::string& in_email_address, 59 const std::string& in_unique_identifier, 60 bool* out_done, 61 brillo::ErrorPtr* error, 62 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 63 64 virtual void StartSessionAsync( 65 const std::string& in_email_address, 66 const std::string& in_unique_identifier, 67 const base::Callback<void(bool /*done*/)>& success_callback, 68 const base::Callback<void(brillo::Error*)>& error_callback, 69 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 70 71 virtual bool StopSession( 72 const std::string& in_unique_identifier, 73 bool* out_done, 74 brillo::ErrorPtr* error, 75 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 76 77 virtual void StopSessionAsync( 78 const std::string& in_unique_identifier, 79 const base::Callback<void(bool /*done*/)>& success_callback, 80 const base::Callback<void(brillo::Error*)>& error_callback, 81 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 82 83 virtual bool StorePolicy( 84 const std::vector<uint8_t>& in_policy_blob, 85 bool* out_done, 86 brillo::ErrorPtr* error, 87 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 88 89 virtual void StorePolicyAsync( 90 const std::vector<uint8_t>& in_policy_blob, 91 const base::Callback<void(bool /*done*/)>& success_callback, 92 const base::Callback<void(brillo::Error*)>& error_callback, 93 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 94 95 virtual bool RetrievePolicy( 96 std::vector<uint8_t>* out_policy_blob, 97 brillo::ErrorPtr* error, 98 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 99 100 virtual void RetrievePolicyAsync( 101 const base::Callback<void(const std::vector<uint8_t>& /*policy_blob*/)>& success_callback, 102 const base::Callback<void(brillo::Error*)>& error_callback, 103 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 104 105 virtual bool StorePolicyForUser( 106 const std::string& in_user_email, 107 const std::vector<uint8_t>& in_policy_blob, 108 bool* out_done, 109 brillo::ErrorPtr* error, 110 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 111 112 virtual void StorePolicyForUserAsync( 113 const std::string& in_user_email, 114 const std::vector<uint8_t>& in_policy_blob, 115 const base::Callback<void(bool /*done*/)>& success_callback, 116 const base::Callback<void(brillo::Error*)>& error_callback, 117 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 118 119 virtual bool RetrievePolicyForUser( 120 const std::string& in_user_email, 121 std::vector<uint8_t>* out_policy_blob, 122 brillo::ErrorPtr* error, 123 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 124 125 virtual void RetrievePolicyForUserAsync( 126 const std::string& in_user_email, 127 const base::Callback<void(const std::vector<uint8_t>& /*policy_blob*/)>& success_callback, 128 const base::Callback<void(brillo::Error*)>& error_callback, 129 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 130 131 virtual bool StoreDeviceLocalAccountPolicy( 132 const std::string& in_account_id, 133 const std::vector<uint8_t>& in_policy_blob, 134 bool* out_done, 135 brillo::ErrorPtr* error, 136 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 137 138 virtual void StoreDeviceLocalAccountPolicyAsync( 139 const std::string& in_account_id, 140 const std::vector<uint8_t>& in_policy_blob, 141 const base::Callback<void(bool /*done*/)>& success_callback, 142 const base::Callback<void(brillo::Error*)>& error_callback, 143 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 144 145 virtual bool RetrieveDeviceLocalAccountPolicy( 146 const std::string& in_account_id, 147 std::vector<uint8_t>* out_policy_blob, 148 brillo::ErrorPtr* error, 149 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 150 151 virtual void RetrieveDeviceLocalAccountPolicyAsync( 152 const std::string& in_account_id, 153 const base::Callback<void(const std::vector<uint8_t>& /*policy_blob*/)>& success_callback, 154 const base::Callback<void(brillo::Error*)>& error_callback, 155 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 156 157 virtual bool RetrieveSessionState( 158 std::string* out_state, 159 brillo::ErrorPtr* error, 160 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 161 162 virtual void RetrieveSessionStateAsync( 163 const base::Callback<void(const std::string& /*state*/)>& success_callback, 164 const base::Callback<void(brillo::Error*)>& error_callback, 165 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 166 167 virtual bool RetrieveActiveSessions( 168 std::map<std::string, std::string>* out_sessions, 169 brillo::ErrorPtr* error, 170 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 171 172 virtual void RetrieveActiveSessionsAsync( 173 const base::Callback<void(const std::map<std::string, std::string>& /*sessions*/)>& success_callback, 174 const base::Callback<void(brillo::Error*)>& error_callback, 175 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 176 177 virtual bool HandleSupervisedUserCreationStarting( 178 brillo::ErrorPtr* error, 179 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 180 181 virtual void HandleSupervisedUserCreationStartingAsync( 182 const base::Callback<void()>& success_callback, 183 const base::Callback<void(brillo::Error*)>& error_callback, 184 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 185 186 virtual bool HandleSupervisedUserCreationFinished( 187 brillo::ErrorPtr* error, 188 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 189 190 virtual void HandleSupervisedUserCreationFinishedAsync( 191 const base::Callback<void()>& success_callback, 192 const base::Callback<void(brillo::Error*)>& error_callback, 193 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 194 195 virtual bool LockScreen( 196 brillo::ErrorPtr* error, 197 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 198 199 virtual void LockScreenAsync( 200 const base::Callback<void()>& success_callback, 201 const base::Callback<void(brillo::Error*)>& error_callback, 202 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 203 204 virtual bool HandleLockScreenShown( 205 brillo::ErrorPtr* error, 206 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 207 208 virtual void HandleLockScreenShownAsync( 209 const base::Callback<void()>& success_callback, 210 const base::Callback<void(brillo::Error*)>& error_callback, 211 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 212 213 virtual bool HandleLockScreenDismissed( 214 brillo::ErrorPtr* error, 215 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 216 217 virtual void HandleLockScreenDismissedAsync( 218 const base::Callback<void()>& success_callback, 219 const base::Callback<void(brillo::Error*)>& error_callback, 220 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 221 222 virtual bool RestartJob( 223 const dbus::FileDescriptor& in_cred_fd, 224 const std::vector<std::string>& in_argv, 225 brillo::ErrorPtr* error, 226 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 227 228 virtual void RestartJobAsync( 229 const dbus::FileDescriptor& in_cred_fd, 230 const std::vector<std::string>& in_argv, 231 const base::Callback<void()>& success_callback, 232 const base::Callback<void(brillo::Error*)>& error_callback, 233 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 234 235 virtual bool StartDeviceWipe( 236 bool* out_done, 237 brillo::ErrorPtr* error, 238 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 239 240 virtual void StartDeviceWipeAsync( 241 const base::Callback<void(bool /*done*/)>& success_callback, 242 const base::Callback<void(brillo::Error*)>& error_callback, 243 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 244 245 virtual bool SetFlagsForUser( 246 const std::string& in_user_email, 247 const std::vector<std::string>& in_flags, 248 brillo::ErrorPtr* error, 249 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 250 251 virtual void SetFlagsForUserAsync( 252 const std::string& in_user_email, 253 const std::vector<std::string>& in_flags, 254 const base::Callback<void()>& success_callback, 255 const base::Callback<void(brillo::Error*)>& error_callback, 256 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 257 258 virtual bool GetServerBackedStateKeys( 259 std::vector<std::vector<uint8_t>>* out_state_keys, 260 brillo::ErrorPtr* error, 261 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 262 263 virtual void GetServerBackedStateKeysAsync( 264 const base::Callback<void(const std::vector<std::vector<uint8_t>>& /*state_keys*/)>& success_callback, 265 const base::Callback<void(brillo::Error*)>& error_callback, 266 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 267 268 virtual bool InitMachineInfo( 269 const std::string& in_data, 270 brillo::ErrorPtr* error, 271 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 272 273 virtual void InitMachineInfoAsync( 274 const std::string& in_data, 275 const base::Callback<void()>& success_callback, 276 const base::Callback<void(brillo::Error*)>& error_callback, 277 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0; 278 279 virtual void RegisterLoginPromptVisibleSignalHandler( 280 const base::Closure& signal_callback, 281 dbus::ObjectProxy::OnConnectedCallback on_connected_callback) = 0; 282 283 virtual void RegisterSessionStateChangedSignalHandler( 284 const base::Callback<void(const std::string&)>& signal_callback, 285 dbus::ObjectProxy::OnConnectedCallback on_connected_callback) = 0; 286 287 virtual void RegisterSetOwnerKeyCompleteSignalHandler( 288 const base::Callback<void(const std::string&)>& signal_callback, 289 dbus::ObjectProxy::OnConnectedCallback on_connected_callback) = 0; 290 291 virtual void RegisterPropertyChangeCompleteSignalHandler( 292 const base::Callback<void(const std::string&)>& signal_callback, 293 dbus::ObjectProxy::OnConnectedCallback on_connected_callback) = 0; 294 295 virtual void RegisterScreenIsLockedSignalHandler( 296 const base::Closure& signal_callback, 297 dbus::ObjectProxy::OnConnectedCallback on_connected_callback) = 0; 298 299 virtual void RegisterScreenIsUnlockedSignalHandler( 300 const base::Closure& signal_callback, 301 dbus::ObjectProxy::OnConnectedCallback on_connected_callback) = 0; 302 }; 303 304 } // namespace chromium 305 } // namespace org 306 307 namespace org { 308 namespace chromium { 309 310 // Interface proxy for org::chromium::SessionManagerInterface. 311 class SessionManagerInterfaceProxy final : public SessionManagerInterfaceProxyInterface { 312 public: SessionManagerInterfaceProxy(const scoped_refptr<dbus::Bus> & bus)313 SessionManagerInterfaceProxy(const scoped_refptr<dbus::Bus>& bus) : 314 bus_{bus}, 315 dbus_object_proxy_{ 316 bus_->GetObjectProxy(service_name_, object_path_)} { 317 } 318 ~SessionManagerInterfaceProxy()319 ~SessionManagerInterfaceProxy() override { 320 bus_->RemoveObjectProxy( 321 service_name_, object_path_, base::Bind(&base::DoNothing)); 322 } 323 RegisterLoginPromptVisibleSignalHandler(const base::Closure & signal_callback,dbus::ObjectProxy::OnConnectedCallback on_connected_callback)324 void RegisterLoginPromptVisibleSignalHandler( 325 const base::Closure& signal_callback, 326 dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override { 327 brillo::dbus_utils::ConnectToSignal( 328 dbus_object_proxy_, 329 "org.chromium.SessionManagerInterface", 330 "LoginPromptVisible", 331 signal_callback, 332 on_connected_callback); 333 } 334 RegisterSessionStateChangedSignalHandler(const base::Callback<void (const std::string &)> & signal_callback,dbus::ObjectProxy::OnConnectedCallback on_connected_callback)335 void RegisterSessionStateChangedSignalHandler( 336 const base::Callback<void(const std::string&)>& signal_callback, 337 dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override { 338 brillo::dbus_utils::ConnectToSignal( 339 dbus_object_proxy_, 340 "org.chromium.SessionManagerInterface", 341 "SessionStateChanged", 342 signal_callback, 343 on_connected_callback); 344 } 345 RegisterSetOwnerKeyCompleteSignalHandler(const base::Callback<void (const std::string &)> & signal_callback,dbus::ObjectProxy::OnConnectedCallback on_connected_callback)346 void RegisterSetOwnerKeyCompleteSignalHandler( 347 const base::Callback<void(const std::string&)>& signal_callback, 348 dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override { 349 brillo::dbus_utils::ConnectToSignal( 350 dbus_object_proxy_, 351 "org.chromium.SessionManagerInterface", 352 "SetOwnerKeyComplete", 353 signal_callback, 354 on_connected_callback); 355 } 356 RegisterPropertyChangeCompleteSignalHandler(const base::Callback<void (const std::string &)> & signal_callback,dbus::ObjectProxy::OnConnectedCallback on_connected_callback)357 void RegisterPropertyChangeCompleteSignalHandler( 358 const base::Callback<void(const std::string&)>& signal_callback, 359 dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override { 360 brillo::dbus_utils::ConnectToSignal( 361 dbus_object_proxy_, 362 "org.chromium.SessionManagerInterface", 363 "PropertyChangeComplete", 364 signal_callback, 365 on_connected_callback); 366 } 367 RegisterScreenIsLockedSignalHandler(const base::Closure & signal_callback,dbus::ObjectProxy::OnConnectedCallback on_connected_callback)368 void RegisterScreenIsLockedSignalHandler( 369 const base::Closure& signal_callback, 370 dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override { 371 brillo::dbus_utils::ConnectToSignal( 372 dbus_object_proxy_, 373 "org.chromium.SessionManagerInterface", 374 "ScreenIsLocked", 375 signal_callback, 376 on_connected_callback); 377 } 378 RegisterScreenIsUnlockedSignalHandler(const base::Closure & signal_callback,dbus::ObjectProxy::OnConnectedCallback on_connected_callback)379 void RegisterScreenIsUnlockedSignalHandler( 380 const base::Closure& signal_callback, 381 dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override { 382 brillo::dbus_utils::ConnectToSignal( 383 dbus_object_proxy_, 384 "org.chromium.SessionManagerInterface", 385 "ScreenIsUnlocked", 386 signal_callback, 387 on_connected_callback); 388 } 389 ReleaseObjectProxy(const base::Closure & callback)390 void ReleaseObjectProxy(const base::Closure& callback) { 391 bus_->RemoveObjectProxy(service_name_, object_path_, callback); 392 } 393 GetObjectPath()394 const dbus::ObjectPath& GetObjectPath() const { 395 return object_path_; 396 } 397 GetObjectProxy()398 dbus::ObjectProxy* GetObjectProxy() const { return dbus_object_proxy_; } 399 400 bool EmitLoginPromptVisible( 401 brillo::ErrorPtr* error, 402 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 403 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 404 timeout_ms, 405 dbus_object_proxy_, 406 "org.chromium.SessionManagerInterface", 407 "EmitLoginPromptVisible", 408 error); 409 return response && brillo::dbus_utils::ExtractMethodCallResults( 410 response.get(), error); 411 } 412 413 void EmitLoginPromptVisibleAsync( 414 const base::Callback<void()>& success_callback, 415 const base::Callback<void(brillo::Error*)>& error_callback, 416 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 417 brillo::dbus_utils::CallMethodWithTimeout( 418 timeout_ms, 419 dbus_object_proxy_, 420 "org.chromium.SessionManagerInterface", 421 "EmitLoginPromptVisible", 422 success_callback, 423 error_callback); 424 } 425 426 bool EnableChromeTesting( 427 bool in_force_relaunch, 428 const std::vector<std::string>& in_extra_arguments, 429 std::string* out_filepath, 430 brillo::ErrorPtr* error, 431 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 432 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 433 timeout_ms, 434 dbus_object_proxy_, 435 "org.chromium.SessionManagerInterface", 436 "EnableChromeTesting", 437 error, 438 in_force_relaunch, 439 in_extra_arguments); 440 return response && brillo::dbus_utils::ExtractMethodCallResults( 441 response.get(), error, out_filepath); 442 } 443 444 void EnableChromeTestingAsync( 445 bool in_force_relaunch, 446 const std::vector<std::string>& in_extra_arguments, 447 const base::Callback<void(const std::string& /*filepath*/)>& success_callback, 448 const base::Callback<void(brillo::Error*)>& error_callback, 449 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 450 brillo::dbus_utils::CallMethodWithTimeout( 451 timeout_ms, 452 dbus_object_proxy_, 453 "org.chromium.SessionManagerInterface", 454 "EnableChromeTesting", 455 success_callback, 456 error_callback, 457 in_force_relaunch, 458 in_extra_arguments); 459 } 460 461 bool StartSession( 462 const std::string& in_email_address, 463 const std::string& in_unique_identifier, 464 bool* out_done, 465 brillo::ErrorPtr* error, 466 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 467 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 468 timeout_ms, 469 dbus_object_proxy_, 470 "org.chromium.SessionManagerInterface", 471 "StartSession", 472 error, 473 in_email_address, 474 in_unique_identifier); 475 return response && brillo::dbus_utils::ExtractMethodCallResults( 476 response.get(), error, out_done); 477 } 478 479 void StartSessionAsync( 480 const std::string& in_email_address, 481 const std::string& in_unique_identifier, 482 const base::Callback<void(bool /*done*/)>& success_callback, 483 const base::Callback<void(brillo::Error*)>& error_callback, 484 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 485 brillo::dbus_utils::CallMethodWithTimeout( 486 timeout_ms, 487 dbus_object_proxy_, 488 "org.chromium.SessionManagerInterface", 489 "StartSession", 490 success_callback, 491 error_callback, 492 in_email_address, 493 in_unique_identifier); 494 } 495 496 bool StopSession( 497 const std::string& in_unique_identifier, 498 bool* out_done, 499 brillo::ErrorPtr* error, 500 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 501 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 502 timeout_ms, 503 dbus_object_proxy_, 504 "org.chromium.SessionManagerInterface", 505 "StopSession", 506 error, 507 in_unique_identifier); 508 return response && brillo::dbus_utils::ExtractMethodCallResults( 509 response.get(), error, out_done); 510 } 511 512 void StopSessionAsync( 513 const std::string& in_unique_identifier, 514 const base::Callback<void(bool /*done*/)>& success_callback, 515 const base::Callback<void(brillo::Error*)>& error_callback, 516 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 517 brillo::dbus_utils::CallMethodWithTimeout( 518 timeout_ms, 519 dbus_object_proxy_, 520 "org.chromium.SessionManagerInterface", 521 "StopSession", 522 success_callback, 523 error_callback, 524 in_unique_identifier); 525 } 526 527 bool StorePolicy( 528 const std::vector<uint8_t>& in_policy_blob, 529 bool* out_done, 530 brillo::ErrorPtr* error, 531 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 532 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 533 timeout_ms, 534 dbus_object_proxy_, 535 "org.chromium.SessionManagerInterface", 536 "StorePolicy", 537 error, 538 in_policy_blob); 539 return response && brillo::dbus_utils::ExtractMethodCallResults( 540 response.get(), error, out_done); 541 } 542 543 void StorePolicyAsync( 544 const std::vector<uint8_t>& in_policy_blob, 545 const base::Callback<void(bool /*done*/)>& success_callback, 546 const base::Callback<void(brillo::Error*)>& error_callback, 547 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 548 brillo::dbus_utils::CallMethodWithTimeout( 549 timeout_ms, 550 dbus_object_proxy_, 551 "org.chromium.SessionManagerInterface", 552 "StorePolicy", 553 success_callback, 554 error_callback, 555 in_policy_blob); 556 } 557 558 bool RetrievePolicy( 559 std::vector<uint8_t>* out_policy_blob, 560 brillo::ErrorPtr* error, 561 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 562 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 563 timeout_ms, 564 dbus_object_proxy_, 565 "org.chromium.SessionManagerInterface", 566 "RetrievePolicy", 567 error); 568 return response && brillo::dbus_utils::ExtractMethodCallResults( 569 response.get(), error, out_policy_blob); 570 } 571 572 void RetrievePolicyAsync( 573 const base::Callback<void(const std::vector<uint8_t>& /*policy_blob*/)>& success_callback, 574 const base::Callback<void(brillo::Error*)>& error_callback, 575 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 576 brillo::dbus_utils::CallMethodWithTimeout( 577 timeout_ms, 578 dbus_object_proxy_, 579 "org.chromium.SessionManagerInterface", 580 "RetrievePolicy", 581 success_callback, 582 error_callback); 583 } 584 585 bool StorePolicyForUser( 586 const std::string& in_user_email, 587 const std::vector<uint8_t>& in_policy_blob, 588 bool* out_done, 589 brillo::ErrorPtr* error, 590 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 591 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 592 timeout_ms, 593 dbus_object_proxy_, 594 "org.chromium.SessionManagerInterface", 595 "StorePolicyForUser", 596 error, 597 in_user_email, 598 in_policy_blob); 599 return response && brillo::dbus_utils::ExtractMethodCallResults( 600 response.get(), error, out_done); 601 } 602 603 void StorePolicyForUserAsync( 604 const std::string& in_user_email, 605 const std::vector<uint8_t>& in_policy_blob, 606 const base::Callback<void(bool /*done*/)>& success_callback, 607 const base::Callback<void(brillo::Error*)>& error_callback, 608 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 609 brillo::dbus_utils::CallMethodWithTimeout( 610 timeout_ms, 611 dbus_object_proxy_, 612 "org.chromium.SessionManagerInterface", 613 "StorePolicyForUser", 614 success_callback, 615 error_callback, 616 in_user_email, 617 in_policy_blob); 618 } 619 620 bool RetrievePolicyForUser( 621 const std::string& in_user_email, 622 std::vector<uint8_t>* out_policy_blob, 623 brillo::ErrorPtr* error, 624 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 625 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 626 timeout_ms, 627 dbus_object_proxy_, 628 "org.chromium.SessionManagerInterface", 629 "RetrievePolicyForUser", 630 error, 631 in_user_email); 632 return response && brillo::dbus_utils::ExtractMethodCallResults( 633 response.get(), error, out_policy_blob); 634 } 635 636 void RetrievePolicyForUserAsync( 637 const std::string& in_user_email, 638 const base::Callback<void(const std::vector<uint8_t>& /*policy_blob*/)>& success_callback, 639 const base::Callback<void(brillo::Error*)>& error_callback, 640 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 641 brillo::dbus_utils::CallMethodWithTimeout( 642 timeout_ms, 643 dbus_object_proxy_, 644 "org.chromium.SessionManagerInterface", 645 "RetrievePolicyForUser", 646 success_callback, 647 error_callback, 648 in_user_email); 649 } 650 651 bool StoreDeviceLocalAccountPolicy( 652 const std::string& in_account_id, 653 const std::vector<uint8_t>& in_policy_blob, 654 bool* out_done, 655 brillo::ErrorPtr* error, 656 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 657 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 658 timeout_ms, 659 dbus_object_proxy_, 660 "org.chromium.SessionManagerInterface", 661 "StoreDeviceLocalAccountPolicy", 662 error, 663 in_account_id, 664 in_policy_blob); 665 return response && brillo::dbus_utils::ExtractMethodCallResults( 666 response.get(), error, out_done); 667 } 668 669 void StoreDeviceLocalAccountPolicyAsync( 670 const std::string& in_account_id, 671 const std::vector<uint8_t>& in_policy_blob, 672 const base::Callback<void(bool /*done*/)>& success_callback, 673 const base::Callback<void(brillo::Error*)>& error_callback, 674 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 675 brillo::dbus_utils::CallMethodWithTimeout( 676 timeout_ms, 677 dbus_object_proxy_, 678 "org.chromium.SessionManagerInterface", 679 "StoreDeviceLocalAccountPolicy", 680 success_callback, 681 error_callback, 682 in_account_id, 683 in_policy_blob); 684 } 685 686 bool RetrieveDeviceLocalAccountPolicy( 687 const std::string& in_account_id, 688 std::vector<uint8_t>* out_policy_blob, 689 brillo::ErrorPtr* error, 690 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 691 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 692 timeout_ms, 693 dbus_object_proxy_, 694 "org.chromium.SessionManagerInterface", 695 "RetrieveDeviceLocalAccountPolicy", 696 error, 697 in_account_id); 698 return response && brillo::dbus_utils::ExtractMethodCallResults( 699 response.get(), error, out_policy_blob); 700 } 701 702 void RetrieveDeviceLocalAccountPolicyAsync( 703 const std::string& in_account_id, 704 const base::Callback<void(const std::vector<uint8_t>& /*policy_blob*/)>& success_callback, 705 const base::Callback<void(brillo::Error*)>& error_callback, 706 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 707 brillo::dbus_utils::CallMethodWithTimeout( 708 timeout_ms, 709 dbus_object_proxy_, 710 "org.chromium.SessionManagerInterface", 711 "RetrieveDeviceLocalAccountPolicy", 712 success_callback, 713 error_callback, 714 in_account_id); 715 } 716 717 bool RetrieveSessionState( 718 std::string* out_state, 719 brillo::ErrorPtr* error, 720 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 721 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 722 timeout_ms, 723 dbus_object_proxy_, 724 "org.chromium.SessionManagerInterface", 725 "RetrieveSessionState", 726 error); 727 return response && brillo::dbus_utils::ExtractMethodCallResults( 728 response.get(), error, out_state); 729 } 730 731 void RetrieveSessionStateAsync( 732 const base::Callback<void(const std::string& /*state*/)>& success_callback, 733 const base::Callback<void(brillo::Error*)>& error_callback, 734 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 735 brillo::dbus_utils::CallMethodWithTimeout( 736 timeout_ms, 737 dbus_object_proxy_, 738 "org.chromium.SessionManagerInterface", 739 "RetrieveSessionState", 740 success_callback, 741 error_callback); 742 } 743 744 bool RetrieveActiveSessions( 745 std::map<std::string, std::string>* out_sessions, 746 brillo::ErrorPtr* error, 747 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 748 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 749 timeout_ms, 750 dbus_object_proxy_, 751 "org.chromium.SessionManagerInterface", 752 "RetrieveActiveSessions", 753 error); 754 return response && brillo::dbus_utils::ExtractMethodCallResults( 755 response.get(), error, out_sessions); 756 } 757 758 void RetrieveActiveSessionsAsync( 759 const base::Callback<void(const std::map<std::string, std::string>& /*sessions*/)>& success_callback, 760 const base::Callback<void(brillo::Error*)>& error_callback, 761 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 762 brillo::dbus_utils::CallMethodWithTimeout( 763 timeout_ms, 764 dbus_object_proxy_, 765 "org.chromium.SessionManagerInterface", 766 "RetrieveActiveSessions", 767 success_callback, 768 error_callback); 769 } 770 771 bool HandleSupervisedUserCreationStarting( 772 brillo::ErrorPtr* error, 773 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 774 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 775 timeout_ms, 776 dbus_object_proxy_, 777 "org.chromium.SessionManagerInterface", 778 "HandleSupervisedUserCreationStarting", 779 error); 780 return response && brillo::dbus_utils::ExtractMethodCallResults( 781 response.get(), error); 782 } 783 784 void HandleSupervisedUserCreationStartingAsync( 785 const base::Callback<void()>& success_callback, 786 const base::Callback<void(brillo::Error*)>& error_callback, 787 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 788 brillo::dbus_utils::CallMethodWithTimeout( 789 timeout_ms, 790 dbus_object_proxy_, 791 "org.chromium.SessionManagerInterface", 792 "HandleSupervisedUserCreationStarting", 793 success_callback, 794 error_callback); 795 } 796 797 bool HandleSupervisedUserCreationFinished( 798 brillo::ErrorPtr* error, 799 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 800 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 801 timeout_ms, 802 dbus_object_proxy_, 803 "org.chromium.SessionManagerInterface", 804 "HandleSupervisedUserCreationFinished", 805 error); 806 return response && brillo::dbus_utils::ExtractMethodCallResults( 807 response.get(), error); 808 } 809 810 void HandleSupervisedUserCreationFinishedAsync( 811 const base::Callback<void()>& success_callback, 812 const base::Callback<void(brillo::Error*)>& error_callback, 813 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 814 brillo::dbus_utils::CallMethodWithTimeout( 815 timeout_ms, 816 dbus_object_proxy_, 817 "org.chromium.SessionManagerInterface", 818 "HandleSupervisedUserCreationFinished", 819 success_callback, 820 error_callback); 821 } 822 823 bool LockScreen( 824 brillo::ErrorPtr* error, 825 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 826 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 827 timeout_ms, 828 dbus_object_proxy_, 829 "org.chromium.SessionManagerInterface", 830 "LockScreen", 831 error); 832 return response && brillo::dbus_utils::ExtractMethodCallResults( 833 response.get(), error); 834 } 835 836 void LockScreenAsync( 837 const base::Callback<void()>& success_callback, 838 const base::Callback<void(brillo::Error*)>& error_callback, 839 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 840 brillo::dbus_utils::CallMethodWithTimeout( 841 timeout_ms, 842 dbus_object_proxy_, 843 "org.chromium.SessionManagerInterface", 844 "LockScreen", 845 success_callback, 846 error_callback); 847 } 848 849 bool HandleLockScreenShown( 850 brillo::ErrorPtr* error, 851 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 852 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 853 timeout_ms, 854 dbus_object_proxy_, 855 "org.chromium.SessionManagerInterface", 856 "HandleLockScreenShown", 857 error); 858 return response && brillo::dbus_utils::ExtractMethodCallResults( 859 response.get(), error); 860 } 861 862 void HandleLockScreenShownAsync( 863 const base::Callback<void()>& success_callback, 864 const base::Callback<void(brillo::Error*)>& error_callback, 865 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 866 brillo::dbus_utils::CallMethodWithTimeout( 867 timeout_ms, 868 dbus_object_proxy_, 869 "org.chromium.SessionManagerInterface", 870 "HandleLockScreenShown", 871 success_callback, 872 error_callback); 873 } 874 875 bool HandleLockScreenDismissed( 876 brillo::ErrorPtr* error, 877 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 878 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 879 timeout_ms, 880 dbus_object_proxy_, 881 "org.chromium.SessionManagerInterface", 882 "HandleLockScreenDismissed", 883 error); 884 return response && brillo::dbus_utils::ExtractMethodCallResults( 885 response.get(), error); 886 } 887 888 void HandleLockScreenDismissedAsync( 889 const base::Callback<void()>& success_callback, 890 const base::Callback<void(brillo::Error*)>& error_callback, 891 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 892 brillo::dbus_utils::CallMethodWithTimeout( 893 timeout_ms, 894 dbus_object_proxy_, 895 "org.chromium.SessionManagerInterface", 896 "HandleLockScreenDismissed", 897 success_callback, 898 error_callback); 899 } 900 901 bool RestartJob( 902 const dbus::FileDescriptor& in_cred_fd, 903 const std::vector<std::string>& in_argv, 904 brillo::ErrorPtr* error, 905 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 906 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 907 timeout_ms, 908 dbus_object_proxy_, 909 "org.chromium.SessionManagerInterface", 910 "RestartJob", 911 error, 912 in_cred_fd, 913 in_argv); 914 return response && brillo::dbus_utils::ExtractMethodCallResults( 915 response.get(), error); 916 } 917 918 void RestartJobAsync( 919 const dbus::FileDescriptor& in_cred_fd, 920 const std::vector<std::string>& in_argv, 921 const base::Callback<void()>& success_callback, 922 const base::Callback<void(brillo::Error*)>& error_callback, 923 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 924 brillo::dbus_utils::CallMethodWithTimeout( 925 timeout_ms, 926 dbus_object_proxy_, 927 "org.chromium.SessionManagerInterface", 928 "RestartJob", 929 success_callback, 930 error_callback, 931 in_cred_fd, 932 in_argv); 933 } 934 935 bool StartDeviceWipe( 936 bool* out_done, 937 brillo::ErrorPtr* error, 938 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 939 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 940 timeout_ms, 941 dbus_object_proxy_, 942 "org.chromium.SessionManagerInterface", 943 "StartDeviceWipe", 944 error); 945 return response && brillo::dbus_utils::ExtractMethodCallResults( 946 response.get(), error, out_done); 947 } 948 949 void StartDeviceWipeAsync( 950 const base::Callback<void(bool /*done*/)>& success_callback, 951 const base::Callback<void(brillo::Error*)>& error_callback, 952 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 953 brillo::dbus_utils::CallMethodWithTimeout( 954 timeout_ms, 955 dbus_object_proxy_, 956 "org.chromium.SessionManagerInterface", 957 "StartDeviceWipe", 958 success_callback, 959 error_callback); 960 } 961 962 bool SetFlagsForUser( 963 const std::string& in_user_email, 964 const std::vector<std::string>& in_flags, 965 brillo::ErrorPtr* error, 966 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 967 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 968 timeout_ms, 969 dbus_object_proxy_, 970 "org.chromium.SessionManagerInterface", 971 "SetFlagsForUser", 972 error, 973 in_user_email, 974 in_flags); 975 return response && brillo::dbus_utils::ExtractMethodCallResults( 976 response.get(), error); 977 } 978 979 void SetFlagsForUserAsync( 980 const std::string& in_user_email, 981 const std::vector<std::string>& in_flags, 982 const base::Callback<void()>& success_callback, 983 const base::Callback<void(brillo::Error*)>& error_callback, 984 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 985 brillo::dbus_utils::CallMethodWithTimeout( 986 timeout_ms, 987 dbus_object_proxy_, 988 "org.chromium.SessionManagerInterface", 989 "SetFlagsForUser", 990 success_callback, 991 error_callback, 992 in_user_email, 993 in_flags); 994 } 995 996 bool GetServerBackedStateKeys( 997 std::vector<std::vector<uint8_t>>* out_state_keys, 998 brillo::ErrorPtr* error, 999 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 1000 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 1001 timeout_ms, 1002 dbus_object_proxy_, 1003 "org.chromium.SessionManagerInterface", 1004 "GetServerBackedStateKeys", 1005 error); 1006 return response && brillo::dbus_utils::ExtractMethodCallResults( 1007 response.get(), error, out_state_keys); 1008 } 1009 1010 void GetServerBackedStateKeysAsync( 1011 const base::Callback<void(const std::vector<std::vector<uint8_t>>& /*state_keys*/)>& success_callback, 1012 const base::Callback<void(brillo::Error*)>& error_callback, 1013 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 1014 brillo::dbus_utils::CallMethodWithTimeout( 1015 timeout_ms, 1016 dbus_object_proxy_, 1017 "org.chromium.SessionManagerInterface", 1018 "GetServerBackedStateKeys", 1019 success_callback, 1020 error_callback); 1021 } 1022 1023 bool InitMachineInfo( 1024 const std::string& in_data, 1025 brillo::ErrorPtr* error, 1026 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 1027 auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout( 1028 timeout_ms, 1029 dbus_object_proxy_, 1030 "org.chromium.SessionManagerInterface", 1031 "InitMachineInfo", 1032 error, 1033 in_data); 1034 return response && brillo::dbus_utils::ExtractMethodCallResults( 1035 response.get(), error); 1036 } 1037 1038 void InitMachineInfoAsync( 1039 const std::string& in_data, 1040 const base::Callback<void()>& success_callback, 1041 const base::Callback<void(brillo::Error*)>& error_callback, 1042 int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override { 1043 brillo::dbus_utils::CallMethodWithTimeout( 1044 timeout_ms, 1045 dbus_object_proxy_, 1046 "org.chromium.SessionManagerInterface", 1047 "InitMachineInfo", 1048 success_callback, 1049 error_callback, 1050 in_data); 1051 } 1052 1053 private: 1054 scoped_refptr<dbus::Bus> bus_; 1055 const std::string service_name_{"org.chromium.SessionManager"}; 1056 const dbus::ObjectPath object_path_{"/org/chromium/SessionManager"}; 1057 dbus::ObjectProxy* dbus_object_proxy_; 1058 1059 DISALLOW_COPY_AND_ASSIGN(SessionManagerInterfaceProxy); 1060 }; 1061 1062 } // namespace chromium 1063 } // namespace org 1064 1065 #endif // ____CHROMEOS_DBUS_BINDING____________________BUILD_LINK_VAR_CACHE_PORTAGE_CHROMEOS_BASE_CHROMEOS_LOGIN_OUT_DEFAULT_GEN_INCLUDE_SESSION_MANAGER_DBUS_PROXIES_H 1066