Chromium Code Reviews| Index: chrome/browser/bookmarks/bookmark_utils.cc |
| diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc |
| index 4820b69fbe166bae2d7ccb8a5cac688cd471b35d..5b007204c2aeceb1e0ef2cfca3b47f913f0409fe 100644 |
| --- a/chrome/browser/bookmarks/bookmark_utils.cc |
| +++ b/chrome/browser/bookmarks/bookmark_utils.cc |
| @@ -84,6 +84,10 @@ bool DoesBookmarkContainWords(const BookmarkNode* node, |
| net::UnescapeRule::NORMAL, NULL, NULL, NULL), words); |
| } |
| +bool IsTopLevel(const BookmarkNode *n1) { |
|
tfarina
2013/12/03 21:19:04
do not use abbreviations. I suggest you change thi
sky
2013/12/03 21:19:07
Use BookmarkModel::is_permanent_node, also, update
|
| + return n1->type() == n1->BOOKMARK_BAR || n1->type() == n1->OTHER_NODE; |
| +} |
| + |
| } // namespace |
| namespace bookmark_utils { |
| @@ -228,7 +232,7 @@ void GetBookmarksContainingText(BookmarkModel* model, |
| ui::TreeNodeIterator<const BookmarkNode> iterator(model->root_node()); |
| while (iterator.has_next()) { |
| const BookmarkNode* node = iterator.Next(); |
| - if (DoesBookmarkContainWords(node, words, languages)) { |
| + if (DoesBookmarkContainWords(node, words, languages) && !IsTopLevel(node)) { |
|
tfarina
2013/12/03 21:19:04
what if we check is_permanent_node()?
|
| nodes->push_back(node); |
| if (nodes->size() == max_count) |
| return; |