OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_SYNC_JS_DIRECTORY_CHANGE_LISTENER_H_ | |
6 #define CHROME_BROWSER_SYNC_JS_DIRECTORY_CHANGE_LISTENER_H_ | |
7 #pragma once | |
8 | |
9 #include <string> | |
10 | |
11 #include "base/basictypes.h" | |
12 #include "base/compiler_specific.h" | |
13 #include "chrome/browser/sync/syncable/directory_change_listener.h" | |
14 | |
15 namespace browser_sync { | |
16 | |
17 class JsEventRouter; | |
18 | |
19 // Routes SyncManager events to a JsEventRouter. | |
20 class JsDirectoryChangeListener : public syncable::DirectoryChangeListener { | |
21 public: | |
22 // |parent_router| must be non-NULL and must outlive this object. | |
23 explicit JsDirectoryChangeListener(JsEventRouter* parent_router); | |
24 | |
25 virtual ~JsDirectoryChangeListener(); | |
26 | |
27 // syncable::DirectoryChangeListener implementation. | |
28 virtual void HandleCalculateChangesChangeEventFromSyncApi( | |
29 const syncable::OriginalEntries& originals, | |
30 const syncable::WriterTag& writer, | |
31 syncable::BaseTransaction* trans) OVERRIDE; | |
32 virtual void HandleCalculateChangesChangeEventFromSyncer( | |
33 const syncable::OriginalEntries& originals, | |
34 const syncable::WriterTag& writer, | |
35 syncable::BaseTransaction* trans) OVERRIDE; | |
36 virtual syncable::ModelTypeBitSet HandleTransactionEndingChangeEvent( | |
37 syncable::BaseTransaction* trans) OVERRIDE; | |
38 virtual void HandleTransactionCompleteChangeEvent( | |
39 const syncable::ModelTypeBitSet& models_with_changes) OVERRIDE; | |
40 | |
41 private: | |
42 JsEventRouter* parent_router_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(JsDirectoryChangeListener); | |
45 }; | |
46 | |
47 } // namespace browser_sync | |
48 | |
49 #endif // CHROME_BROWSER_SYNC_JS_DIRECTORY_CHANGE_LISTENER_H_ | |
OLD | NEW |