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