Chromium Code Reviews| Index: components/bookmarks/browser/bookmark_model.cc |
| diff --git a/components/bookmarks/browser/bookmark_model.cc b/components/bookmarks/browser/bookmark_model.cc |
| index 5f26f67ce2ead1706714e428714fe44701bb1c8b..2f50f8b0728f973e5221a8854229f0ca4f81faf4 100644 |
| --- a/components/bookmarks/browser/bookmark_model.cc |
| +++ b/components/bookmarks/browser/bookmark_model.cc |
| @@ -507,6 +507,26 @@ void BookmarkModel::GetNodesByURL(const GURL& url, |
| } |
| } |
| +void BookmarkModel::GetNodesByURLAndTitle( |
|
sky
2014/08/18 16:15:21
There is no reason for this in BookmarkModel.
Deepak
2014/08/19 11:42:19
we need this function so that I can make vector of
sky
2014/08/19 16:38:31
This function is only useful in one place and does
|
| + const GURL& url, |
| + const base::string16& title, |
| + const BookmarkNode* parent, |
| + std::vector<const BookmarkNode*>* nodes, |
| + std::vector<base::string16>* titles) { |
| + base::AutoLock url_lock(url_lock_); |
| + BookmarkNode tmp_node(url); |
| + NodesOrderedByURLSet::iterator i = nodes_ordered_by_url_set_.find(&tmp_node); |
| + while (i != nodes_ordered_by_url_set_.end() && (*i)->url() == url) { |
| + if ((parent == (*i)->parent()) && |
| + (title == (*i)->GetTitle() || |
| + StartsWith((*i)->GetTitle(), title, false))) { |
|
sky
2014/08/19 16:38:31
The StartsWith logic makes no sense here.
|
| + titles->push_back((*i)->GetTitle()); |
| + nodes->push_back(*i); |
| + } |
| + ++i; |
| + } |
| +} |
| + |
| const BookmarkNode* BookmarkModel::GetMostRecentlyAddedUserNodeForURL( |
| const GURL& url) { |
| std::vector<const BookmarkNode*> nodes; |