Chromium Code Reviews| 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 #ifndef CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ | 6 #define CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 // unlocked successfully (i.e. after NotifyLockScreenDismissed() has | 65 // unlocked successfully (i.e. after NotifyLockScreenDismissed() has |
| 66 // been called). | 66 // been called). |
| 67 virtual void ScreenIsUnlocked() {} | 67 virtual void ScreenIsUnlocked() {} |
| 68 | 68 |
| 69 // Called after EmitLoginPromptVisible is called. | 69 // Called after EmitLoginPromptVisible is called. |
| 70 virtual void EmitLoginPromptVisibleCalled() {} | 70 virtual void EmitLoginPromptVisibleCalled() {} |
| 71 | 71 |
| 72 // Called when the ARC instance is stopped after it had already started. | 72 // Called when the ARC instance is stopped after it had already started. |
| 73 // |clean| is true if the instance was stopped as a result of an explicit | 73 // |clean| is true if the instance was stopped as a result of an explicit |
| 74 // request, false if it died unexpectedly. | 74 // request, false if it died unexpectedly. |
| 75 virtual void ArcInstanceStopped(bool clean) {} | 75 // |container_instance_id| is the identifier of the container instance. |
| 76 // See details for StartArcInstance(). | |
|
Luis Héctor Chávez
2017/05/19 15:23:03
maybe it's better to refer to the details of Start
hidehiko
2017/05/22 08:38:06
Done.
| |
| 77 virtual void ArcInstanceStopped(bool clean, | |
| 78 const std::string& container_instance_id) {} | |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 // Interface for performing actions on behalf of the stub implementation. | 81 // Interface for performing actions on behalf of the stub implementation. |
| 79 class StubDelegate { | 82 class StubDelegate { |
| 80 public: | 83 public: |
| 81 virtual ~StubDelegate() {} | 84 virtual ~StubDelegate() {} |
| 82 | 85 |
| 83 // Locks the screen. Invoked by the stub when RequestLockScreen() is called. | 86 // Locks the screen. Invoked by the stub when RequestLockScreen() is called. |
| 84 // In the real implementation of SessionManagerClient::RequestLockScreen(), | 87 // In the real implementation of SessionManagerClient::RequestLockScreen(), |
| 85 // a lock request is forwarded to the session manager; in the stub, this is | 88 // a lock request is forwarded to the session manager; in the stub, this is |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 284 // blocks Android ACTION_BOOT_COMPLETED broadcast for 3rd party applications. | 287 // blocks Android ACTION_BOOT_COMPLETED broadcast for 3rd party applications. |
| 285 // Upon completion, invokes |callback| with the result. | 288 // Upon completion, invokes |callback| with the result. |
| 286 // Running ARC requires some amount of disk space. LOW_FREE_DISK_SPACE will | 289 // Running ARC requires some amount of disk space. LOW_FREE_DISK_SPACE will |
| 287 // be returned when there is not enough free disk space for ARC. | 290 // be returned when there is not enough free disk space for ARC. |
| 288 // UNKNOWN_ERROR is returned for any other errors. | 291 // UNKNOWN_ERROR is returned for any other errors. |
| 289 enum class StartArcInstanceResult { | 292 enum class StartArcInstanceResult { |
| 290 SUCCESS, | 293 SUCCESS, |
| 291 UNKNOWN_ERROR, | 294 UNKNOWN_ERROR, |
| 292 LOW_FREE_DISK_SPACE, | 295 LOW_FREE_DISK_SPACE, |
| 293 }; | 296 }; |
| 294 using StartArcInstanceCallback = base::Callback<void(StartArcInstanceResult)>; | 297 // In case of success, container_instance_id will be passed as its second |
|
Luis Héctor Chávez
2017/05/19 15:23:03
nit: |container_instance_id|, for consistency.
hidehiko
2017/05/22 08:38:06
Done.
| |
| 298 // param. The ID is passed to ArcInstanceStopped() to identify which instance | |
| 299 // is stopped. | |
| 300 using StartArcInstanceCallback = | |
| 301 base::Callback<void(StartArcInstanceResult result, | |
| 302 const std::string& container_instance_id)>; | |
| 295 virtual void StartArcInstance(const cryptohome::Identification& cryptohome_id, | 303 virtual void StartArcInstance(const cryptohome::Identification& cryptohome_id, |
| 296 bool disable_boot_completed_broadcast, | 304 bool disable_boot_completed_broadcast, |
| 297 bool enable_vendor_privileged, | 305 bool enable_vendor_privileged, |
| 298 const StartArcInstanceCallback& callback) = 0; | 306 const StartArcInstanceCallback& callback) = 0; |
| 299 | 307 |
| 300 // Asynchronously stops the ARC instance. Upon completion, invokes | 308 // Asynchronously stops the ARC instance. Upon completion, invokes |
| 301 // |callback| with the result; true on success, false on failure (either | 309 // |callback| with the result; true on success, false on failure (either |
| 302 // session manager failed to stop an instance or session manager can not be | 310 // session manager failed to stop an instance or session manager can not be |
| 303 // reached). | 311 // reached). |
| 304 virtual void StopArcInstance(const ArcCallback& callback) = 0; | 312 virtual void StopArcInstance(const ArcCallback& callback) = 0; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 338 // Create() should be used instead. | 346 // Create() should be used instead. |
| 339 SessionManagerClient(); | 347 SessionManagerClient(); |
| 340 | 348 |
| 341 private: | 349 private: |
| 342 DISALLOW_COPY_AND_ASSIGN(SessionManagerClient); | 350 DISALLOW_COPY_AND_ASSIGN(SessionManagerClient); |
| 343 }; | 351 }; |
| 344 | 352 |
| 345 } // namespace chromeos | 353 } // namespace chromeos |
| 346 | 354 |
| 347 #endif // CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ | 355 #endif // CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ |
| OLD | NEW |