| 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 CHROME_BROWSER_INVALIDATION_INVALIDATION_LOGGER_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_INVALIDATION_INVALIDATION_LOGGER_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_INVALIDATION_INVALIDATION_LOGGER_OBSERVER_H_ | 6 #define CHROME_BROWSER_INVALIDATION_INVALIDATION_LOGGER_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "sync/notifier/invalidation_util.h" |
| 9 #include "sync/notifier/invalidator_state.h" | 10 #include "sync/notifier/invalidator_state.h" |
| 10 #include "sync/notifier/object_id_invalidation_map.h" | 11 #include "sync/notifier/object_id_invalidation_map.h" |
| 11 | 12 |
| 12 namespace base { | 13 namespace base { |
| 13 class DictionaryValue; | 14 class DictionaryValue; |
| 14 } // namespace base | 15 } // namespace base |
| 15 | 16 |
| 16 namespace syncer { | 17 namespace syncer { |
| 18 class InvalidationHandler; |
| 17 class ObjectIdInvalidationMap; | 19 class ObjectIdInvalidationMap; |
| 18 } // namespace syncer | 20 } // namespace syncer |
| 19 | 21 |
| 20 namespace invalidation { | 22 namespace invalidation { |
| 21 // This class provides the possibilty to register as an observer for the | 23 // This class provides the possibilty to register as an observer for the |
| 22 // InvalidationLogger notifications whenever an InvalidatorService changes | 24 // InvalidationLogger notifications whenever an InvalidatorService changes |
| 23 // its internal state. | 25 // its internal state. |
| 24 // (i.e. A new registration, a new invalidation, a TICL/GCM state change) | 26 // (i.e. A new registration, a new invalidation, a TICL/GCM state change) |
| 25 | |
| 26 class InvalidationLoggerObserver { | 27 class InvalidationLoggerObserver { |
| 27 public: | 28 public: |
| 28 virtual void OnRegistration(const base::DictionaryValue& details) = 0; | 29 virtual void OnRegistration(const base::DictionaryValue& details) = 0; |
| 29 virtual void OnUnregistration(const base::DictionaryValue& details) = 0; | 30 virtual void OnUnregistration(const base::DictionaryValue& details) = 0; |
| 30 virtual void OnStateChange(const syncer::InvalidatorState& newState) = 0; | 31 virtual void OnStateChange(const syncer::InvalidatorState& new_state) = 0; |
| 31 virtual void OnUpdateIds(const base::DictionaryValue& details) = 0; | 32 virtual void OnUpdateIds(const std::string& handler_name, |
| 33 const syncer::ObjectIdSet& details) = 0; |
| 32 virtual void OnDebugMessage(const base::DictionaryValue& details) = 0; | 34 virtual void OnDebugMessage(const base::DictionaryValue& details) = 0; |
| 33 virtual void OnInvalidation( | 35 virtual void OnInvalidation( |
| 34 const syncer::ObjectIdInvalidationMap& details) = 0; | 36 const syncer::ObjectIdInvalidationMap& details) = 0; |
| 35 | 37 |
| 36 protected: | 38 protected: |
| 37 virtual ~InvalidationLoggerObserver() {} | 39 virtual ~InvalidationLoggerObserver() {} |
| 38 }; | 40 }; |
| 39 | 41 |
| 40 } // namespace invalidation | 42 } // namespace invalidation |
| 41 | 43 |
| 42 #endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_LOGGER_OBSERVER_H_ | 44 #endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_LOGGER_OBSERVER_H_ |
| OLD | NEW |