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/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/bind.h" | 11 #include "base/bind.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/threading/sequenced_worker_pool.h" | 15 #include "base/threading/sequenced_worker_pool.h" |
16 #include "chrome/browser/history/history.h" | 16 #include "chrome/browser/history/history.h" |
17 #include "chrome/browser/prefs/pref_service.h" | 17 #include "chrome/browser/prefs/pref_service.h" |
18 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/browser/sessions/session_id.h" | 19 #include "chrome/browser/sessions/session_id.h" |
20 #include "chrome/browser/sync/api/sync_error.h" | 20 #include "chrome/browser/sync/api/sync_error.h" |
21 #include "chrome/browser/sync/glue/synced_session.h" | 21 #include "chrome/browser/sync/glue/synced_session.h" |
22 #include "chrome/browser/sync/glue/synced_tab_delegate.h" | 22 #include "chrome/browser/sync/glue/synced_tab_delegate.h" |
23 #include "chrome/browser/sync/glue/synced_window_delegate.h" | 23 #include "chrome/browser/sync/glue/synced_window_delegate.h" |
24 #include "chrome/browser/sync/internal_api/read_node.h" | |
25 #include "chrome/browser/sync/internal_api/read_transaction.h" | |
26 #include "chrome/browser/sync/internal_api/write_node.h" | |
27 #include "chrome/browser/sync/internal_api/write_transaction.h" | |
28 #include "chrome/browser/sync/profile_sync_service.h" | 24 #include "chrome/browser/sync/profile_sync_service.h" |
29 #include "chrome/common/chrome_notification_types.h" | 25 #include "chrome/common/chrome_notification_types.h" |
30 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
31 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
32 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
33 #include "content/public/browser/navigation_entry.h" | 29 #include "content/public/browser/navigation_entry.h" |
34 #include "content/public/browser/notification_details.h" | 30 #include "content/public/browser/notification_details.h" |
35 #include "content/public/browser/notification_service.h" | 31 #include "content/public/browser/notification_service.h" |
| 32 #include "sync/internal_api/read_node.h" |
| 33 #include "sync/internal_api/read_transaction.h" |
| 34 #include "sync/internal_api/write_node.h" |
| 35 #include "sync/internal_api/write_transaction.h" |
36 #include "sync/protocol/session_specifics.pb.h" | 36 #include "sync/protocol/session_specifics.pb.h" |
37 #include "sync/syncable/syncable.h" | |
38 #include "sync/syncable/model_type.h" | 37 #include "sync/syncable/model_type.h" |
39 #include "sync/syncable/model_type_payload_map.h" | 38 #include "sync/syncable/model_type_payload_map.h" |
| 39 #include "sync/syncable/syncable.h" |
40 #include "sync/util/get_session_name.h" | 40 #include "sync/util/get_session_name.h" |
41 #if defined(OS_LINUX) | 41 #if defined(OS_LINUX) |
42 #include "base/linux_util.h" | 42 #include "base/linux_util.h" |
43 #elif defined(OS_WIN) | 43 #elif defined(OS_WIN) |
44 #include <windows.h> | 44 #include <windows.h> |
45 #elif defined(OS_ANDROID) | 45 #elif defined(OS_ANDROID) |
46 #include "sync/util/session_utils_android.h" | 46 #include "sync/util/session_utils_android.h" |
47 #endif | 47 #endif |
48 | 48 |
49 using content::BrowserThread; | 49 using content::BrowserThread; |
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 bool SessionModelAssociator::CryptoReadyIfNecessary() { | 1452 bool SessionModelAssociator::CryptoReadyIfNecessary() { |
1453 // We only access the cryptographer while holding a transaction. | 1453 // We only access the cryptographer while holding a transaction. |
1454 sync_api::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); | 1454 sync_api::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); |
1455 const syncable::ModelTypeSet encrypted_types = | 1455 const syncable::ModelTypeSet encrypted_types = |
1456 sync_api::GetEncryptedTypes(&trans); | 1456 sync_api::GetEncryptedTypes(&trans); |
1457 return !encrypted_types.Has(SESSIONS) || | 1457 return !encrypted_types.Has(SESSIONS) || |
1458 sync_service_->IsCryptographerReady(&trans); | 1458 sync_service_->IsCryptographerReady(&trans); |
1459 } | 1459 } |
1460 | 1460 |
1461 } // namespace browser_sync | 1461 } // namespace browser_sync |
OLD | NEW |