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

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

Issue 8828006: Makes all permanent nodes share the same node class so that visibility (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More tweaks Created 9 years 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 1b7eec89d94bb91ed47498a2a84870eb9517c659..baea6460440a8a395204d996be969c2ba5fc6da6 100644
--- a/chrome/browser/bookmarks/bookmark_model.h
+++ b/chrome/browser/bookmarks/bookmark_model.h
@@ -158,6 +158,26 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode> {
DISALLOW_COPY_AND_ASSIGN(BookmarkNode);
};
+// BookmarkPermanentNode -------------------------------------------------------
+
+// Node used for the permanent folders (excluding the root).
+class BookmarkPermanentNode : public BookmarkNode {
noyau (Ping after 24h) 2011/12/09 15:54:35 BookmarkPermanentNode doesn't need to be defined h
sky 2011/12/09 17:57:04 That's problematic because bookmark_bar_node_ is n
+ public:
+ explicit BookmarkPermanentNode(int64 id);
+ virtual ~BookmarkPermanentNode();
+
+ // WARNING: this code is used for other projects. Contact noyau@ for details.
+ void set_visible(bool value) { visible_ = value; }
+
+ // BookmarkNode overrides:
+ virtual bool IsVisible() const OVERRIDE;
+
+ private:
+ bool visible_;
+
+ DISALLOW_COPY_AND_ASSIGN(BookmarkPermanentNode);
+};
+
// BookmarkModel --------------------------------------------------------------
// BookmarkModel provides a directed acyclic graph of URLs and folders.
@@ -329,8 +349,8 @@ class BookmarkModel : public content::NotificationObserver,
return expanded_state_tracker_.get();
}
- // Sets whether the mobile folder is visible. This is set by sync.
- void SetMobileFolderVisible(bool value);
+ // Sets the visibility of one of the permanent nodes. This is set by sync.
+ void SetPermanentNodeVisible(BookmarkNode::Type type, bool value);
private:
friend class BookmarkCodecTest;
@@ -382,7 +402,7 @@ class BookmarkModel : public content::NotificationObserver,
// Creates one of the possible permanent nodes (bookmark bar node, other node
// and mobile node) from |type|.
- BookmarkNode* CreatePermanentNode(BookmarkNode::Type type);
+ BookmarkPermanentNode* CreatePermanentNode(BookmarkNode::Type type);
// Notification that a favicon has finished loading. If we can decode the
// favicon, FaviconLoaded is invoked.
@@ -431,9 +451,9 @@ class BookmarkModel : public content::NotificationObserver,
// children.
BookmarkNode root_;
- BookmarkNode* bookmark_bar_node_;
- BookmarkNode* other_node_;
- BookmarkNode* mobile_node_;
+ BookmarkPermanentNode* bookmark_bar_node_;
+ BookmarkPermanentNode* other_node_;
+ BookmarkPermanentNode* mobile_node_;
// The maximum ID assigned to the bookmark nodes in the model.
int64 next_node_id_;
« 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