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

Unified Diff: components/bookmarks/browser/bookmark_utils.cc

Issue 769153007: Managed bookmarks for supervised users (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build (Android & unit_tests) Created 5 years, 10 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 | « components/bookmarks/browser/bookmark_utils.h ('k') | components/bookmarks/common/bookmark_pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/bookmarks/browser/bookmark_utils.cc
diff --git a/components/bookmarks/browser/bookmark_utils.cc b/components/bookmarks/browser/bookmark_utils.cc
index cda6cd3f49ca092683667f31cc93fda2272b9463..7199ad5c6332400c87d051e716d2eda1fd7516ac 100644
--- a/components/bookmarks/browser/bookmark_utils.cc
+++ b/components/bookmarks/browser/bookmark_utils.cc
@@ -510,4 +510,18 @@ const BookmarkNode* GetBookmarkNodeByID(const BookmarkModel* model, int64 id) {
return GetNodeByID(model->root_node(), id);
}
+bool IsDescendantOf(const bookmarks::BookmarkNode* node,
+ const bookmarks::BookmarkNode* root) {
+ return node && node->HasAncestor(root);
+}
+
+bool HasDescendantsOf(const std::vector<const bookmarks::BookmarkNode*>& list,
+ const bookmarks::BookmarkNode* root) {
+ for (const BookmarkNode* node : list) {
+ if (IsDescendantOf(node, root))
+ return true;
+ }
+ return false;
+}
+
} // namespace bookmarks
« no previous file with comments | « components/bookmarks/browser/bookmark_utils.h ('k') | components/bookmarks/common/bookmark_pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698