| 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 "chrome/browser/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "chrome/browser/signin/token_service.h" | 37 #include "chrome/browser/signin/token_service.h" |
| 38 #include "chrome/browser/signin/token_service_factory.h" | 38 #include "chrome/browser/signin/token_service_factory.h" |
| 39 #include "chrome/browser/sync/backend_migrator.h" | 39 #include "chrome/browser/sync/backend_migrator.h" |
| 40 #include "chrome/browser/sync/glue/change_processor.h" | 40 #include "chrome/browser/sync/glue/change_processor.h" |
| 41 #include "chrome/browser/sync/glue/chrome_encryptor.h" | 41 #include "chrome/browser/sync/glue/chrome_encryptor.h" |
| 42 #include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h" | 42 #include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h" |
| 43 #include "chrome/browser/sync/glue/data_type_controller.h" | 43 #include "chrome/browser/sync/glue/data_type_controller.h" |
| 44 #include "chrome/browser/sync/glue/device_info.h" | 44 #include "chrome/browser/sync/glue/device_info.h" |
| 45 #include "chrome/browser/sync/glue/session_data_type_controller.h" | 45 #include "chrome/browser/sync/glue/session_data_type_controller.h" |
| 46 #include "chrome/browser/sync/glue/session_model_associator.h" | 46 #include "chrome/browser/sync/glue/session_model_associator.h" |
| 47 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 48 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" |
| 47 #include "chrome/browser/sync/glue/synced_device_tracker.h" | 49 #include "chrome/browser/sync/glue/synced_device_tracker.h" |
| 48 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" | 50 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" |
| 49 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" | 51 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" |
| 50 #include "chrome/browser/sync/sync_global_error.h" | 52 #include "chrome/browser/sync/sync_global_error.h" |
| 51 #include "chrome/browser/sync/user_selectable_sync_type.h" | 53 #include "chrome/browser/sync/user_selectable_sync_type.h" |
| 52 #include "chrome/browser/ui/browser.h" | 54 #include "chrome/browser/ui/browser.h" |
| 53 #include "chrome/browser/ui/browser_list.h" | 55 #include "chrome/browser/ui/browser_list.h" |
| 54 #include "chrome/browser/ui/browser_window.h" | 56 #include "chrome/browser/ui/browser_window.h" |
| 55 #include "chrome/browser/ui/global_error/global_error_service.h" | 57 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 56 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 58 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 credentials, | 508 credentials, |
| 507 delete_stale_data, | 509 delete_stale_data, |
| 508 scoped_ptr<syncer::SyncManagerFactory>( | 510 scoped_ptr<syncer::SyncManagerFactory>( |
| 509 new syncer::SyncManagerFactory).Pass(), | 511 new syncer::SyncManagerFactory).Pass(), |
| 510 backend_unrecoverable_error_handler.Pass(), | 512 backend_unrecoverable_error_handler.Pass(), |
| 511 &browser_sync::ChromeReportUnrecoverableError); | 513 &browser_sync::ChromeReportUnrecoverableError); |
| 512 } | 514 } |
| 513 | 515 |
| 514 void ProfileSyncService::CreateBackend() { | 516 void ProfileSyncService::CreateBackend() { |
| 515 backend_.reset( | 517 backend_.reset( |
| 516 new SyncBackendHost(profile_->GetDebugName(), | 518 new browser_sync::SyncBackendHostImpl(profile_->GetDebugName(), |
| 517 profile_, sync_prefs_.AsWeakPtr())); | 519 profile_, |
| 520 sync_prefs_.AsWeakPtr())); |
| 518 } | 521 } |
| 519 | 522 |
| 520 bool ProfileSyncService::IsEncryptedDatatypeEnabled() const { | 523 bool ProfileSyncService::IsEncryptedDatatypeEnabled() const { |
| 521 if (encryption_pending()) | 524 if (encryption_pending()) |
| 522 return true; | 525 return true; |
| 523 const syncer::ModelTypeSet preferred_types = GetPreferredDataTypes(); | 526 const syncer::ModelTypeSet preferred_types = GetPreferredDataTypes(); |
| 524 const syncer::ModelTypeSet encrypted_types = GetEncryptedDataTypes(); | 527 const syncer::ModelTypeSet encrypted_types = GetEncryptedDataTypes(); |
| 525 DCHECK(encrypted_types.Has(syncer::PASSWORDS)); | 528 DCHECK(encrypted_types.Has(syncer::PASSWORDS)); |
| 526 return !Intersection(preferred_types, encrypted_types).Empty(); | 529 return !Intersection(preferred_types, encrypted_types).Empty(); |
| 527 } | 530 } |
| (...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2134 NOTREACHED(); | 2137 NOTREACHED(); |
| 2135 #endif | 2138 #endif |
| 2136 } | 2139 } |
| 2137 | 2140 |
| 2138 return signin_->GetAuthenticatedUsername(); | 2141 return signin_->GetAuthenticatedUsername(); |
| 2139 } | 2142 } |
| 2140 | 2143 |
| 2141 WeakHandle<syncer::JsEventHandler> ProfileSyncService::GetJsEventHandler() { | 2144 WeakHandle<syncer::JsEventHandler> ProfileSyncService::GetJsEventHandler() { |
| 2142 return MakeWeakHandle(sync_js_controller_.AsWeakPtr()); | 2145 return MakeWeakHandle(sync_js_controller_.AsWeakPtr()); |
| 2143 } | 2146 } |
| OLD | NEW |