| 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/theme_model_associator.h" | 5 #include "chrome/browser/sync/glue/theme_model_associator.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/location.h" |
| 8 #include "base/logging.h" | 9 #include "base/logging.h" |
| 9 #include "base/tracked.h" | |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/sync/api/sync_error.h" | 11 #include "chrome/browser/sync/api/sync_error.h" |
| 12 #include "chrome/browser/sync/glue/sync_backend_host.h" | 12 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 13 #include "chrome/browser/sync/glue/theme_util.h" | 13 #include "chrome/browser/sync/glue/theme_util.h" |
| 14 #include "chrome/browser/sync/internal_api/read_node.h" | 14 #include "chrome/browser/sync/internal_api/read_node.h" |
| 15 #include "chrome/browser/sync/internal_api/read_transaction.h" | 15 #include "chrome/browser/sync/internal_api/read_transaction.h" |
| 16 #include "chrome/browser/sync/internal_api/write_node.h" | 16 #include "chrome/browser/sync/internal_api/write_node.h" |
| 17 #include "chrome/browser/sync/internal_api/write_transaction.h" | 17 #include "chrome/browser/sync/internal_api/write_transaction.h" |
| 18 #include "chrome/browser/sync/profile_sync_service.h" | 18 #include "chrome/browser/sync/profile_sync_service.h" |
| 19 #include "chrome/browser/sync/protocol/theme_specifics.pb.h" | 19 #include "chrome/browser/sync/protocol/theme_specifics.pb.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 bool ThemeModelAssociator::CryptoReadyIfNecessary() { | 103 bool ThemeModelAssociator::CryptoReadyIfNecessary() { |
| 104 // We only access the cryptographer while holding a transaction. | 104 // We only access the cryptographer while holding a transaction. |
| 105 sync_api::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); | 105 sync_api::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); |
| 106 syncable::ModelTypeSet encrypted_types; | 106 syncable::ModelTypeSet encrypted_types; |
| 107 encrypted_types = sync_api::GetEncryptedTypes(&trans); | 107 encrypted_types = sync_api::GetEncryptedTypes(&trans); |
| 108 return encrypted_types.count(syncable::THEMES) == 0 || | 108 return encrypted_types.count(syncable::THEMES) == 0 || |
| 109 sync_service_->IsCryptographerReady(&trans); | 109 sync_service_->IsCryptographerReady(&trans); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace browser_sync | 112 } // namespace browser_sync |
| OLD | NEW |