OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SYNC_DRIVER_SYNC_FRONTEND_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_SYNC_FRONTEND_H_ |
6 #define COMPONENTS_SYNC_DRIVER_SYNC_FRONTEND_H_ | 6 #define COMPONENTS_SYNC_DRIVER_SYNC_FRONTEND_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "components/sync/base/model_type.h" | 10 #include "components/sync/base/model_type.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 // Called when we receive an updated status counter for a directory type. | 82 // Called when we receive an updated status counter for a directory type. |
83 // | 83 // |
84 // Disabled by default. Enable by calling | 84 // Disabled by default. Enable by calling |
85 // EnableDirectoryTypeDebugInfoForwarding() on the backend. | 85 // EnableDirectoryTypeDebugInfoForwarding() on the backend. |
86 virtual void OnDirectoryTypeStatusCounterUpdated( | 86 virtual void OnDirectoryTypeStatusCounterUpdated( |
87 syncer::ModelType type, | 87 syncer::ModelType type, |
88 const syncer::StatusCounters& counters) = 0; | 88 const syncer::StatusCounters& counters) = 0; |
89 | 89 |
90 // The status of the connection to the sync server has changed. | 90 // The status of the connection to the sync server has changed. |
91 virtual void OnConnectionStatusChange( | 91 virtual void OnConnectionStatusChange(syncer::ConnectionStatus status) = 0; |
92 syncer::ConnectionStatus status) = 0; | |
93 | 92 |
94 // The syncer requires a passphrase to decrypt sensitive updates. This is | 93 // The syncer requires a passphrase to decrypt sensitive updates. This is |
95 // called when the first sensitive data type is setup by the user and anytime | 94 // called when the first sensitive data type is setup by the user and anytime |
96 // the passphrase is changed by another synced client. |reason| denotes why | 95 // the passphrase is changed by another synced client. |reason| denotes why |
97 // the passphrase was required. |pending_keys| is a copy of the | 96 // the passphrase was required. |pending_keys| is a copy of the |
98 // cryptographer's pending keys to be passed on to the frontend in order to | 97 // cryptographer's pending keys to be passed on to the frontend in order to |
99 // be cached. | 98 // be cached. |
100 virtual void OnPassphraseRequired( | 99 virtual void OnPassphraseRequired( |
101 syncer::PassphraseRequiredReason reason, | 100 syncer::PassphraseRequiredReason reason, |
102 const sync_pb::EncryptedData& pending_keys) = 0; | 101 const sync_pb::EncryptedData& pending_keys) = 0; |
103 | 102 |
104 // Called when the passphrase provided by the user is | 103 // Called when the passphrase provided by the user is |
105 // accepted. After this is called, updates to sensitive nodes are | 104 // accepted. After this is called, updates to sensitive nodes are |
106 // encrypted using the accepted passphrase. | 105 // encrypted using the accepted passphrase. |
107 virtual void OnPassphraseAccepted() = 0; | 106 virtual void OnPassphraseAccepted() = 0; |
108 | 107 |
109 // Called when the set of encrypted types or the encrypt everything | 108 // Called when the set of encrypted types or the encrypt everything |
110 // flag has been changed. Note that encryption isn't complete until | 109 // flag has been changed. Note that encryption isn't complete until |
111 // the OnEncryptionComplete() notification has been sent (see | 110 // the OnEncryptionComplete() notification has been sent (see |
112 // below). | 111 // below). |
113 // | 112 // |
114 // |encrypted_types| will always be a superset of | 113 // |encrypted_types| will always be a superset of |
115 // syncer::Cryptographer::SensitiveTypes(). If |encrypt_everything| is | 114 // syncer::Cryptographer::SensitiveTypes(). If |encrypt_everything| is |
116 // true, |encrypted_types| will be the set of all known types. | 115 // true, |encrypted_types| will be the set of all known types. |
117 // | 116 // |
118 // Until this function is called, observers can assume that the set | 117 // Until this function is called, observers can assume that the set |
119 // of encrypted types is syncer::Cryptographer::SensitiveTypes() and that | 118 // of encrypted types is syncer::Cryptographer::SensitiveTypes() and that |
120 // the encrypt everything flag is false. | 119 // the encrypt everything flag is false. |
121 virtual void OnEncryptedTypesChanged( | 120 virtual void OnEncryptedTypesChanged(syncer::ModelTypeSet encrypted_types, |
122 syncer::ModelTypeSet encrypted_types, | 121 bool encrypt_everything) = 0; |
123 bool encrypt_everything) = 0; | |
124 | 122 |
125 // Called after we finish encrypting the current set of encrypted | 123 // Called after we finish encrypting the current set of encrypted |
126 // types. | 124 // types. |
127 virtual void OnEncryptionComplete() = 0; | 125 virtual void OnEncryptionComplete() = 0; |
128 | 126 |
129 // Called to perform migration of |types|. | 127 // Called to perform migration of |types|. |
130 virtual void OnMigrationNeededForTypes(syncer::ModelTypeSet types) = 0; | 128 virtual void OnMigrationNeededForTypes(syncer::ModelTypeSet types) = 0; |
131 | 129 |
132 // Inform the Frontend that new datatypes are available for registration. | 130 // Inform the Frontend that new datatypes are available for registration. |
133 virtual void OnExperimentsChanged( | 131 virtual void OnExperimentsChanged(const syncer::Experiments& experiments) = 0; |
134 const syncer::Experiments& experiments) = 0; | |
135 | 132 |
136 // Called when the sync cycle returns there is an user actionable error. | 133 // Called when the sync cycle returns there is an user actionable error. |
137 virtual void OnActionableError(const syncer::SyncProtocolError& error) = 0; | 134 virtual void OnActionableError(const syncer::SyncProtocolError& error) = 0; |
138 | 135 |
139 // Called when the user of this device enables passphrase encryption. | 136 // Called when the user of this device enables passphrase encryption. |
140 // | 137 // |
141 // |nigori_state| contains the new (post custom passphrase) encryption keys | 138 // |nigori_state| contains the new (post custom passphrase) encryption keys |
142 // and can be used to restore SyncEncryptionHandler's state across sync | 139 // and can be used to restore SyncEncryptionHandler's state across sync |
143 // backend instances. See also SyncEncryptionHandlerImpl::RestoreNigori. | 140 // backend instances. See also SyncEncryptionHandlerImpl::RestoreNigori. |
144 virtual void OnLocalSetPassphraseEncryption( | 141 virtual void OnLocalSetPassphraseEncryption( |
145 const syncer::SyncEncryptionHandler::NigoriState& nigori_state) = 0; | 142 const syncer::SyncEncryptionHandler::NigoriState& nigori_state) = 0; |
146 }; | 143 }; |
147 | 144 |
148 } // namespace sync_driver | 145 } // namespace sync_driver |
149 | 146 |
150 #endif // COMPONENTS_SYNC_DRIVER_SYNC_FRONTEND_H_ | 147 #endif // COMPONENTS_SYNC_DRIVER_SYNC_FRONTEND_H_ |
OLD | NEW |