| 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" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 } | 183 } |
| 184 | 184 |
| 185 BookmarkModelAssociator::~BookmarkModelAssociator() { | 185 BookmarkModelAssociator::~BookmarkModelAssociator() { |
| 186 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 186 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void BookmarkModelAssociator::UpdateMobileNodeVisibility() { | 189 void BookmarkModelAssociator::UpdateMobileNodeVisibility() { |
| 190 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 190 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 191 DCHECK(bookmark_model_->IsLoaded()); | 191 DCHECK(bookmark_model_->IsLoaded()); |
| 192 | 192 |
| 193 bookmark_model_->SetMobileFolderVisible( | 193 bookmark_model_->SetPermanentNodeVisibile( |
| 194 BookmarkNode::MOBILE, |
| 194 id_map_.find(bookmark_model_->mobile_node()->id()) != id_map_.end()); | 195 id_map_.find(bookmark_model_->mobile_node()->id()) != id_map_.end()); |
| 195 } | 196 } |
| 196 | 197 |
| 197 bool BookmarkModelAssociator::DisassociateModels(SyncError* error) { | 198 bool BookmarkModelAssociator::DisassociateModels(SyncError* error) { |
| 198 id_map_.clear(); | 199 id_map_.clear(); |
| 199 id_map_inverse_.clear(); | 200 id_map_inverse_.clear(); |
| 200 dirty_associations_sync_ids_.clear(); | 201 dirty_associations_sync_ids_.clear(); |
| 201 return true; | 202 return true; |
| 202 } | 203 } |
| 203 | 204 |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 bool BookmarkModelAssociator::CryptoReadyIfNecessary() { | 617 bool BookmarkModelAssociator::CryptoReadyIfNecessary() { |
| 617 // We only access the cryptographer while holding a transaction. | 618 // We only access the cryptographer while holding a transaction. |
| 618 sync_api::ReadTransaction trans(FROM_HERE, user_share_); | 619 sync_api::ReadTransaction trans(FROM_HERE, user_share_); |
| 619 const syncable::ModelTypeSet& encrypted_types = | 620 const syncable::ModelTypeSet& encrypted_types = |
| 620 sync_api::GetEncryptedTypes(&trans); | 621 sync_api::GetEncryptedTypes(&trans); |
| 621 return encrypted_types.count(syncable::BOOKMARKS) == 0 || | 622 return encrypted_types.count(syncable::BOOKMARKS) == 0 || |
| 622 trans.GetCryptographer()->is_ready(); | 623 trans.GetCryptographer()->is_ready(); |
| 623 } | 624 } |
| 624 | 625 |
| 625 } // namespace browser_sync | 626 } // namespace browser_sync |
| OLD | NEW |