| 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/session_model_associator.h" | 5 #include "chrome/browser/sync/glue/session_model_associator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/tracked.h" | 12 #include "base/tracked.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/sessions/session_service_factory.h" | 14 #include "chrome/browser/sessions/session_service_factory.h" |
| 15 #include "chrome/browser/sync/api/sync_error.h" | 15 #include "chrome/browser/sync/api/sync_error.h" |
| 16 #include "chrome/browser/sync/glue/synced_tab_delegate.h" | 16 #include "chrome/browser/sync/glue/synced_tab_delegate.h" |
| 17 #include "chrome/browser/sync/glue/synced_window_delegate.h" | 17 #include "chrome/browser/sync/glue/synced_window_delegate.h" |
| 18 #include "chrome/browser/sync/internal_api/read_node.h" |
| 19 #include "chrome/browser/sync/internal_api/read_transaction.h" |
| 20 #include "chrome/browser/sync/internal_api/write_node.h" |
| 21 #include "chrome/browser/sync/internal_api/write_transaction.h" |
| 18 #include "chrome/browser/sync/profile_sync_service.h" | 22 #include "chrome/browser/sync/profile_sync_service.h" |
| 19 #include "chrome/browser/sync/syncable/syncable.h" | 23 #include "chrome/browser/sync/syncable/syncable.h" |
| 20 #include "chrome/common/chrome_notification_types.h" | 24 #include "chrome/common/chrome_notification_types.h" |
| 21 #include "chrome/common/url_constants.h" | 25 #include "chrome/common/url_constants.h" |
| 22 #include "content/browser/tab_contents/navigation_entry.h" | 26 #include "content/browser/tab_contents/navigation_entry.h" |
| 23 #include "content/common/notification_details.h" | 27 #include "content/common/notification_details.h" |
| 24 #include "content/common/notification_service.h" | 28 #include "content/common/notification_service.h" |
| 25 | 29 |
| 26 namespace browser_sync { | 30 namespace browser_sync { |
| 27 | 31 |
| (...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 bool SessionModelAssociator::CryptoReadyIfNecessary() { | 1056 bool SessionModelAssociator::CryptoReadyIfNecessary() { |
| 1053 // We only access the cryptographer while holding a transaction. | 1057 // We only access the cryptographer while holding a transaction. |
| 1054 sync_api::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); | 1058 sync_api::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); |
| 1055 syncable::ModelTypeSet encrypted_types; | 1059 syncable::ModelTypeSet encrypted_types; |
| 1056 encrypted_types = sync_api::GetEncryptedTypes(&trans); | 1060 encrypted_types = sync_api::GetEncryptedTypes(&trans); |
| 1057 return encrypted_types.count(syncable::SESSIONS) == 0 || | 1061 return encrypted_types.count(syncable::SESSIONS) == 0 || |
| 1058 sync_service_->IsCryptographerReady(&trans); | 1062 sync_service_->IsCryptographerReady(&trans); |
| 1059 } | 1063 } |
| 1060 | 1064 |
| 1061 } // namespace browser_sync | 1065 } // namespace browser_sync |
| OLD | NEW |