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); |
}; |