diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-10 17:22:32 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-10 17:22:32 +0000 |
commit | cb362ccc87064ae0ee4459ee089e00972b4a76e7 (patch) | |
tree | 46af771471ea7700d18dfbfa173e544e14c83998 /chrome/browser/bookmarks/bookmark_table_model.cc | |
parent | f5b43627c9d7faeca9475c38ec67960c1fca46af (diff) | |
download | chromium_src-cb362ccc87064ae0ee4459ee089e00972b4a76e7.zip chromium_src-cb362ccc87064ae0ee4459ee089e00972b4a76e7.tar.gz chromium_src-cb362ccc87064ae0ee4459ee089e00972b4a76e7.tar.bz2 |
Changes bookmark manager search to use contains vs starts with and to
search urls.
BUG=4065
TEST=create the URL foo.com and type 'foo.com' in the bookmark manager
search box. Make sure the url you just typed shows up in the table.
Review URL: http://codereview.chromium.org/13679
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6714 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks/bookmark_table_model.cc')
-rw-r--r-- | chrome/browser/bookmarks/bookmark_table_model.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/chrome/browser/bookmarks/bookmark_table_model.cc b/chrome/browser/bookmarks/bookmark_table_model.cc index 234628d..2b31c72 100644 --- a/chrome/browser/bookmarks/bookmark_table_model.cc +++ b/chrome/browser/bookmarks/bookmark_table_model.cc @@ -204,18 +204,15 @@ class BookmarkSearchTableModel : public VectorBackedBookmarkTableModel { const std::wstring& search_text) : VectorBackedBookmarkTableModel(model), search_text_(search_text) { - std::vector<bookmark_utils::TitleMatch> matches; - bookmark_utils::GetBookmarksMatchingText( - model, search_text, std::numeric_limits<int>::max(), &matches); - for (size_t i = 0; i < matches.size(); ++i) - nodes().push_back(matches[i].node); + bookmark_utils::GetBookmarksContainingText( + model, search_text, std::numeric_limits<int>::max(), &nodes()); } virtual void BookmarkNodeAdded(BookmarkModel* model, BookmarkNode* parent, int index) { BookmarkNode* node = parent->GetChild(index); - if (bookmark_utils::DoesBookmarkMatchText(search_text_, node)) { + if (bookmark_utils::DoesBookmarkContainText(node, search_text_)) { nodes().push_back(node); if (observer()) observer()->OnItemsAdded(static_cast<int>(nodes().size() - 1), 1); |