| 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 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
| 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 bool is_root_node(const BookmarkNode* node) const { return node == &root_; } | 107 bool is_root_node(const BookmarkNode* node) const { return node == &root_; } |
| 108 | 108 |
| 109 // Returns whether the given |node| is one of the permanent nodes - root node, | 109 // Returns whether the given |node| is one of the permanent nodes - root node, |
| 110 // 'bookmark bar' node, 'other' node or 'mobile' node, or one of the root | 110 // 'bookmark bar' node, 'other' node or 'mobile' node, or one of the root |
| 111 // nodes supplied by the |client_|. | 111 // nodes supplied by the |client_|. |
| 112 bool is_permanent_node(const BookmarkNode* node) const { | 112 bool is_permanent_node(const BookmarkNode* node) const { |
| 113 return node && (node == &root_ || node->parent() == &root_); | 113 return node && (node == &root_ || node->parent() == &root_); |
| 114 } | 114 } |
| 115 | 115 |
| 116 // Returns the parent the last node was added to. This never returns NULL | |
| 117 // (as long as the model is loaded). | |
| 118 const BookmarkNode* GetParentForNewNodes(); | |
| 119 | |
| 120 void AddObserver(BookmarkModelObserver* observer); | 116 void AddObserver(BookmarkModelObserver* observer); |
| 121 void RemoveObserver(BookmarkModelObserver* observer); | 117 void RemoveObserver(BookmarkModelObserver* observer); |
| 122 | 118 |
| 123 // Notifies the observers that an extensive set of changes is about to happen, | 119 // Notifies the observers that an extensive set of changes is about to happen, |
| 124 // such as during import or sync, so they can delay any expensive UI updates | 120 // such as during import or sync, so they can delay any expensive UI updates |
| 125 // until it's finished. | 121 // until it's finished. |
| 126 void BeginExtensiveChanges(); | 122 void BeginExtensiveChanges(); |
| 127 void EndExtensiveChanges(); | 123 void EndExtensiveChanges(); |
| 128 | 124 |
| 129 // Returns true if this bookmark model is currently in a mode where extensive | 125 // Returns true if this bookmark model is currently in a mode where extensive |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 463 |
| 468 BookmarkUndoDelegate* undo_delegate_; | 464 BookmarkUndoDelegate* undo_delegate_; |
| 469 std::unique_ptr<BookmarkUndoDelegate> empty_undo_delegate_; | 465 std::unique_ptr<BookmarkUndoDelegate> empty_undo_delegate_; |
| 470 | 466 |
| 471 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 467 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
| 472 }; | 468 }; |
| 473 | 469 |
| 474 } // namespace bookmarks | 470 } // namespace bookmarks |
| 475 | 471 |
| 476 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 472 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
| OLD | NEW |