| 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 GetArcStartTimeCallback; | 224 GetArcStartTimeCallback; |
| 225 | 225 |
| 226 // Asynchronously checks if starting the ARC instance is available. | 226 // Asynchronously checks if starting the ARC instance is available. |
| 227 // The result of the operation is reported through |callback|. | 227 // The result of the operation is reported through |callback|. |
| 228 // If the operation fails, it is reported as unavailable. | 228 // If the operation fails, it is reported as unavailable. |
| 229 virtual void CheckArcAvailability(const ArcCallback& callback) = 0; | 229 virtual void CheckArcAvailability(const ArcCallback& callback) = 0; |
| 230 | 230 |
| 231 // Asynchronously starts the ARC instance for the user whose cryptohome is | 231 // Asynchronously starts the ARC instance for the user whose cryptohome is |
| 232 // located by |cryptohome_id|. Flag |disable_boot_completed_broadcast| | 232 // located by |cryptohome_id|. Flag |disable_boot_completed_broadcast| |
| 233 // blocks Android ACTION_BOOT_COMPLETED broadcast for 3rd party applications. | 233 // blocks Android ACTION_BOOT_COMPLETED broadcast for 3rd party applications. |
| 234 // Upon completion, invokes |callback| with the result; true on success, false | 234 // Upon completion, invokes |callback| with the result. |
| 235 // on failure (either session manager failed to start an instance or session | 235 // Running ARC requires some amount of disk space. LOW_FREE_DISK_SPACE will |
| 236 // manager can not be reached). | 236 // be returned when there is not enough free disk space for ARC. |
| 237 // UNKNOWN_ERROR is returned for any other errors. |
| 238 // TODO(hidehiko): Replace "typedef" by "using". |
| 239 enum class StartArcInstanceResult { |
| 240 SUCCESS, |
| 241 UNKNOWN_ERROR, |
| 242 LOW_FREE_DISK_SPACE, |
| 243 }; |
| 244 typedef base::Callback<void(StartArcInstanceResult)> StartArcInstanceCallback; |
| 237 virtual void StartArcInstance(const cryptohome::Identification& cryptohome_id, | 245 virtual void StartArcInstance(const cryptohome::Identification& cryptohome_id, |
| 238 bool disable_boot_completed_broadcast, | 246 bool disable_boot_completed_broadcast, |
| 239 const ArcCallback& callback) = 0; | 247 const StartArcInstanceCallback& callback) = 0; |
| 240 | 248 |
| 241 // Asynchronously stops the ARC instance. Upon completion, invokes | 249 // Asynchronously stops the ARC instance. Upon completion, invokes |
| 242 // |callback| with the result; true on success, false on failure (either | 250 // |callback| with the result; true on success, false on failure (either |
| 243 // session manager failed to stop an instance or session manager can not be | 251 // session manager failed to stop an instance or session manager can not be |
| 244 // reached). | 252 // reached). |
| 245 virtual void StopArcInstance(const ArcCallback& callback) = 0; | 253 virtual void StopArcInstance(const ArcCallback& callback) = 0; |
| 246 | 254 |
| 247 // Prioritizes the ARC instance by removing cgroups restrictions that | 255 // Prioritizes the ARC instance by removing cgroups restrictions that |
| 248 // session_manager applies to the instance by default. Upon completion, | 256 // session_manager applies to the instance by default. Upon completion, |
| 249 // invokes |callback| with the result; true on success, false on failure. | 257 // invokes |callback| with the result; true on success, false on failure. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 274 // Create() should be used instead. | 282 // Create() should be used instead. |
| 275 SessionManagerClient(); | 283 SessionManagerClient(); |
| 276 | 284 |
| 277 private: | 285 private: |
| 278 DISALLOW_COPY_AND_ASSIGN(SessionManagerClient); | 286 DISALLOW_COPY_AND_ASSIGN(SessionManagerClient); |
| 279 }; | 287 }; |
| 280 | 288 |
| 281 } // namespace chromeos | 289 } // namespace chromeos |
| 282 | 290 |
| 283 #endif // CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ | 291 #endif // CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ |
| OLD | NEW |