1 // Copyright 2015 The Chromium OS Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef SYSTEM_API_DBUS_LOGIN_MANAGER_DBUS_CONSTANTS_H_ 6 #define SYSTEM_API_DBUS_LOGIN_MANAGER_DBUS_CONSTANTS_H_ 7 8 namespace login_manager { 9 const char kSessionManagerInterface[] = "org.chromium.SessionManagerInterface"; 10 const char kSessionManagerServicePath[] = "/org/chromium/SessionManager"; 11 const char kSessionManagerServiceName[] = "org.chromium.SessionManager"; 12 // Methods 13 const char kSessionManagerEmitLoginPromptVisible[] = "EmitLoginPromptVisible"; 14 const char kSessionManagerEmitAshInitialized[] = "EmitAshInitialized"; 15 const char kSessionManagerEnableChromeTesting[] = "EnableChromeTesting"; 16 const char kSessionManagerSaveLoginPassword[] = "SaveLoginPassword"; 17 const char kSessionManagerStartSession[] = "StartSession"; 18 const char kSessionManagerStopSession[] = "StopSession"; 19 const char kSessionManagerRestartJob[] = "RestartJob"; 20 const char kSessionManagerStorePolicy[] = "StorePolicy"; 21 const char kSessionManagerStorePolicyEx[] = "StorePolicyEx"; 22 const char kSessionManagerStoreUnsignedPolicy[] = "StoreUnsignedPolicy"; 23 const char kSessionManagerStoreUnsignedPolicyEx[] = "StoreUnsignedPolicyEx"; 24 const char kSessionManagerRetrievePolicy[] = "RetrievePolicy"; 25 const char kSessionManagerRetrievePolicyEx[] = "RetrievePolicyEx"; 26 const char kSessionManagerStorePolicyForUser[] = "StorePolicyForUser"; 27 const char kSessionManagerStoreUnsignedPolicyForUser[] = 28 "StoreUnsignedPolicyForUser"; 29 const char kSessionManagerRetrievePolicyForUser[] = "RetrievePolicyForUser"; 30 const char kSessionManagerRetrievePolicyForUserWithoutSession[] = 31 "RetrievePolicyForUserWithoutSession"; 32 const char kSessionManagerStoreDeviceLocalAccountPolicy[] = 33 "StoreDeviceLocalAccountPolicy"; 34 const char kSessionManagerRetrieveDeviceLocalAccountPolicy[] = 35 "RetrieveDeviceLocalAccountPolicy"; 36 const char kSessionManagerListStoredComponentPolicies[] = 37 "ListStoredComponentPolicies"; 38 const char kSessionManagerRetrieveSessionState[] = "RetrieveSessionState"; 39 const char kSessionManagerRetrieveActiveSessions[] = "RetrieveActiveSessions"; 40 const char kSessionManagerRetrievePrimarySession[] = "RetrievePrimarySession"; 41 const char kSessionManagerStartTPMFirmwareUpdate[] = "StartTPMFirmwareUpdate"; 42 const char kSessionManagerStartDeviceWipe[] = "StartDeviceWipe"; 43 const char kSessionManagerHandleSupervisedUserCreationStarting[] = 44 "HandleSupervisedUserCreationStarting"; 45 const char kSessionManagerHandleSupervisedUserCreationFinished[] = 46 "HandleSupervisedUserCreationFinished"; 47 const char kSessionManagerLockScreen[] = "LockScreen"; 48 const char kSessionManagerHandleLockScreenShown[] = "HandleLockScreenShown"; 49 const char kSessionManagerHandleLockScreenDismissed[] = 50 "HandleLockScreenDismissed"; 51 const char kSessionManagerSetFlagsForUser[] = "SetFlagsForUser"; 52 const char kSessionManagerGetServerBackedStateKeys[] = 53 "GetServerBackedStateKeys"; 54 const char kSessionManagerInitMachineInfo[] = "InitMachineInfo"; 55 const char kSessionManagerCheckArcAvailability[] = "CheckArcAvailability"; 56 const char kSessionManagerStartArcMiniContainer[] = "StartArcMiniContainer"; 57 const char kSessionManagerUpgradeArcContainer[] = "UpgradeArcContainer"; 58 const char kSessionManagerStopArcInstance[] = "StopArcInstance"; 59 const char kSessionManagerSetArcCpuRestriction[] = "SetArcCpuRestriction"; 60 const char kSessionManagerEmitArcBooted[] = "EmitArcBooted"; 61 const char kSessionManagerGetArcStartTimeTicks[] = "GetArcStartTimeTicks"; 62 const char kSessionManagerRemoveArcData[] = "RemoveArcData"; 63 const char kSessionManagerStartContainer[] = "StartContainer"; 64 const char kSessionManagerStopContainer[] = "StopContainer"; 65 // Signals 66 const char kLoginPromptVisibleSignal[] = "LoginPromptVisible"; 67 const char kSessionStateChangedSignal[] = "SessionStateChanged"; 68 // ScreenLock signals. 69 const char kScreenIsLockedSignal[] = "ScreenIsLocked"; 70 const char kScreenIsUnlockedSignal[] = "ScreenIsUnlocked"; 71 // Ownership API signals. 72 const char kOwnerKeySetSignal[] = "SetOwnerKeyComplete"; 73 const char kPropertyChangeCompleteSignal[] = "PropertyChangeComplete"; 74 // ARC instance signals. 75 const char kArcInstanceStopped[] = "ArcInstanceStopped"; 76 const char kArcInstanceRebooted[] = "ArcInstanceRebooted"; 77 78 // D-Bus error codes 79 namespace dbus_error { 80 #define INTERFACE "org.chromium.SessionManagerInterface" 81 82 const char kNone[] = INTERFACE ".None"; 83 const char kInvalidParameter[] = INTERFACE ".InvalidParameter"; 84 const char kArcCpuCgroupFail[] = INTERFACE ".ArcCpuCgroupFail"; 85 const char kArcInstanceRunning[] = INTERFACE ".ArcInstanceRunning"; 86 const char kArcContainerNotFound[] = INTERFACE ".ArcContainerNotFound"; 87 const char kContainerStartupFail[] = INTERFACE ".ContainerStartupFail"; 88 const char kContainerShutdownFail[] = INTERFACE ".ContainerShutdownFail"; 89 const char kDeleteFail[] = INTERFACE ".DeleteFail"; 90 const char kEmitFailed[] = INTERFACE ".EmitFailed"; 91 const char kGetServiceFail[] = INTERFACE ".kGetServiceFail"; 92 const char kInitMachineInfoFail[] = INTERFACE ".InitMachineInfoFail"; 93 const char kInvalidAccount[] = INTERFACE ".InvalidAccount"; 94 const char kLowFreeDisk[] = INTERFACE ".LowFreeDisk"; 95 const char kNoOwnerKey[] = INTERFACE ".NoOwnerKey"; 96 const char kNoUserNssDb[] = INTERFACE ".NoUserNssDb"; 97 const char kNotAvailable[] = INTERFACE ".NotAvailable"; 98 const char kNotStarted[] = INTERFACE ".NotStarted"; 99 const char kPolicyInitFail[] = INTERFACE ".PolicyInitFail"; 100 const char kPubkeySetIllegal[] = INTERFACE ".PubkeySetIllegal"; 101 const char kPolicySignatureRequired[] = INTERFACE ".PolicySignatureRequired"; 102 const char kSessionDoesNotExist[] = INTERFACE ".SessionDoesNotExist"; 103 const char kSessionExists[] = INTERFACE ".SessionExists"; 104 const char kSigDecodeFail[] = INTERFACE ".SigDecodeFail"; 105 const char kSigEncodeFail[] = INTERFACE ".SigEncodeFail"; 106 const char kTestingChannelError[] = INTERFACE ".TestingChannelError"; 107 const char kUnknownPid[] = INTERFACE ".UnknownPid"; 108 const char kVerifyFail[] = INTERFACE ".VerifyFail"; 109 const char kVpdUpdateFailed[] = INTERFACE ".VpdUpdateFailed"; 110 111 #undef INTERFACE 112 } // namespace dbus_error 113 114 // Values 115 enum ContainerCpuRestrictionState { 116 CONTAINER_CPU_RESTRICTION_FOREGROUND = 0, 117 CONTAINER_CPU_RESTRICTION_BACKGROUND = 1, 118 NUM_CONTAINER_CPU_RESTRICTION_STATES = 2, 119 }; 120 121 enum class ArcContainerStopReason { 122 // The ARC container is crashed. 123 CRASH = 0, 124 125 // Stopped by the user request, e.g. disabling ARC. 126 USER_REQUEST = 1, 127 128 // Session manager is shut down. So, ARC is also shut down along with it. 129 SESSION_MANAGER_SHUTDOWN = 2, 130 131 // Browser was shut down. ARC is also shut down along with it. 132 BROWSER_SHUTDOWN = 3, 133 134 // Disk space is too small to upgrade ARC. 135 LOW_DISK_SPACE = 4, 136 137 // Failed to upgrade ARC mini container into full container. 138 // Note that this will be used if the reason is other than low-disk-space. 139 UPGRADE_FAILURE = 5, 140 }; 141 142 } // namespace login_manager 143 144 #endif // SYSTEM_API_DBUS_LOGIN_MANAGER_DBUS_CONSTANTS_H_ 145