| 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/app_model_associator.h" | 5 #include "chrome/browser/sync/glue/app_model_associator.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/tracked.h" | 8 #include "base/tracked.h" |
| 9 #include "chrome/browser/extensions/extension_sync_data.h" | 9 #include "chrome/browser/extensions/extension_sync_data.h" |
| 10 #include "chrome/browser/sync/api/sync_error.h" | 10 #include "chrome/browser/sync/api/sync_error.h" |
| 11 #include "chrome/browser/sync/engine/nigori_util.h" | 11 #include "chrome/browser/sync/engine/nigori_util.h" |
| 12 #include "chrome/browser/sync/engine/syncapi.h" | 12 #include "chrome/browser/sync/glue/extension_sync.h" |
| 13 #include "chrome/browser/sync/glue/extension_sync_traits.h" | 13 #include "chrome/browser/sync/glue/extension_sync_traits.h" |
| 14 #include "chrome/browser/sync/glue/extension_sync.h" | 14 #include "chrome/browser/sync/internal_api/read_transaction.h" |
| 15 #include "chrome/browser/sync/internal_api/syncapi_functions.h" |
| 15 #include "chrome/browser/sync/profile_sync_service.h" | 16 #include "chrome/browser/sync/profile_sync_service.h" |
| 16 #include "chrome/browser/sync/protocol/extension_specifics.pb.h" | 17 #include "chrome/browser/sync/protocol/extension_specifics.pb.h" |
| 17 #include "content/browser/browser_thread.h" | 18 #include "content/browser/browser_thread.h" |
| 18 | 19 |
| 19 namespace browser_sync { | 20 namespace browser_sync { |
| 20 | 21 |
| 21 AppModelAssociator::AppModelAssociator( | 22 AppModelAssociator::AppModelAssociator( |
| 22 ExtensionServiceInterface* extension_service, | 23 ExtensionServiceInterface* extension_service, |
| 23 sync_api::UserShare* user_share) | 24 sync_api::UserShare* user_share) |
| 24 : traits_(GetAppSyncTraits()), extension_service_(extension_service), | 25 : traits_(GetAppSyncTraits()), extension_service_(extension_service), |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 bool AppModelAssociator::CryptoReadyIfNecessary() { | 69 bool AppModelAssociator::CryptoReadyIfNecessary() { |
| 69 // We only access the cryptographer while holding a transaction. | 70 // We only access the cryptographer while holding a transaction. |
| 70 sync_api::ReadTransaction trans(FROM_HERE, user_share_); | 71 sync_api::ReadTransaction trans(FROM_HERE, user_share_); |
| 71 const syncable::ModelTypeSet& encrypted_types = | 72 const syncable::ModelTypeSet& encrypted_types = |
| 72 sync_api::GetEncryptedTypes(&trans); | 73 sync_api::GetEncryptedTypes(&trans); |
| 73 return encrypted_types.count(traits_.model_type) == 0 || | 74 return encrypted_types.count(traits_.model_type) == 0 || |
| 74 trans.GetCryptographer()->is_ready(); | 75 trans.GetCryptographer()->is_ready(); |
| 75 } | 76 } |
| 76 | 77 |
| 77 } // namespace browser_sync | 78 } // namespace browser_sync |
| OLD | NEW |