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 3// found in the LICENSE file. 4// 5// Sync protocol for communication between sync client and server. 6 7// If you change or add any enums in this file, update 8// proto_enum_conversions.{h, cc}. 9 10syntax = "proto2"; 11 12option java_multiple_files = true; 13option java_package = "org.chromium.components.sync.protocol"; 14 15option optimize_for = LITE_RUNTIME; 16 17package sync_pb; 18 19message SyncEnums { 20 // These events are sent by the DebugInfo class for singleton events. 21 enum SingletonDebugEventType { 22 // Connection status change. Note this gets generated even during a 23 // successful connection. 24 CONNECTION_STATUS_CHANGE = 1; 25 // Client received an updated token. 26 UPDATED_TOKEN = 2; 27 // Cryptographer needs passphrase. 28 PASSPHRASE_REQUIRED = 3; 29 // Passphrase was accepted by cryptographer. 30 PASSPHRASE_ACCEPTED = 4; 31 // Sync Initialization is complete. 32 INITIALIZATION_COMPLETE = 5; 33 // Server sent stop syncing permanently. This event should never be seen by 34 // the server in the absence of bugs. 35 STOP_SYNCING_PERMANENTLY = 6; 36 // Client has finished encrypting all data. 37 DEPRECATED_ENCRYPTION_COMPLETE = 7 [deprecated = true]; 38 // Client received an actionable error. 39 ACTIONABLE_ERROR = 8; 40 // Set of encrypted types has changed. 41 ENCRYPTED_TYPES_CHANGED = 9; 42 // The encryption passphrase state changed. 43 PASSPHRASE_TYPE_CHANGED = 10; 44 // A new keystore encryption token was persisted. 45 KEYSTORE_TOKEN_UPDATED = 11; 46 // The datatype manager has finished an at least partially successful 47 // configuration and is once again syncing with the server. 48 CONFIGURE_COMPLETE = 12; 49 // A new cryptographer bootstrap token was generated. 50 BOOTSTRAP_TOKEN_UPDATED = 13; 51 // Cryptographer needs trusted vault decryption keys. 52 TRUSTED_VAULT_KEY_REQUIRED = 14; 53 // Cryptographer no longer needs trusted vault decryption keys. 54 TRUSTED_VAULT_KEY_ACCEPTED = 15; 55 } 56 57 // See ui/base/page_transition_types.h for detailed information on the 58 // values of PageTransition and PageTransitionRedirectType below. 59 60 // Types of transitions between pages. 61 enum PageTransition { 62 LINK = 0; 63 TYPED = 1; 64 AUTO_BOOKMARK = 2; 65 AUTO_SUBFRAME = 3; 66 MANUAL_SUBFRAME = 4; 67 GENERATED = 5; 68 AUTO_TOPLEVEL = 6; 69 FORM_SUBMIT = 7; 70 RELOAD = 8; 71 KEYWORD = 9; 72 KEYWORD_GENERATED = 10; 73 // The below two were mistakenly added but never properly used. They are 74 // actually transition qualifiers, and are set independently of other 75 // qualifiers and of the main transitions. See session_specifics.proto for 76 // the list of synced transition qualifiers. 77 // CHAIN_START = 12; Deprecated. 78 // CHAIN_END = 13; Deprecated. 79 } 80 81 // Types of redirects that triggered a transition. 82 enum PageTransitionRedirectType { 83 CLIENT_REDIRECT = 1; 84 SERVER_REDIRECT = 2; 85 } 86 87 enum ErrorType { 88 SUCCESS = 0; 89 DEPRECATED_ACCESS_DENIED = 1; 90 // Returned when the server and client disagree on the store birthday. 91 NOT_MY_BIRTHDAY = 2; 92 // Returned when the store has exceeded the allowed bandwidth utilization. 93 THROTTLED = 3; 94 DEPRECATED_AUTH_EXPIRED = 4; 95 DEPRECATED_USER_NOT_ACTIVATED = 5; 96 DEPRECATED_AUTH_INVALID = 6; 97 // A clear of the user data is pending (e.g. initiated by privacy request). 98 // The client should come back later. 99 CLEAR_PENDING = 7; 100 // A transient error occurred (e.g. a backend timeout). The client should 101 // try again later. 102 TRANSIENT_ERROR = 8; 103 // A server-side migration has taken place for one or more data types. The 104 // client should clear the cache for these data types only and then re-sync 105 // with a server. 106 MIGRATION_DONE = 9; 107 // An administrator disabled sync for this domain. 108 DISABLED_BY_ADMIN = 10; 109 // Deprecated in M50. 110 DEPRECATED_USER_ROLLBACK = 11; 111 // Returned when the client wants to update several data types, but some of 112 // them failed (e.g. throttled). 113 PARTIAL_FAILURE = 12; 114 // Returned when the server detects that this client's sync metadata is 115 // obsolete. The client should reset local sync metadata and restart 116 // syncing. 117 CLIENT_DATA_OBSOLETE = 13; 118 // Returned when the server detects that the encryption state (Nigori, 119 // keystore keys) has been reset/overridden, which means the local 120 // Nigori-related state is obsolete and should be cleared. 121 // Introduced in M84. 122 ENCRYPTION_OBSOLETE = 14; 123 // Unknown value. This should never be explicitly used; it is the default 124 // value when an out-of-date client parses a value it doesn't recognize. 125 UNKNOWN = 100; 126 } 127 128 enum Action { 129 UPGRADE_CLIENT = 0; // Upgrade the client to latest version. 130 DEPRECATED_CLEAR_USER_DATA_AND_RESYNC = 1; 131 DEPRECATED_ENABLE_SYNC_ON_ACCOUNT = 2; 132 DEPRECATED_STOP_AND_RESTART_SYNC = 3; 133 DEPRECATED_DISABLE_SYNC_ON_CLIENT = 4; 134 UNKNOWN_ACTION = 5; // This is the default. 135 } 136 137 // Please keep in sync with chrome/android/java/.../ForeignSessionHelper.java 138 enum DeviceType { 139 TYPE_UNSET = 0; 140 TYPE_WIN = 1; 141 TYPE_MAC = 2; 142 TYPE_LINUX = 3; 143 TYPE_CROS = 4; 144 TYPE_OTHER = 5; 145 TYPE_PHONE = 6; 146 TYPE_TABLET = 7; 147 } 148 149 // This is the successor to GetUpdatesSource. It merges the "normal mode" 150 // values (LOCAL, NOTIFICATION and DATATYPE_REFRESH), which were never really 151 // mutually exclusive to being with, into the GU_TRIGGER value. It also 152 // drops support for some old values that are not supported by newer clients. 153 // 154 // Mind the gaps: Some values are intentionally unused because we want to 155 // keep the values in sync with GetUpdatesSource as much as possible. Please 156 // don't add any values < 12 unless there's a good reason for it. 157 // 158 // Introduced in M28. 159 enum GetUpdatesOrigin { 160 UNKNOWN_ORIGIN = 0; // The source was not set by the caller. 161 PERIODIC = 4; // The source of the update was periodic polling. 162 NEWLY_SUPPORTED_DATATYPE = 7; // The client is in configuration mode 163 // because it's syncing all datatypes, and 164 // support for a new datatype was recently 165 // released via a software auto-update. 166 MIGRATION = 8; // The client is in configuration mode because a 167 // MIGRATION_DONE error previously returned by the 168 // server necessitated resynchronization. 169 NEW_CLIENT = 9; // The client is in configuration mode because the 170 // user enabled sync for the first time. Not to be 171 // confused with FIRST_UPDATE. 172 RECONFIGURATION = 10; // The client is in configuration mode because the 173 // user opted to sync a different set of datatypes. 174 GU_TRIGGER = 12; // The client is in 'normal' mode. It may have several 175 // reasons for requesting an update. See the per-type 176 // GetUpdateTriggers message for more details. 177 RETRY = 13; // A retry GU to pick up updates missed by last GU due to 178 // replication delay, missing hints, etc. 179 PROGRAMMATIC = 14; // A GU to programmatically enable/disable a 180 // datatype, often due to error handling. 181 } 182} 183