Chromium Code Reviews| Index: chrome/browser/android/bookmarks/bookmarks_bridge.cc |
| diff --git a/chrome/browser/android/bookmarks/bookmarks_bridge.cc b/chrome/browser/android/bookmarks/bookmarks_bridge.cc |
| index 128caa9fef6c686eb99b1cd5c1344d92f8240650..55606508a965eb0d778fb1b0e8710e32a912a3dc 100644 |
| --- a/chrome/browser/android/bookmarks/bookmarks_bridge.cc |
| +++ b/chrome/browser/android/bookmarks/bookmarks_bridge.cc |
| @@ -211,9 +211,6 @@ void BookmarksBridge::GetTopLevelFolderParentIDs(JNIEnv* env, |
| env, j_result_obj, bookmark_model_->root_node()->id(), |
| GetBookmarkType(bookmark_model_->root_node())); |
| Java_BookmarksBridge_addToBookmarkIdList( |
| - env, j_result_obj, bookmark_model_->mobile_node()->id(), |
| - GetBookmarkType(bookmark_model_->mobile_node())); |
| - Java_BookmarksBridge_addToBookmarkIdList( |
| env, j_result_obj, bookmark_model_->other_node()->id(), |
| GetBookmarkType(bookmark_model_->other_node())); |
| } |
| @@ -243,13 +240,7 @@ void BookmarksBridge::GetTopLevelFolderIDs(JNIEnv* env, |
| top_level_folders.push_back(bookmark_model_->bookmark_bar_node()); |
| - const BookmarkNode* mobile_node = bookmark_model_->mobile_node(); |
| - for (int i = 0; i < mobile_node->child_count(); ++i) { |
| - const BookmarkNode* node = mobile_node->GetChild(i); |
| - if (node->is_folder()) { |
| - top_level_folders.push_back(node); |
| - } |
| - } |
| + top_level_folders.push_back(bookmark_model_->mobile_node()); |
|
Ian Wen
2015/01/24 02:03:43
I thought we decided to make mobile a special root
Kibeom Kim (inactive)
2015/01/24 02:48:07
I thought so too, but realized that we are also tr
|
| const BookmarkNode* other_node = bookmark_model_->other_node(); |
| for (int i = 0; i < other_node->child_count(); ++i) { |
| @@ -318,17 +309,19 @@ void BookmarksBridge::GetAllFoldersWithDepths(JNIEnv* env, |
| // heights. |
| std::stack<std::pair<const BookmarkNode*, int> > stk; |
| - for (int i = 0; i < mobile->child_count(); ++i) { |
|
Ian Wen
2015/01/24 02:03:43
According to the mock and to the old bookmark mana
Kibeom Kim (inactive)
2015/01/24 02:48:07
Yeah right, so I was planning to change NONE to OT
|
| - const BookmarkNode* child = mobile->GetChild(i); |
| - if (child->is_folder() && client_->CanBeEditedByUser(child)) |
| - bookmarkList.push_back(child); |
| - } |
| + // TODO(kkimlabs): Share the top level folder logic with |
| + // |GetTopLevelFolderIDs|. There is no reason to have two |
| + // places doing the same work. |
| + |
| for (int i = 0; i < other->child_count(); ++i) { |
| const BookmarkNode* child = other->GetChild(i); |
| if (child->is_folder() && client_->CanBeEditedByUser(child)) |
| bookmarkList.push_back(child); |
| } |
| + |
| bookmarkList.push_back(desktop); |
|
newt (away)
2015/01/24 00:40:00
Does this affect the order in which bookmark folde
Kibeom Kim (inactive)
2015/01/24 02:48:07
Yeah we should put mobile first (pun intended).
I
|
| + bookmarkList.push_back(mobile); |
| + |
| std::stable_sort(bookmarkList.begin(), |
| bookmarkList.end(), |
| BookmarkTitleComparer(this, collator.get())); |