| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/sync/glue/sync_backend_host_impl.h" | 5 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/invalidation/invalidation_service.h" | 9 #include "chrome/browser/invalidation/invalidation_service.h" |
| 10 #include "chrome/browser/invalidation/invalidation_service_factory.h" | 10 #include "chrome/browser/invalidation/invalidation_service_factory.h" |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 NOTREACHED(); | 468 NOTREACHED(); |
| 469 } | 469 } |
| 470 } | 470 } |
| 471 | 471 |
| 472 SyncedDeviceTracker* SyncBackendHostImpl::GetSyncedDeviceTracker() const { | 472 SyncedDeviceTracker* SyncBackendHostImpl::GetSyncedDeviceTracker() const { |
| 473 if (!initialized()) | 473 if (!initialized()) |
| 474 return NULL; | 474 return NULL; |
| 475 return core_->synced_device_tracker(); | 475 return core_->synced_device_tracker(); |
| 476 } | 476 } |
| 477 | 477 |
| 478 void SyncBackendHostImpl::SetForwardProtocolEvents(bool forward) { | 478 void SyncBackendHostImpl::RequestBufferedProtocolEventsAndEnableForwarding() { |
| 479 DCHECK(initialized()); | 479 DCHECK(initialized()); |
| 480 registrar_->sync_thread()->message_loop()->PostTask( | 480 registrar_->sync_thread()->message_loop()->PostTask( |
| 481 FROM_HERE, | 481 FROM_HERE, |
| 482 base::Bind(&SyncBackendHostCore::SetForwardProtocolEvents, | 482 base::Bind( |
| 483 core_, forward)); | 483 &SyncBackendHostCore::SendBufferedProtocolEventsAndEnableForwarding, |
| 484 core_)); |
| 485 } |
| 486 |
| 487 void SyncBackendHostImpl::DisableProtocolEventForwarding() { |
| 488 DCHECK(initialized()); |
| 489 registrar_->sync_thread()->message_loop()->PostTask( |
| 490 FROM_HERE, |
| 491 base::Bind( |
| 492 &SyncBackendHostCore::DisableProtocolEventForwarding, |
| 493 core_)); |
| 484 } | 494 } |
| 485 | 495 |
| 486 void SyncBackendHostImpl::InitCore(scoped_ptr<DoInitializeOptions> options) { | 496 void SyncBackendHostImpl::InitCore(scoped_ptr<DoInitializeOptions> options) { |
| 487 registrar_->sync_thread()->message_loop()->PostTask(FROM_HERE, | 497 registrar_->sync_thread()->message_loop()->PostTask(FROM_HERE, |
| 488 base::Bind(&SyncBackendHostCore::DoInitialize, | 498 base::Bind(&SyncBackendHostCore::DoInitialize, |
| 489 core_.get(), base::Passed(&options))); | 499 core_.get(), base::Passed(&options))); |
| 490 } | 500 } |
| 491 | 501 |
| 492 void SyncBackendHostImpl::RequestConfigureSyncer( | 502 void SyncBackendHostImpl::RequestConfigureSyncer( |
| 493 syncer::ConfigureReason reason, | 503 syncer::ConfigureReason reason, |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() { | 774 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() { |
| 765 return registrar_->sync_thread()->message_loop(); | 775 return registrar_->sync_thread()->message_loop(); |
| 766 } | 776 } |
| 767 | 777 |
| 768 } // namespace browser_sync | 778 } // namespace browser_sync |
| 769 | 779 |
| 770 #undef SDVLOG | 780 #undef SDVLOG |
| 771 | 781 |
| 772 #undef SLOG | 782 #undef SLOG |
| 773 | 783 |
| OLD | NEW |