Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: chrome/browser/bookmarks/bookmark_model.cc

Issue 155913004: Eliminate Bookmarks dependence to bookmark_undo_utils.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: All grouped action to notify BookmarkModelObservers Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
287 void BookmarkModel::Remove(const BookmarkNode* parent, int index) { 297 void BookmarkModel::Remove(const BookmarkNode* parent, int index) {
288 if (!loaded_ || !IsValidIndex(parent, index, false) || is_root_node(parent)) { 298 if (!loaded_ || !IsValidIndex(parent, index, false) || is_root_node(parent)) {
289 NOTREACHED(); 299 NOTREACHED();
290 return; 300 return;
291 } 301 }
292 RemoveAndDeleteNode(AsMutable(parent->GetChild(index))); 302 RemoveAndDeleteNode(AsMutable(parent->GetChild(index)));
293 } 303 }
294 304
295 void BookmarkModel::RemoveAll() { 305 void BookmarkModel::RemoveAll() {
296 std::set<GURL> removed_urls; 306 std::set<GURL> removed_urls;
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 BookmarkPermanentNode* bb_node = 1083 BookmarkPermanentNode* bb_node =
1074 CreatePermanentNode(BookmarkNode::BOOKMARK_BAR); 1084 CreatePermanentNode(BookmarkNode::BOOKMARK_BAR);
1075 BookmarkPermanentNode* other_node = 1085 BookmarkPermanentNode* other_node =
1076 CreatePermanentNode(BookmarkNode::OTHER_NODE); 1086 CreatePermanentNode(BookmarkNode::OTHER_NODE);
1077 BookmarkPermanentNode* mobile_node = 1087 BookmarkPermanentNode* mobile_node =
1078 CreatePermanentNode(BookmarkNode::MOBILE); 1088 CreatePermanentNode(BookmarkNode::MOBILE);
1079 return new BookmarkLoadDetails(bb_node, other_node, mobile_node, 1089 return new BookmarkLoadDetails(bb_node, other_node, mobile_node,
1080 new BookmarkIndex(profile_), 1090 new BookmarkIndex(profile_),
1081 next_node_id_); 1091 next_node_id_);
1082 } 1092 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698