OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/bookmarks/browser/bookmark_model.h" | 5 #include "components/bookmarks/browser/bookmark_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, | 456 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, |
457 BookmarkMetaInfoChanged(this, node)); | 457 BookmarkMetaInfoChanged(this, node)); |
458 } | 458 } |
459 | 459 |
460 void BookmarkModel::AddNonClonedKey(const std::string& key) { | 460 void BookmarkModel::AddNonClonedKey(const std::string& key) { |
461 non_cloned_keys_.insert(key); | 461 non_cloned_keys_.insert(key); |
462 } | 462 } |
463 | 463 |
464 void BookmarkModel::SetNodeSyncTransactionVersion( | 464 void BookmarkModel::SetNodeSyncTransactionVersion( |
465 const BookmarkNode* node, | 465 const BookmarkNode* node, |
466 int64 sync_transaction_version) { | 466 int64_t sync_transaction_version) { |
467 DCHECK(client_->CanSyncNode(node)); | 467 DCHECK(client_->CanSyncNode(node)); |
468 | 468 |
469 if (sync_transaction_version == node->sync_transaction_version()) | 469 if (sync_transaction_version == node->sync_transaction_version()) |
470 return; | 470 return; |
471 | 471 |
472 AsMutable(node)->set_sync_transaction_version(sync_transaction_version); | 472 AsMutable(node)->set_sync_transaction_version(sync_transaction_version); |
473 if (store_.get()) | 473 if (store_.get()) |
474 store_->ScheduleSave(); | 474 store_->ScheduleSave(); |
475 } | 475 } |
476 | 476 |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 | 1082 |
1083 void BookmarkModel::PopulateNodesByURL(BookmarkNode* node) { | 1083 void BookmarkModel::PopulateNodesByURL(BookmarkNode* node) { |
1084 // NOTE: this is called with url_lock_ already held. As such, this doesn't | 1084 // NOTE: this is called with url_lock_ already held. As such, this doesn't |
1085 // explicitly grab the lock. | 1085 // explicitly grab the lock. |
1086 if (node->is_url()) | 1086 if (node->is_url()) |
1087 nodes_ordered_by_url_set_.insert(node); | 1087 nodes_ordered_by_url_set_.insert(node); |
1088 for (int i = 0; i < node->child_count(); ++i) | 1088 for (int i = 0; i < node->child_count(); ++i) |
1089 PopulateNodesByURL(node->GetChild(i)); | 1089 PopulateNodesByURL(node->GetChild(i)); |
1090 } | 1090 } |
1091 | 1091 |
1092 int64 BookmarkModel::generate_next_node_id() { | 1092 int64_t BookmarkModel::generate_next_node_id() { |
1093 return next_node_id_++; | 1093 return next_node_id_++; |
1094 } | 1094 } |
1095 | 1095 |
1096 scoped_ptr<BookmarkLoadDetails> BookmarkModel::CreateLoadDetails( | 1096 scoped_ptr<BookmarkLoadDetails> BookmarkModel::CreateLoadDetails( |
1097 const std::string& accept_languages) { | 1097 const std::string& accept_languages) { |
1098 BookmarkPermanentNode* bb_node = | 1098 BookmarkPermanentNode* bb_node = |
1099 CreatePermanentNode(BookmarkNode::BOOKMARK_BAR); | 1099 CreatePermanentNode(BookmarkNode::BOOKMARK_BAR); |
1100 BookmarkPermanentNode* other_node = | 1100 BookmarkPermanentNode* other_node = |
1101 CreatePermanentNode(BookmarkNode::OTHER_NODE); | 1101 CreatePermanentNode(BookmarkNode::OTHER_NODE); |
1102 BookmarkPermanentNode* mobile_node = | 1102 BookmarkPermanentNode* mobile_node = |
(...skipping 11 matching lines...) Expand all Loading... |
1114 undo_delegate_ = undo_delegate; | 1114 undo_delegate_ = undo_delegate; |
1115 if (undo_delegate_) | 1115 if (undo_delegate_) |
1116 undo_delegate_->SetUndoProvider(this); | 1116 undo_delegate_->SetUndoProvider(this); |
1117 } | 1117 } |
1118 | 1118 |
1119 BookmarkUndoDelegate* BookmarkModel::undo_delegate() const { | 1119 BookmarkUndoDelegate* BookmarkModel::undo_delegate() const { |
1120 return undo_delegate_ ? undo_delegate_ : empty_undo_delegate_.get(); | 1120 return undo_delegate_ ? undo_delegate_ : empty_undo_delegate_.get(); |
1121 } | 1121 } |
1122 | 1122 |
1123 } // namespace bookmarks | 1123 } // namespace bookmarks |
OLD | NEW |