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

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

Issue 305973004: BookmarkClient can add extra nodes to BookmarkModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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: components/bookmarks/browser/bookmark_model.h
diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmarks/browser/bookmark_model.h
index eef85fb88beebe9812c5ec259ab769181446cda4..75ec65bfc89cfec7e21f71da38cca2525e93491d 100644
--- a/components/bookmarks/browser/bookmark_model.h
+++ b/components/bookmarks/browser/bookmark_model.h
@@ -27,6 +27,7 @@ class BookmarkExpandedStateTracker;
class BookmarkIndex;
class BookmarkModelObserver;
struct BookmarkMatch;
+class ManagedBookmarksTracker;
class PrefService;
class ScopedGroupBookmarkActions;
@@ -95,17 +96,26 @@ class BookmarkModel : public BookmarkService {
// Returns the 'mobile' node. This is NULL until loaded.
const BookmarkNode* mobile_node() const { return mobile_node_; }
+ // Returns the 'managed' node. This is NULL until loaded.
+ const BookmarkNode* managed_node() const { return managed_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 'mobile' node.
+ // 'bookmark bar' node, 'other' node,'mobile' node or 'managed' node.
bool is_permanent_node(const BookmarkNode* node) const {
return node == &root_ ||
node == bookmark_bar_node_ ||
node == other_node_ ||
- node == mobile_node_;
+ node == mobile_node_ ||
+ node == managed_node_;
}
+ // Returns true if |node| belongs to the |managed_node_| tree. Managed nodes
+ // are never editable, and managed folders can't get bookmarks added, removed
sky 2014/05/30 22:31:37 Do we not allow applying policy changes during run
Joao da Silva 2014/06/01 13:32:07 We do, and the managed bookmarks will update when
+ // or moved.
+ bool IsManaged(const BookmarkNode* node) const;
sky 2014/05/30 22:31:37 This name is mildly confusing. It sort of implies
Joao da Silva 2014/06/01 13:32:07 Right, naming is hard :-) How about "IsInManagedTr
+
// Returns the parent the last node was added to. This never returns NULL
// (as long as the model is loaded).
const BookmarkNode* GetParentForNewNodes();
@@ -388,6 +398,7 @@ class BookmarkModel : public BookmarkService {
BookmarkPermanentNode* bookmark_bar_node_;
BookmarkPermanentNode* other_node_;
BookmarkPermanentNode* mobile_node_;
+ BookmarkPermanentNode* managed_node_;
// The maximum ID assigned to the bookmark nodes in the model.
int64 next_node_id_;
@@ -421,6 +432,7 @@ class BookmarkModel : public BookmarkService {
int extensive_changes_;
scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_;
+ scoped_ptr<ManagedBookmarksTracker> managed_bookmarks_tracker_;
DISALLOW_COPY_AND_ASSIGN(BookmarkModel);
};

Powered by Google App Engine
This is Rietveld 408576698