Commit c2c4f480 authored by Xing Liu's avatar Xing Liu Committed by Commit Bot

Read later: Reading list folder should be non-movable.

The top level reading list folder is not editable/movable. The reading
list articles is editable since we need to support move and delete for
them.

Test is adjusted to ensure no overflow menu is shown for the
reading list folder.

Also this CL is needed for a following CL to adjust positioning logic.

Bug: 1139070
Change-Id: Ia09626c4568fe1e90612256da53176a90fc19c5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2481959
Commit-Queue: Xing Liu <xingliu@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818530}
parent 0cd6d059
......@@ -1479,15 +1479,19 @@ public class BookmarkTest {
openBookmarkManager();
TestThreadUtils.runOnUiThreadBlocking(
() -> mManager.openFolder(mBookmarkModel.getRootFolderId()));
RecyclerViewTestUtils.waitForStableRecyclerView(mItemsContainer);
Assert.assertEquals("Wrong number of top level folders.", 2, getAdapter().getItemCount());
// Reading list should show in the root folder.
View readingListRow = mItemsContainer.findViewHolderForAdapterPosition(0).itemView;
Assert.assertEquals("No overflow menu for reading list folder.", View.GONE,
readingListRow.findViewById(R.id.more).getVisibility());
Assert.assertEquals("The first view should be reading list.", BookmarkType.READING_LIST,
getIdByPosition(0).getType());
onView(withText("Reading list")).check(matches(isDisplayed()));
Assert.assertEquals("The second view should be a normal folder.", BookmarkType.NORMAL,
getIdByPosition(1).getType());
// Reading list should show in the root folder.
onView(withText("Reading list")).check(matches(isDisplayed()));
}
/**
......
......@@ -920,6 +920,9 @@ bool BookmarkBridge::IsEditable(const BookmarkNode* node) const {
return false;
if (partner_bookmarks_shim_->IsPartnerBookmark(node))
return partner_bookmarks_shim_->IsEditable(node);
if (reading_list_manager_->IsReadingListBookmark(node))
return reading_list_manager_->GetRoot() != node;
return managed_bookmark_service_->CanBeEditedByUser(node);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment