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

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

Issue 6931018: Initial implementation of "Synced Bookmarks" folder. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge Created 9 years, 7 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
Index: chrome/browser/bookmarks/bookmark_model.h
diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h
index 0e4ada682fb4b5c3b84d194a4a12d26a714a0c99..8767645ad27f913949077cd00e680592b1da5c24 100644
--- a/chrome/browser/bookmarks/bookmark_model.h
+++ b/chrome/browser/bookmarks/bookmark_model.h
@@ -50,7 +50,8 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode> {
URL,
FOLDER,
BOOKMARK_BAR,
- OTHER_NODE
+ OTHER_NODE,
+ SYNCED
};
// Creates a new node with the specified url and id of 0
explicit BookmarkNode(const GURL& url);
@@ -193,6 +194,9 @@ class BookmarkModel : public NotificationObserver, public BookmarkService {
// Returns the 'other' node. This is NULL until loaded.
const BookmarkNode* other_node() { return other_node_; }
+ // Returns the 'synced' node. This is NULL until loaded.
+ const BookmarkNode* synced_node() { return synced_node_; }
+
// Returns the parent the last node was added to. This never returns NULL
// (as long as the model is loaded).
const BookmarkNode* GetParentForNewNodes();
@@ -311,6 +315,9 @@ class BookmarkModel : public NotificationObserver, public BookmarkService {
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_;
}
@@ -319,7 +326,8 @@ class BookmarkModel : public NotificationObserver, public BookmarkService {
bool is_permanent_node(const BookmarkNode* node) const {
return is_root(node) ||
is_bookmark_bar_node(node) ||
- is_other_bookmarks_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
@@ -380,10 +388,11 @@ class BookmarkModel : public NotificationObserver, public BookmarkService {
// Returns true if the parent and index are valid.
bool IsValidIndex(const BookmarkNode* parent, int index, bool allow_end);
- // Creates the bookmark bar/other nodes. These call into
+ // Creates the bookmark bar/synced/other nodes. These call into
// CreateRootNodeFromStarredEntry.
BookmarkNode* CreateBookmarkNode();
BookmarkNode* CreateOtherBookmarksNode();
+ BookmarkNode* CreateSyncedBookmarksNode();
// Creates a root node (either the bookmark bar node or other node) from the
// specified starred entry.
@@ -439,6 +448,7 @@ class BookmarkModel : public NotificationObserver, public BookmarkService {
BookmarkNode* bookmark_bar_node_;
BookmarkNode* other_node_;
+ BookmarkNode* synced_node_;
// The maximum ID assigned to the bookmark nodes in the model.
int64 next_node_id_;
« no previous file with comments | « chrome/browser/bookmarks/bookmark_html_writer_unittest.cc ('k') | chrome/browser/bookmarks/bookmark_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698