OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/android/bookmarks/bookmark_bridge.h" | 5 #include "chrome/browser/android/bookmarks/bookmark_bridge.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 if (obj.is_null()) | 795 if (obj.is_null()) |
796 return; | 796 return; |
797 Java_BookmarkBridge_editBookmarksEnabledChanged(env, obj); | 797 Java_BookmarkBridge_editBookmarksEnabledChanged(env, obj); |
798 } | 798 } |
799 | 799 |
800 bool BookmarkBridge::IsEditable(const BookmarkNode* node) const { | 800 bool BookmarkBridge::IsEditable(const BookmarkNode* node) const { |
801 if (!node || (node->type() != BookmarkNode::FOLDER && | 801 if (!node || (node->type() != BookmarkNode::FOLDER && |
802 node->type() != BookmarkNode::URL)) { | 802 node->type() != BookmarkNode::URL)) { |
803 return false; | 803 return false; |
804 } | 804 } |
805 if (!IsEditBookmarksEnabled()) | 805 if (!IsEditBookmarksEnabled() || bookmark_model_->is_permanent_node(node)) |
806 return false; | 806 return false; |
807 if (partner_bookmarks_shim_->IsPartnerBookmark(node)) | 807 if (partner_bookmarks_shim_->IsPartnerBookmark(node)) |
808 return partner_bookmarks_shim_->IsEditable(node); | 808 return partner_bookmarks_shim_->IsEditable(node); |
809 return managed_bookmark_service_->CanBeEditedByUser(node); | 809 return managed_bookmark_service_->CanBeEditedByUser(node); |
810 } | 810 } |
811 | 811 |
812 bool BookmarkBridge::IsManaged(const BookmarkNode* node) const { | 812 bool BookmarkBridge::IsManaged(const BookmarkNode* node) const { |
813 return bookmarks::IsDescendantOf(node, | 813 return bookmarks::IsDescendantOf(node, |
814 managed_bookmark_service_->managed_node()); | 814 managed_bookmark_service_->managed_node()); |
815 } | 815 } |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 BookmarkModelChanged(); | 1013 BookmarkModelChanged(); |
1014 } | 1014 } |
1015 | 1015 |
1016 void BookmarkBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) { | 1016 void BookmarkBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) { |
1017 NotifyIfDoneLoading(); | 1017 NotifyIfDoneLoading(); |
1018 } | 1018 } |
1019 | 1019 |
1020 void BookmarkBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) { | 1020 void BookmarkBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) { |
1021 partner_bookmarks_shim_ = NULL; | 1021 partner_bookmarks_shim_ = NULL; |
1022 } | 1022 } |
OLD | NEW |