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_TRANSACTION_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_SYNC_JS_TRANSACTION_OBSERVER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <string> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" |
| 13 #include "base/threading/non_thread_safe.h" |
| 14 #include "chrome/browser/sync/syncable/transaction_observer.h" |
| 15 |
| 16 namespace browser_sync { |
| 17 |
| 18 class JsEventRouter; |
| 19 |
| 20 // Routes SyncManager events to a JsEventRouter. |
| 21 class JsTransactionObserver : public syncable::TransactionObserver { |
| 22 public: |
| 23 // |parent_router| must be non-NULL and must outlive this object. |
| 24 explicit JsTransactionObserver(JsEventRouter* parent_router); |
| 25 |
| 26 virtual ~JsTransactionObserver(); |
| 27 |
| 28 // syncable::TransactionObserver implementation. |
| 29 virtual void OnTransactionStart( |
| 30 const tracked_objects::Location& location, |
| 31 const syncable::WriterTag& writer) OVERRIDE; |
| 32 virtual void OnTransactionMutate( |
| 33 const tracked_objects::Location& location, |
| 34 const syncable::WriterTag& writer, |
| 35 const syncable::OriginalEntries& originals, |
| 36 const syncable::ModelTypeBitSet& models_with_changes) OVERRIDE; |
| 37 virtual void OnTransactionEnd( |
| 38 const tracked_objects::Location& location, |
| 39 const syncable::WriterTag& writer) OVERRIDE; |
| 40 |
| 41 private: |
| 42 base::NonThreadSafe non_thread_safe_; |
| 43 JsEventRouter* parent_router_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(JsTransactionObserver); |
| 46 }; |
| 47 |
| 48 } // namespace browser_sync |
| 49 |
| 50 #endif // CHROME_BROWSER_SYNC_JS_TRANSACTION_OBSERVER_H_ |
OLD | NEW |