Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: components/bookmarks/browser/bookmark_model.cc

Issue 703553002: Allow systematic prefix search in bookmarks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: put missing "M" back Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/bookmarks/browser/bookmark_model.h" 5 #include "components/bookmarks/browser/bookmark_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 AsMutable(parent)->set_date_folder_modified(time); 682 AsMutable(parent)->set_date_folder_modified(time);
683 683
684 if (store_.get()) 684 if (store_.get())
685 store_->ScheduleSave(); 685 store_->ScheduleSave();
686 } 686 }
687 687
688 void BookmarkModel::ResetDateFolderModified(const BookmarkNode* node) { 688 void BookmarkModel::ResetDateFolderModified(const BookmarkNode* node) {
689 SetDateFolderModified(node, Time()); 689 SetDateFolderModified(node, Time());
690 } 690 }
691 691
692 void BookmarkModel::GetBookmarksMatching(const base::string16& text,
693 size_t max_count,
694 std::vector<BookmarkMatch>* matches) {
695 GetBookmarksMatching(text, max_count,
696 query_parser::MatchingAlgorithm::DEFAULT, matches);
697 }
698
692 void BookmarkModel::GetBookmarksMatching( 699 void BookmarkModel::GetBookmarksMatching(
693 const base::string16& text, 700 const base::string16& text,
694 size_t max_count, 701 size_t max_count,
702 query_parser::MatchingAlgorithm matching_algorithm,
695 std::vector<BookmarkMatch>* matches) { 703 std::vector<BookmarkMatch>* matches) {
696 if (!loaded_) 704 if (!loaded_)
697 return; 705 return;
698 706
699 index_->GetBookmarksMatching(text, max_count, matches); 707 index_->GetBookmarksMatching(text, max_count, matching_algorithm, matches);
700 } 708 }
701 709
702 void BookmarkModel::ClearStore() { 710 void BookmarkModel::ClearStore() {
703 store_.reset(); 711 store_.reset();
704 } 712 }
705 713
706 void BookmarkModel::SetPermanentNodeVisible(BookmarkNode::Type type, 714 void BookmarkModel::SetPermanentNodeVisible(BookmarkNode::Type type,
707 bool value) { 715 bool value) {
708 BookmarkPermanentNode* node = AsMutable(PermanentNode(type)); 716 BookmarkPermanentNode* node = AsMutable(PermanentNode(type));
709 node->set_visible(value || client_->IsPermanentNodeVisible(node)); 717 node->set_visible(value || client_->IsPermanentNodeVisible(node));
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 BookmarkPermanentNode* mobile_node = 1012 BookmarkPermanentNode* mobile_node =
1005 CreatePermanentNode(BookmarkNode::MOBILE); 1013 CreatePermanentNode(BookmarkNode::MOBILE);
1006 return scoped_ptr<BookmarkLoadDetails>(new BookmarkLoadDetails( 1014 return scoped_ptr<BookmarkLoadDetails>(new BookmarkLoadDetails(
1007 bb_node, 1015 bb_node,
1008 other_node, 1016 other_node,
1009 mobile_node, 1017 mobile_node,
1010 client_->GetLoadExtraNodesCallback(), 1018 client_->GetLoadExtraNodesCallback(),
1011 new BookmarkIndex(client_, accept_languages), 1019 new BookmarkIndex(client_, accept_languages),
1012 next_node_id_)); 1020 next_node_id_));
1013 } 1021 }
OLDNEW
« no previous file with comments | « components/bookmarks/browser/bookmark_model.h ('k') | components/bookmarks/browser/bookmark_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698