Roll src/third_party/WebKit 9f7fb92:f103b33 (svn 202621:202622)
[chromium-blink-merge.git] / components / bookmarks / managed / managed_bookmark_util.cc
blobd19d941e78d8e1bd25b189913f52fe69e154a5db
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/bookmarks/managed/managed_bookmark_util.h"
7 #include "components/bookmarks/browser/bookmark_node.h"
8 #include "components/bookmarks/managed/managed_bookmark_service.h"
10 namespace bookmarks {
12 bool IsPermanentNode(const BookmarkPermanentNode* node,
13 ManagedBookmarkService* managed_bookmark_service) {
14 BookmarkNode::Type type = node->type();
15 if (type == BookmarkNode::BOOKMARK_BAR ||
16 type == BookmarkNode::OTHER_NODE ||
17 type == BookmarkNode::MOBILE) {
18 return true;
21 return IsManagedNode(node, managed_bookmark_service);
24 bool IsManagedNode(const BookmarkPermanentNode* node,
25 ManagedBookmarkService* managed_bookmark_service) {
26 if (!managed_bookmark_service)
27 return false;
29 return node == managed_bookmark_service->managed_node() ||
30 node == managed_bookmark_service->supervised_node();
33 } // namespace bookmarks