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

Unified Diff: chrome/browser/bookmarks/bookmark_model.h

Issue 7530024: bookmarks: Simplify is_permanent_node() implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use is_root_node Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/bookmarks/bookmark_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bookmarks/bookmark_model.h
diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h
index 978045a73f080af893a64b514cf7e3a4cd4bedc0..2c451559e6b4caf9580daa874620560037091eaf 100644
--- a/chrome/browser/bookmarks/bookmark_model.h
+++ b/chrome/browser/bookmarks/bookmark_model.h
@@ -196,6 +196,19 @@ class BookmarkModel : public NotificationObserver, public BookmarkService {
// Returns the 'synced' node. This is NULL until loaded.
const BookmarkNode* synced_node() { return synced_node_; }
+ bool is_root_node(const BookmarkNode* node) const { return node == &root_; }
+
+ // Returns whether the given |node| is one of the permanent nodes - root node,
+ // 'bookmark bar' node, 'other' node or 'synced' node.
+ bool is_permanent_node(const BookmarkNode* node) const {
+ return node == &root_ ||
+ node == bookmark_bar_node_ ||
+ node == other_node_ ||
+ node == synced_node_;
+ }
+
+ Profile* profile() const { return profile_; }
+
// Returns the parent the last node was added to. This never returns NULL
// (as long as the model is loaded).
const BookmarkNode* GetParentForNewNodes();
@@ -302,27 +315,6 @@ class BookmarkModel : public NotificationObserver, public BookmarkService {
size_t max_count,
std::vector<bookmark_utils::TitleMatch>* matches);
- Profile* profile() const { return profile_; }
-
- bool is_root(const BookmarkNode* node) const { return node == &root_; }
- bool is_bookmark_bar_node(const BookmarkNode* node) const {
- return node == bookmark_bar_node_;
- }
- bool is_synced_bookmarks_node(const BookmarkNode* node) const {
- return node == synced_node_;
- }
- bool is_other_bookmarks_node(const BookmarkNode* node) const {
- return node == other_node_;
- }
- // Returns whether the given node is one of the permanent nodes - root node,
- // bookmark bar node or other bookmarks node.
- bool is_permanent_node(const BookmarkNode* node) const {
- return is_root(node) ||
- is_bookmark_bar_node(node) ||
- is_other_bookmarks_node(node) ||
- is_synced_bookmarks_node(node);
- }
-
// Sets the store to NULL, making it so the BookmarkModel does not persist
// any changes to disk. This is only useful during testing to speed up
// testing.
« no previous file with comments | « no previous file | chrome/browser/bookmarks/bookmark_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698