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/bookmarks/bookmark_model.h" | 5 #include "chrome/browser/bookmarks/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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 | 277 |
278 void BookmarkModel::EndExtensiveChanges() { | 278 void BookmarkModel::EndExtensiveChanges() { |
279 --extensive_changes_; | 279 --extensive_changes_; |
280 DCHECK_GE(extensive_changes_, 0); | 280 DCHECK_GE(extensive_changes_, 0); |
281 if (extensive_changes_ == 0) { | 281 if (extensive_changes_ == 0) { |
282 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, | 282 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, |
283 ExtensiveBookmarkChangesEnded(this)); | 283 ExtensiveBookmarkChangesEnded(this)); |
284 } | 284 } |
285 } | 285 } |
286 | 286 |
287 void BookmarkModel::BeginGroupedChanges() { | |
288 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, | |
289 GroupedBookmarkChangesBeginning(this)); | |
290 } | |
291 | |
292 void BookmarkModel::EndGroupedChanges() { | |
293 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, | |
294 GroupedBookmarkChangesEnded(this)); | |
295 } | |
296 | |
297 void BookmarkModel::Remove(const BookmarkNode* parent, int index) { | 287 void BookmarkModel::Remove(const BookmarkNode* parent, int index) { |
298 if (!loaded_ || !IsValidIndex(parent, index, false) || is_root_node(parent)) { | 288 if (!loaded_ || !IsValidIndex(parent, index, false) || is_root_node(parent)) { |
299 NOTREACHED(); | 289 NOTREACHED(); |
300 return; | 290 return; |
301 } | 291 } |
302 RemoveAndDeleteNode(AsMutable(parent->GetChild(index))); | 292 RemoveAndDeleteNode(AsMutable(parent->GetChild(index))); |
303 } | 293 } |
304 | 294 |
305 void BookmarkModel::RemoveAll() { | 295 void BookmarkModel::RemoveAll() { |
306 std::set<GURL> removed_urls; | 296 std::set<GURL> removed_urls; |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 BookmarkPermanentNode* bb_node = | 1073 BookmarkPermanentNode* bb_node = |
1084 CreatePermanentNode(BookmarkNode::BOOKMARK_BAR); | 1074 CreatePermanentNode(BookmarkNode::BOOKMARK_BAR); |
1085 BookmarkPermanentNode* other_node = | 1075 BookmarkPermanentNode* other_node = |
1086 CreatePermanentNode(BookmarkNode::OTHER_NODE); | 1076 CreatePermanentNode(BookmarkNode::OTHER_NODE); |
1087 BookmarkPermanentNode* mobile_node = | 1077 BookmarkPermanentNode* mobile_node = |
1088 CreatePermanentNode(BookmarkNode::MOBILE); | 1078 CreatePermanentNode(BookmarkNode::MOBILE); |
1089 return new BookmarkLoadDetails(bb_node, other_node, mobile_node, | 1079 return new BookmarkLoadDetails(bb_node, other_node, mobile_node, |
1090 new BookmarkIndex(profile_), | 1080 new BookmarkIndex(profile_), |
1091 next_node_id_); | 1081 next_node_id_); |
1092 } | 1082 } |
OLD | NEW |