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 #ifndef SYNC_NOTIFIER_SYNC_NOTIFIER_OBSERVER_H_ | 5 #ifndef SYNC_NOTIFIER_SYNC_NOTIFIER_OBSERVER_H_ |
6 #define SYNC_NOTIFIER_SYNC_NOTIFIER_OBSERVER_H_ | 6 #define SYNC_NOTIFIER_SYNC_NOTIFIER_OBSERVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | |
10 | |
11 #include "sync/internal_api/public/syncable/model_type_payload_map.h" | 9 #include "sync/internal_api/public/syncable/model_type_payload_map.h" |
| 10 #include "sync/notifier/sync_notifier_state.h" |
12 | 11 |
13 namespace sync_notifier { | 12 namespace sync_notifier { |
14 | 13 |
15 enum IncomingNotificationSource { | 14 enum IncomingNotificationSource { |
16 // The server is notifying us that one or more datatypes have stale data. | 15 // The server is notifying us that one or more datatypes have stale data. |
17 REMOTE_NOTIFICATION, | 16 REMOTE_NOTIFICATION, |
18 // A chrome datatype is requesting an optimistic refresh of its data. | 17 // A chrome datatype is requesting an optimistic refresh of its data. |
19 LOCAL_NOTIFICATION, | 18 LOCAL_NOTIFICATION, |
20 }; | 19 }; |
21 | 20 |
22 class SyncNotifierObserver { | 21 class SyncNotifierObserver { |
23 public: | 22 public: |
24 virtual void OnIncomingNotification( | 23 virtual void OnIncomingNotification( |
25 const syncable::ModelTypePayloadMap& type_payloads, | 24 const syncable::ModelTypePayloadMap& type_payloads, |
26 IncomingNotificationSource source) = 0; | 25 IncomingNotificationSource source) = 0; |
27 virtual void OnNotificationStateChange(bool notifications_enabled) = 0; | 26 virtual void OnSyncNotifierStateChange( |
| 27 SyncNotifierState sync_notifier_state) = 0; |
28 | 28 |
29 protected: | 29 protected: |
30 virtual ~SyncNotifierObserver() {} | 30 virtual ~SyncNotifierObserver() {} |
31 }; | 31 }; |
32 | 32 |
33 } // namespace sync_notifier | 33 } // namespace sync_notifier |
34 | 34 |
35 #endif // SYNC_NOTIFIER_SYNC_NOTIFIER_OBSERVER_H_ | 35 #endif // SYNC_NOTIFIER_SYNC_NOTIFIER_OBSERVER_H_ |
OLD | NEW |