Chromium Code Reviews| 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 <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 // until it's finished. | 120 // until it's finished. |
| 121 void BeginExtensiveChanges(); | 121 void BeginExtensiveChanges(); |
| 122 void EndExtensiveChanges(); | 122 void EndExtensiveChanges(); |
| 123 | 123 |
| 124 // Returns true if this bookmark model is currently in a mode where extensive | 124 // Returns true if this bookmark model is currently in a mode where extensive |
| 125 // changes might happen, such as for import and sync. This is helpful for | 125 // changes might happen, such as for import and sync. This is helpful for |
| 126 // observers that are created after the mode has started, and want to check | 126 // observers that are created after the mode has started, and want to check |
| 127 // state during their own initializer, such as the NTP. | 127 // state during their own initializer, such as the NTP. |
| 128 bool IsDoingExtensiveChanges() const { return extensive_changes_ > 0; } | 128 bool IsDoingExtensiveChanges() const { return extensive_changes_ > 0; } |
| 129 | 129 |
| 130 // Removes the node at the given |index| from |parent|. Removing a folder node | 130 // Removes the child node. Removing a folder node recursively removes all |
| 131 // recursively removes all nodes. Observers are notified immediately. | 131 // nodes. Observers are notified immediately. |
| 132 void Remove(const BookmarkNode* parent, int index); | 132 void Remove(const BookmarkNode* parent, const BookmarkNode* child); |
|
sky
2015/04/29 15:26:27
If you're going to clean this code up, there is no
| |
| 133 | 133 |
| 134 // Removes all the non-permanent bookmark nodes that are editable by the user. | 134 // Removes all the non-permanent bookmark nodes that are editable by the user. |
| 135 // Observers are only notified when all nodes have been removed. There is no | 135 // Observers are only notified when all nodes have been removed. There is no |
| 136 // notification for individual node removals. | 136 // notification for individual node removals. |
| 137 void RemoveAllUserBookmarks(); | 137 void RemoveAllUserBookmarks(); |
| 138 | 138 |
| 139 // Moves |node| to |new_parent| and inserts it at the given |index|. | 139 // Moves |node| to |new_parent| and inserts it at the given |index|. |
| 140 void Move(const BookmarkNode* node, | 140 void Move(const BookmarkNode* node, |
| 141 const BookmarkNode* new_parent, | 141 const BookmarkNode* new_parent, |
| 142 int index); | 142 int index); |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 442 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; | 442 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; |
| 443 | 443 |
| 444 std::set<std::string> non_cloned_keys_; | 444 std::set<std::string> non_cloned_keys_; |
| 445 | 445 |
| 446 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 446 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
| 447 }; | 447 }; |
| 448 | 448 |
| 449 } // namespace bookmarks | 449 } // namespace bookmarks |
| 450 | 450 |
| 451 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 451 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
| OLD | NEW |