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// Update proto_value_conversions{.h,.cc,_unittest.cc} if you change 8// any fields in this file. 9 10syntax = "proto2"; 11 12option optimize_for = LITE_RUNTIME; 13option retain_unknown_fields = true; 14 15package sync_pb; 16 17message SyncEnums { 18 // These events are sent by |SyncManager| class. Note: In the code they each 19 // of these events have some additional info but we are not sending them to 20 // server. 21 enum EventType { 22 AUTH_ERROR = 1; // Auth error. Note this gets generated even during 23 // successful auth with the error set to none. 24 UPDATED_TOKEN = 2; // Client received an updated token. 25 PASSPHRASE_REQUIRED = 3; // Cryptographer needs passphrase. 26 PASSPHRASE_ACCEPTED = 4; // Passphrase was accepted by cryptographer. 27 INITIALIZATION_COMPLETE = 5; // Sync Initialization is complete. 28 29 // |STOP_SYNCING_PERMANENTLY| event should never be seen by the server in 30 // the absence of bugs. 31 STOP_SYNCING_PERMANENTLY = 6; // Server sent stop syncing permanently. 32 33 ENCRYPTED_TYPES_CHANGED = 9; // Set of encrypted types has changed. 34 ENCRYPTION_COMPLETE = 7; // Client has finished encrypting all data. 35 ACTIONABLE_ERROR = 8; // Client received an actionable error. 36 } 37 38 // See content/public/common/page_transition_types.h for detailed 39 // information on the values of PageTransition and 40 // PageTransitionRedirectType below. 41 42 // Types of transitions between pages. 43 enum PageTransition { 44 LINK = 0; 45 TYPED = 1; 46 AUTO_BOOKMARK = 2; 47 AUTO_SUBFRAME = 3; 48 MANUAL_SUBFRAME = 4; 49 GENERATED = 5; 50 AUTO_TOPLEVEL = 6; 51 FORM_SUBMIT = 7; 52 RELOAD = 8; 53 KEYWORD = 9; 54 KEYWORD_GENERATED = 10; 55 // The below two were mistakenly added but never properly used. They are 56 // actually transition qualifiers, and are set independently of other 57 // qualifiers and of the main transitions. See session_specifics.proto for 58 // the list of synced transition qualifiers. 59 // CHAIN_START = 12; Deprecated. 60 // CHAIN_END = 13; Deprecated. 61 } 62 63 // Types of redirects that triggered a transition. 64 enum PageTransitionRedirectType { 65 CLIENT_REDIRECT = 1; 66 SERVER_REDIRECT = 2; 67 } 68 69 enum ErrorType { 70 SUCCESS = 0; 71 ACCESS_DENIED = 1; // Returned when the user doesn't have access to 72 // store (instead of HTTP 401). 73 NOT_MY_BIRTHDAY = 2; // Returned when the server and client disagree on 74 // the store birthday. 75 THROTTLED = 3; // Returned when the store has exceeded the 76 // allowed bandwidth utilization. 77 AUTH_EXPIRED = 4; // Auth token or cookie has expired. 78 USER_NOT_ACTIVATED = 5; // User doesn't have the Chrome bit set on that 79 // Google Account. 80 AUTH_INVALID = 6; // Auth token or cookie is otherwise invalid. 81 CLEAR_PENDING = 7; // A clear of the user data is pending (e.g. 82 // initiated by privacy request). Client should 83 // come back later. 84 TRANSIENT_ERROR = 8; // A transient error occured (eg. backend 85 // timeout). Client should try again later. 86 MIGRATION_DONE = 9; // Migration has finished for one or more data 87 // types. Client should clear the cache for 88 // these data types only and then re-sync with 89 // a server. 90 DISABLED_BY_ADMIN = 10; // An administrator disabled sync for this domain. 91 UNKNOWN = 100; // Unknown value. This should never be explicitly 92 // used; it is the default value when an 93 // out-of-date client parses a value it doesn't 94 // recognize. 95 } 96 97 enum Action { 98 UPGRADE_CLIENT = 0; // Upgrade the client to latest version. 99 CLEAR_USER_DATA_AND_RESYNC = 1; // Clear user data from dashboard and 100 // setup sync again. 101 ENABLE_SYNC_ON_ACCOUNT = 2; // The administrator needs to enable sync 102 // on the account. 103 STOP_AND_RESTART_SYNC = 3; // Stop sync and set up sync again. 104 DISABLE_SYNC_ON_CLIENT = 4; // Wipe the client of all sync data and 105 // stop syncing. 106 UNKNOWN_ACTION = 5; // This is the default. 107 } 108 109 enum DeviceType { 110 TYPE_WIN = 1; 111 TYPE_MAC = 2; 112 TYPE_LINUX = 3; 113 TYPE_CROS = 4; 114 TYPE_OTHER = 5; 115 TYPE_PHONE = 6; 116 TYPE_TABLET = 7; 117 } 118 119 // This is the successor to GetUpdatesSource. It merges the "normal mode" 120 // values (LOCAL, NOTIFICATION and DATATYPE_REFRESH), which were never really 121 // mutually exclusive to being with, into the GU_TRIGGER value. It also 122 // drops support for some old values that are not supported by newer clients. 123 // 124 // Mind the gaps: Some values are intentionally unused because we want to 125 // keep the values in sync with GetUpdatesSource as much as possible. Please 126 // don't add any values < 12 unless there's a good reason for it. 127 // 128 // Introduced in M28. 129 enum GetUpdatesOrigin { 130 UNKNOWN_ORIGIN = 0; // The source was not set by the caller. 131 PERIODIC = 4; // The source of the update was periodic polling. 132 NEWLY_SUPPORTED_DATATYPE = 7; // The client is in configuration mode 133 // because it's syncing all datatypes, and 134 // support for a new datatype was recently 135 // released via a software auto-update. 136 MIGRATION = 8; // The client is in configuration mode because a 137 // MIGRATION_DONE error previously returned by the 138 // server necessitated resynchronization. 139 NEW_CLIENT = 9; // The client is in configuration mode because the 140 // user enabled sync for the first time. Not to be 141 // confused with FIRST_UPDATE. 142 RECONFIGURATION = 10; // The client is in configuration mode because the 143 // user opted to sync a different set of datatypes. 144 GU_TRIGGER = 12; // The client is in 'normal' mode. It may have several 145 // reasons for requesting an update. See the per-type 146 // GetUpdateTriggers message for more details. 147 } 148} 149