| 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_INTERNAL_API_JS_MUTATION_EVENT_OBSERVER_H_ | 5 #ifndef SYNC_INTERNAL_API_JS_MUTATION_EVENT_OBSERVER_H_ |
| 6 #define SYNC_INTERNAL_API_JS_MUTATION_EVENT_OBSERVER_H_ | 6 #define SYNC_INTERNAL_API_JS_MUTATION_EVENT_OBSERVER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 virtual ~JsMutationEventObserver(); | 37 virtual ~JsMutationEventObserver(); |
| 38 | 38 |
| 39 base::WeakPtr<JsMutationEventObserver> AsWeakPtr(); | 39 base::WeakPtr<JsMutationEventObserver> AsWeakPtr(); |
| 40 | 40 |
| 41 void InvalidateWeakPtrs(); | 41 void InvalidateWeakPtrs(); |
| 42 | 42 |
| 43 void SetJsEventHandler(const WeakHandle<JsEventHandler>& event_handler); | 43 void SetJsEventHandler(const WeakHandle<JsEventHandler>& event_handler); |
| 44 | 44 |
| 45 // syncer::SyncManager::ChangeObserver implementation. | 45 // syncer::SyncManager::ChangeObserver implementation. |
| 46 virtual void OnChangesApplied( | 46 virtual void OnChangesApplied( |
| 47 syncable::ModelType model_type, | 47 syncer::ModelType model_type, |
| 48 int64 write_transaction_id, | 48 int64 write_transaction_id, |
| 49 const syncer::ImmutableChangeRecordList& changes) OVERRIDE; | 49 const syncer::ImmutableChangeRecordList& changes) OVERRIDE; |
| 50 virtual void OnChangesComplete(syncable::ModelType model_type) OVERRIDE; | 50 virtual void OnChangesComplete(syncer::ModelType model_type) OVERRIDE; |
| 51 | 51 |
| 52 // syncable::TransactionObserver implementation. | 52 // syncable::TransactionObserver implementation. |
| 53 virtual void OnTransactionWrite( | 53 virtual void OnTransactionWrite( |
| 54 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, | 54 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, |
| 55 syncable::ModelTypeSet models_with_changes) OVERRIDE; | 55 syncer::ModelTypeSet models_with_changes) OVERRIDE; |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 base::WeakPtrFactory<JsMutationEventObserver> weak_ptr_factory_; | 58 base::WeakPtrFactory<JsMutationEventObserver> weak_ptr_factory_; |
| 59 WeakHandle<JsEventHandler> event_handler_; | 59 WeakHandle<JsEventHandler> event_handler_; |
| 60 | 60 |
| 61 void HandleJsEvent( | 61 void HandleJsEvent( |
| 62 const tracked_objects::Location& from_here, | 62 const tracked_objects::Location& from_here, |
| 63 const std::string& name, const JsEventDetails& details); | 63 const std::string& name, const JsEventDetails& details); |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(JsMutationEventObserver); | 65 DISALLOW_COPY_AND_ASSIGN(JsMutationEventObserver); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace syncer | 68 } // namespace syncer |
| 69 | 69 |
| 70 #endif // SYNC_INTERNAL_API_JS_MUTATION_EVENT_OBSERVER_H_ | 70 #endif // SYNC_INTERNAL_API_JS_MUTATION_EVENT_OBSERVER_H_ |
| OLD | NEW |