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

Unified Diff: chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.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
Index: chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.cc
diff --git a/chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.cc b/chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.cc
index 82c8d7d59ced12c24808e0117e9a9fd3d1c3928e..6d902a1394327bdec8ce3054bf21ae9d9d2be2c6 100644
--- a/chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.cc
+++ b/chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.cc
@@ -76,8 +76,10 @@ BookmarkTreeNode* GetBookmarkTreeNode(ChromeBookmarkClient* client,
new double(floor(node->date_added().ToDoubleT() * 1000)));
}
- if (client->IsDescendantOfManagedNode(node))
+ if (bookmarks::IsDescendantOf(node, client->managed_node()) ||
+ bookmarks::IsDescendantOf(node, client->supervised_node())) {
bookmark_tree_node->unmodifiable = BookmarkTreeNode::UNMODIFIABLE_MANAGED;
+ }
if (recurse && node->is_folder()) {
std::vector<linked_ptr<BookmarkTreeNode> > children;
@@ -123,7 +125,8 @@ bool RemoveNode(BookmarkModel* model,
*error = keys::kModifySpecialError;
return false;
}
- if (client->IsDescendantOfManagedNode(node)) {
+ if (bookmarks::IsDescendantOf(node, client->managed_node()) ||
+ bookmarks::IsDescendantOf(node, client->supervised_node())) {
*error = keys::kModifyManagedError;
return false;
}

Powered by Google App Engine
This is Rietveld 408576698