| 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_ENGINE_SYNC_ENGINE_EVENT_H_ | 5 #ifndef SYNC_ENGINE_SYNC_ENGINE_EVENT_H_ |
| 6 #define SYNC_ENGINE_SYNC_ENGINE_EVENT_H_ | 6 #define SYNC_ENGINE_SYNC_ENGINE_EVENT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" | 12 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" |
| 13 | 13 |
| 14 namespace syncable { | 14 namespace syncable { |
| 15 class Id; | 15 class Id; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace csync { | 18 namespace syncer { |
| 19 | 19 |
| 20 struct SyncEngineEvent { | 20 struct SyncEngineEvent { |
| 21 enum EventCause { | 21 enum EventCause { |
| 22 //////////////////////////////////////////////////////////////// | 22 //////////////////////////////////////////////////////////////// |
| 23 // Sent on entry of Syncer state machine | 23 // Sent on entry of Syncer state machine |
| 24 SYNC_CYCLE_BEGIN, | 24 SYNC_CYCLE_BEGIN, |
| 25 | 25 |
| 26 // SyncerCommand generated events. | 26 // SyncerCommand generated events. |
| 27 STATUS_CHANGED, | 27 STATUS_CHANGED, |
| 28 | 28 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 class SyncEngineEventListener { | 61 class SyncEngineEventListener { |
| 62 public: | 62 public: |
| 63 // TODO(tim): Consider splitting this up to multiple callbacks, rather than | 63 // TODO(tim): Consider splitting this up to multiple callbacks, rather than |
| 64 // have to do Event e(type); OnSyncEngineEvent(e); at all callsites, | 64 // have to do Event e(type); OnSyncEngineEvent(e); at all callsites, |
| 65 virtual void OnSyncEngineEvent(const SyncEngineEvent& event) = 0; | 65 virtual void OnSyncEngineEvent(const SyncEngineEvent& event) = 0; |
| 66 protected: | 66 protected: |
| 67 virtual ~SyncEngineEventListener() {} | 67 virtual ~SyncEngineEventListener() {} |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace csync | 70 } // namespace syncer |
| 71 | 71 |
| 72 #endif // SYNC_ENGINE_SYNC_ENGINE_EVENT_H_ | 72 #endif // SYNC_ENGINE_SYNC_ENGINE_EVENT_H_ |
| OLD | NEW |