| 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 // Interface to the sync notifier, which is an object that receives | 5 // Interface to the sync notifier, which is an object that receives |
| 6 // notifications when updates are available for a set of sync types. | 6 // notifications when updates are available for a set of sync types. |
| 7 // All the observers are notified when such an event happens. | 7 // All the observers are notified when such an event happens. |
| 8 | 8 |
| 9 #ifndef SYNC_NOTIFIER_SYNC_NOTIFIER_H_ | 9 #ifndef SYNC_NOTIFIER_SYNC_NOTIFIER_H_ |
| 10 #define SYNC_NOTIFIER_SYNC_NOTIFIER_H_ | 10 #define SYNC_NOTIFIER_SYNC_NOTIFIER_H_ |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 virtual void AddObserver(SyncNotifierObserver* observer) = 0; | 24 virtual void AddObserver(SyncNotifierObserver* observer) = 0; |
| 25 virtual void RemoveObserver(SyncNotifierObserver* observer) = 0; | 25 virtual void RemoveObserver(SyncNotifierObserver* observer) = 0; |
| 26 | 26 |
| 27 // SetUniqueId must be called once, before any call to | 27 // SetUniqueId must be called once, before any call to |
| 28 // UpdateCredentials. |unique_id| should be a non-empty globally | 28 // UpdateCredentials. |unique_id| should be a non-empty globally |
| 29 // unique string. | 29 // unique string. |
| 30 virtual void SetUniqueId(const std::string& unique_id) = 0; | 30 virtual void SetUniqueId(const std::string& unique_id) = 0; |
| 31 | 31 |
| 32 // SetState must be called once, before any call to | 32 // SetState must be called once, before any call to |
| 33 // UpdateCredentials. |state| may be empty. | 33 // UpdateCredentials. |state| may be empty. |
| 34 virtual void SetState(const std::string& state) = 0; | 34 // Deprecated in favour of InvalidationStateTracker persistence. |
| 35 virtual void SetStateDeprecated(const std::string& state) = 0; |
| 35 | 36 |
| 36 // The observers won't be notified of any notifications until | 37 // The observers won't be notified of any notifications until |
| 37 // UpdateCredentials is called at least once. It can be called more than | 38 // UpdateCredentials is called at least once. It can be called more than |
| 38 // once. | 39 // once. |
| 39 virtual void UpdateCredentials( | 40 virtual void UpdateCredentials( |
| 40 const std::string& email, const std::string& token) = 0; | 41 const std::string& email, const std::string& token) = 0; |
| 41 | 42 |
| 42 virtual void UpdateEnabledTypes( | 43 virtual void UpdateEnabledTypes( |
| 43 syncable::ModelTypeSet enabled_types) = 0; | 44 syncable::ModelTypeSet enabled_types) = 0; |
| 44 | 45 |
| 45 // This is here only to support the old p2p notification implementation, | 46 // This is here only to support the old p2p notification implementation, |
| 46 // which is still used by sync integration tests. | 47 // which is still used by sync integration tests. |
| 47 // TODO(akalin): Remove this once we move the integration tests off p2p | 48 // TODO(akalin): Remove this once we move the integration tests off p2p |
| 48 // notifications. | 49 // notifications. |
| 49 virtual void SendNotification( | 50 virtual void SendNotification( |
| 50 syncable::ModelTypeSet changed_types) = 0; | 51 syncable::ModelTypeSet changed_types) = 0; |
| 51 }; | 52 }; |
| 52 } // namespace sync_notifier | 53 } // namespace sync_notifier |
| 53 | 54 |
| 54 #endif // SYNC_NOTIFIER_SYNC_NOTIFIER_H_ | 55 #endif // SYNC_NOTIFIER_SYNC_NOTIFIER_H_ |
| 55 | |
| OLD | NEW |