| 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/bookmark_model_associator.h" | 5 #include "chrome/browser/sync/glue/bookmark_model_associator.h" |
| 6 | 6 |
| 7 #include <stack> | 7 #include <stack> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "base/task.h" | 12 #include "base/task.h" |
| 13 #include "base/tracked.h" | 13 #include "base/tracked.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/browser/bookmarks/bookmark_model.h" | 15 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/sync/api/sync_error.h" | 17 #include "chrome/browser/sync/api/sync_error.h" |
| 18 #include "chrome/browser/sync/engine/nigori_util.h" | 18 #include "chrome/browser/sync/engine/nigori_util.h" |
| 19 #include "chrome/browser/sync/engine/syncapi.h" | |
| 20 #include "chrome/browser/sync/glue/bookmark_change_processor.h" | 19 #include "chrome/browser/sync/glue/bookmark_change_processor.h" |
| 20 #include "chrome/browser/sync/internal_api/read_node.h" |
| 21 #include "chrome/browser/sync/internal_api/read_transaction.h" |
| 22 #include "chrome/browser/sync/internal_api/syncapi_functions.h" |
| 23 #include "chrome/browser/sync/internal_api/write_node.h" |
| 24 #include "chrome/browser/sync/internal_api/write_transaction.h" |
| 21 #include "chrome/browser/sync/util/cryptographer.h" | 25 #include "chrome/browser/sync/util/cryptographer.h" |
| 22 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
| 23 #include "content/browser/browser_thread.h" | 27 #include "content/browser/browser_thread.h" |
| 24 | 28 |
| 25 namespace browser_sync { | 29 namespace browser_sync { |
| 26 | 30 |
| 27 // The sync protocol identifies top-level entities by means of well-known tags, | 31 // The sync protocol identifies top-level entities by means of well-known tags, |
| 28 // which should not be confused with titles. Each tag corresponds to a | 32 // which should not be confused with titles. Each tag corresponds to a |
| 29 // singleton instance of a particular top-level node in a user's share; the | 33 // singleton instance of a particular top-level node in a user's share; the |
| 30 // tags are consistent across users. The tags allow us to locate the specific | 34 // tags are consistent across users. The tags allow us to locate the specific |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 bool BookmarkModelAssociator::CryptoReadyIfNecessary() { | 606 bool BookmarkModelAssociator::CryptoReadyIfNecessary() { |
| 603 // We only access the cryptographer while holding a transaction. | 607 // We only access the cryptographer while holding a transaction. |
| 604 sync_api::ReadTransaction trans(FROM_HERE, user_share_); | 608 sync_api::ReadTransaction trans(FROM_HERE, user_share_); |
| 605 const syncable::ModelTypeSet& encrypted_types = | 609 const syncable::ModelTypeSet& encrypted_types = |
| 606 sync_api::GetEncryptedTypes(&trans); | 610 sync_api::GetEncryptedTypes(&trans); |
| 607 return encrypted_types.count(syncable::BOOKMARKS) == 0 || | 611 return encrypted_types.count(syncable::BOOKMARKS) == 0 || |
| 608 trans.GetCryptographer()->is_ready(); | 612 trans.GetCryptographer()->is_ready(); |
| 609 } | 613 } |
| 610 | 614 |
| 611 } // namespace browser_sync | 615 } // namespace browser_sync |
| OLD | NEW |