| 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 #include "sync/internal_api/sync_manager_impl.h" | 5 #include "sync/internal_api/sync_manager_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 | 936 |
| 937 void SyncManagerImpl::OnThrottledTypesChanged(ModelTypeSet) {} | 937 void SyncManagerImpl::OnThrottledTypesChanged(ModelTypeSet) {} |
| 938 | 938 |
| 939 void SyncManagerImpl::OnMigrationRequested(ModelTypeSet types) { | 939 void SyncManagerImpl::OnMigrationRequested(ModelTypeSet types) { |
| 940 FOR_EACH_OBSERVER( | 940 FOR_EACH_OBSERVER( |
| 941 SyncManager::Observer, observers_, | 941 SyncManager::Observer, observers_, |
| 942 OnMigrationRequested(types)); | 942 OnMigrationRequested(types)); |
| 943 } | 943 } |
| 944 | 944 |
| 945 void SyncManagerImpl::OnProtocolEvent(const ProtocolEvent& event) { | 945 void SyncManagerImpl::OnProtocolEvent(const ProtocolEvent& event) { |
| 946 protocol_event_buffer_.RecordProtocolEvent(event); |
| 946 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, | 947 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, |
| 947 OnProtocolEvent(event)); | 948 OnProtocolEvent(event)); |
| 948 } | 949 } |
| 949 | 950 |
| 950 void SyncManagerImpl::SetJsEventHandler( | 951 void SyncManagerImpl::SetJsEventHandler( |
| 951 const WeakHandle<JsEventHandler>& event_handler) { | 952 const WeakHandle<JsEventHandler>& event_handler) { |
| 952 js_sync_manager_observer_.SetJsEventHandler(event_handler); | 953 js_sync_manager_observer_.SetJsEventHandler(event_handler); |
| 953 js_mutation_event_observer_.SetJsEventHandler(event_handler); | 954 js_mutation_event_observer_.SetJsEventHandler(event_handler); |
| 954 js_sync_encryption_handler_observer_.SetJsEventHandler(event_handler); | 955 js_sync_encryption_handler_observer_.SetJsEventHandler(event_handler); |
| 955 } | 956 } |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 | 1147 |
| 1147 bool SyncManagerImpl::HasUnsyncedItems() { | 1148 bool SyncManagerImpl::HasUnsyncedItems() { |
| 1148 ReadTransaction trans(FROM_HERE, GetUserShare()); | 1149 ReadTransaction trans(FROM_HERE, GetUserShare()); |
| 1149 return (trans.GetWrappedTrans()->directory()->unsynced_entity_count() != 0); | 1150 return (trans.GetWrappedTrans()->directory()->unsynced_entity_count() != 0); |
| 1150 } | 1151 } |
| 1151 | 1152 |
| 1152 SyncEncryptionHandler* SyncManagerImpl::GetEncryptionHandler() { | 1153 SyncEncryptionHandler* SyncManagerImpl::GetEncryptionHandler() { |
| 1153 return sync_encryption_handler_.get(); | 1154 return sync_encryption_handler_.get(); |
| 1154 } | 1155 } |
| 1155 | 1156 |
| 1157 ScopedVector<syncer::ProtocolEvent> |
| 1158 SyncManagerImpl::GetBufferedProtocolEvents() { |
| 1159 return protocol_event_buffer_.GetBufferedProtocolEvents(); |
| 1160 } |
| 1161 |
| 1156 // static. | 1162 // static. |
| 1157 int SyncManagerImpl::GetDefaultNudgeDelay() { | 1163 int SyncManagerImpl::GetDefaultNudgeDelay() { |
| 1158 return kDefaultNudgeDelayMilliseconds; | 1164 return kDefaultNudgeDelayMilliseconds; |
| 1159 } | 1165 } |
| 1160 | 1166 |
| 1161 // static. | 1167 // static. |
| 1162 int SyncManagerImpl::GetPreferencesNudgeDelay() { | 1168 int SyncManagerImpl::GetPreferencesNudgeDelay() { |
| 1163 return kPreferencesNudgeDelayMilliseconds; | 1169 return kPreferencesNudgeDelayMilliseconds; |
| 1164 } | 1170 } |
| 1165 | 1171 |
| 1166 } // namespace syncer | 1172 } // namespace syncer |
| OLD | NEW |