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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/bookmarks/browser/bookmark_utils.h" 5 #include "components/bookmarks/browser/bookmark_utils.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 return true; 503 return true;
504 } 504 }
505 return false; 505 return false;
506 } 506 }
507 507
508 const BookmarkNode* GetBookmarkNodeByID(const BookmarkModel* model, int64 id) { 508 const BookmarkNode* GetBookmarkNodeByID(const BookmarkModel* model, int64 id) {
509 // TODO(sky): TreeNode needs a method that visits all nodes using a predicate. 509 // TODO(sky): TreeNode needs a method that visits all nodes using a predicate.
510 return GetNodeByID(model->root_node(), id); 510 return GetNodeByID(model->root_node(), id);
511 } 511 }
512 512
513 bool IsDescendantOf(const bookmarks::BookmarkNode* node,
514 const bookmarks::BookmarkNode* root) {
515 return node && node->HasAncestor(root);
516 }
517
518 bool HasDescendantsOf(const std::vector<const bookmarks::BookmarkNode*>& list,
519 const bookmarks::BookmarkNode* root) {
520 for (const BookmarkNode* node : list) {
521 if (IsDescendantOf(node, root))
522 return true;
523 }
524 return false;
525 }
526
513 } // namespace bookmarks 527 } // namespace bookmarks
OLDNEW
« 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