OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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/managed/managed_bookmark_service.h" | 5 #include "components/bookmarks/managed/managed_bookmark_service.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 !IsDescendantOf(node, supervised_node_); | 141 !IsDescendantOf(node, supervised_node_); |
142 } | 142 } |
143 | 143 |
144 bool ManagedBookmarkService::CanSyncNode(const BookmarkNode* node) { | 144 bool ManagedBookmarkService::CanSyncNode(const BookmarkNode* node) { |
145 return !IsDescendantOf(node, managed_node_) && | 145 return !IsDescendantOf(node, managed_node_) && |
146 !IsDescendantOf(node, supervised_node_); | 146 !IsDescendantOf(node, supervised_node_); |
147 } | 147 } |
148 | 148 |
149 bool ManagedBookmarkService::CanBeEditedByUser(const BookmarkNode* node) { | 149 bool ManagedBookmarkService::CanBeEditedByUser(const BookmarkNode* node) { |
150 return !IsDescendantOf(node, managed_node_) && | 150 return !IsDescendantOf(node, managed_node_) && |
151 !IsDescendantOf(node, supervised_node_); | 151 !IsDescendantOf(node, supervised_node_) && !node->is_root(); |
sky
2017/04/24 19:22:25
How about using !is_permanent_node? (on the model)
Theresa
2017/04/24 20:19:10
Done.
| |
152 } | 152 } |
153 | 153 |
154 void ManagedBookmarkService::Shutdown() { | 154 void ManagedBookmarkService::Shutdown() { |
155 Cleanup(); | 155 Cleanup(); |
156 } | 156 } |
157 | 157 |
158 void ManagedBookmarkService::BookmarkModelChanged() {} | 158 void ManagedBookmarkService::BookmarkModelChanged() {} |
159 | 159 |
160 void ManagedBookmarkService::BookmarkModelLoaded(BookmarkModel* bookmark_model, | 160 void ManagedBookmarkService::BookmarkModelLoaded(BookmarkModel* bookmark_model, |
161 bool ids_reassigned) { | 161 bool ids_reassigned) { |
(...skipping 18 matching lines...) Expand all Loading... | |
180 } | 180 } |
181 | 181 |
182 managed_bookmarks_tracker_.reset(); | 182 managed_bookmarks_tracker_.reset(); |
183 supervised_bookmarks_tracker_.reset(); | 183 supervised_bookmarks_tracker_.reset(); |
184 | 184 |
185 managed_node_ = nullptr; | 185 managed_node_ = nullptr; |
186 supervised_node_ = nullptr; | 186 supervised_node_ = nullptr; |
187 } | 187 } |
188 | 188 |
189 } // namespace bookmarks | 189 } // namespace bookmarks |
OLD | NEW |