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

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

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 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 285
286 void AddObserver(BookmarkModelObserver* observer); 286 void AddObserver(BookmarkModelObserver* observer);
287 void RemoveObserver(BookmarkModelObserver* observer); 287 void RemoveObserver(BookmarkModelObserver* observer);
288 288
289 // Notifies the observers that an extensive set of changes is about to happen, 289 // Notifies the observers that an extensive set of changes is about to happen,
290 // such as during import or sync, so they can delay any expensive UI updates 290 // such as during import or sync, so they can delay any expensive UI updates
291 // until it's finished. 291 // until it's finished.
292 void BeginExtensiveChanges(); 292 void BeginExtensiveChanges();
293 void EndExtensiveChanges(); 293 void EndExtensiveChanges();
294 294
295 // Notifies the observers that a set of changes initiated by a single user
296 // action is about to happen and has completed.
297 void BeginGroupedChanges();
sky 2014/02/06 17:48:27 Can you make these private and the only way to use
Tom Cassiotis 2014/02/21 17:51:45 Done.
298 void EndGroupedChanges();
299
295 // Returns true if this bookmark model is currently in a mode where extensive 300 // Returns true if this bookmark model is currently in a mode where extensive
296 // changes might happen, such as for import and sync. This is helpful for 301 // changes might happen, such as for import and sync. This is helpful for
297 // observers that are created after the mode has started, and want to check 302 // observers that are created after the mode has started, and want to check
298 // state during their own initializer, such as the NTP. 303 // state during their own initializer, such as the NTP.
299 bool IsDoingExtensiveChanges() const { return extensive_changes_ > 0; } 304 bool IsDoingExtensiveChanges() const { return extensive_changes_ > 0; }
300 305
301 // Removes the node at the given |index| from |parent|. Removing a folder node 306 // Removes the node at the given |index| from |parent|. Removing a folder node
302 // recursively removes all nodes. Observers are notified immediately. 307 // recursively removes all nodes. Observers are notified immediately.
303 void Remove(const BookmarkNode* parent, int index); 308 void Remove(const BookmarkNode* parent, int index);
304 309
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 576
572 // See description of IsDoingExtensiveChanges above. 577 // See description of IsDoingExtensiveChanges above.
573 int extensive_changes_; 578 int extensive_changes_;
574 579
575 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; 580 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_;
576 581
577 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); 582 DISALLOW_COPY_AND_ASSIGN(BookmarkModel);
578 }; 583 };
579 584
580 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ 585 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698