| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_registrar.h" | 5 #include "chrome/browser/sync/glue/sync_backend_registrar.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "chrome/browser/password_manager/password_store_factory.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/sync/engine/passive_model_worker.h" | 14 #include "chrome/browser/sync/engine/passive_model_worker.h" |
| 14 #include "chrome/browser/sync/glue/browser_thread_model_worker.h" | 15 #include "chrome/browser/sync/glue/browser_thread_model_worker.h" |
| 15 #include "chrome/browser/sync/glue/change_processor.h" | 16 #include "chrome/browser/sync/glue/change_processor.h" |
| 16 #include "chrome/browser/sync/glue/history_model_worker.h" | 17 #include "chrome/browser/sync/glue/history_model_worker.h" |
| 17 #include "chrome/browser/sync/glue/password_model_worker.h" | 18 #include "chrome/browser/sync/glue/password_model_worker.h" |
| 18 #include "chrome/browser/sync/glue/ui_model_worker.h" | 19 #include "chrome/browser/sync/glue/ui_model_worker.h" |
| 19 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
| 20 | 21 |
| 21 using content::BrowserThread; | 22 using content::BrowserThread; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 Profile::IMPLICIT_ACCESS); | 81 Profile::IMPLICIT_ACCESS); |
| 81 if (history_service) { | 82 if (history_service) { |
| 82 workers_[GROUP_HISTORY] = new HistoryModelWorker(history_service); | 83 workers_[GROUP_HISTORY] = new HistoryModelWorker(history_service); |
| 83 } else { | 84 } else { |
| 84 LOG_IF(WARNING, initial_types.Has(syncable::TYPED_URLS)) | 85 LOG_IF(WARNING, initial_types.Has(syncable::TYPED_URLS)) |
| 85 << "History store disabled, cannot sync Omnibox History"; | 86 << "History store disabled, cannot sync Omnibox History"; |
| 86 routing_info_.erase(syncable::TYPED_URLS); | 87 routing_info_.erase(syncable::TYPED_URLS); |
| 87 } | 88 } |
| 88 | 89 |
| 89 PasswordStore* password_store = | 90 PasswordStore* password_store = |
| 90 profile->GetPasswordStore(Profile::IMPLICIT_ACCESS); | 91 PasswordStoreFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS); |
| 91 if (password_store) { | 92 if (password_store) { |
| 92 workers_[GROUP_PASSWORD] = new PasswordModelWorker(password_store); | 93 workers_[GROUP_PASSWORD] = new PasswordModelWorker(password_store); |
| 93 } else { | 94 } else { |
| 94 LOG_IF(WARNING, initial_types.Has(syncable::PASSWORDS)) | 95 LOG_IF(WARNING, initial_types.Has(syncable::PASSWORDS)) |
| 95 << "Password store not initialized, cannot sync passwords"; | 96 << "Password store not initialized, cannot sync passwords"; |
| 96 routing_info_.erase(syncable::PASSWORDS); | 97 routing_info_.erase(syncable::PASSWORDS); |
| 97 } | 98 } |
| 98 } | 99 } |
| 99 | 100 |
| 100 SyncBackendRegistrar::~SyncBackendRegistrar() { | 101 SyncBackendRegistrar::~SyncBackendRegistrar() { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 return it->second; | 279 return it->second; |
| 279 } | 280 } |
| 280 | 281 |
| 281 bool SyncBackendRegistrar::IsCurrentThreadSafeForModel( | 282 bool SyncBackendRegistrar::IsCurrentThreadSafeForModel( |
| 282 syncable::ModelType model_type) const { | 283 syncable::ModelType model_type) const { |
| 283 lock_.AssertAcquired(); | 284 lock_.AssertAcquired(); |
| 284 return IsOnThreadForGroup(GetGroupForModelType(model_type, routing_info_)); | 285 return IsOnThreadForGroup(GetGroupForModelType(model_type, routing_info_)); |
| 285 } | 286 } |
| 286 | 287 |
| 287 } // namespace browser_sync | 288 } // namespace browser_sync |
| OLD | NEW |