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

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

Issue 701553002: Allow systematic prefix search in bookmarks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_
6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 // Sets the date when the folder was modified. 229 // Sets the date when the folder was modified.
230 void SetDateFolderModified(const BookmarkNode* node, const base::Time time); 230 void SetDateFolderModified(const BookmarkNode* node, const base::Time time);
231 231
232 // Resets the 'date modified' time of the node to 0. This is used during 232 // Resets the 'date modified' time of the node to 0. This is used during
233 // importing to exclude the newly created folders from showing up in the 233 // importing to exclude the newly created folders from showing up in the
234 // combobox of most recently modified folders. 234 // combobox of most recently modified folders.
235 void ResetDateFolderModified(const BookmarkNode* node); 235 void ResetDateFolderModified(const BookmarkNode* node);
236 236
237 // Returns up to |max_count| of bookmarks containing each term from |text| 237 // Returns up to |max_count| of bookmarks containing each term from |text|
238 // in either the title or the URL. 238 // in either the title or the URL.
239 // Short terms in the query are matched exactly.
239 void GetBookmarksMatching(const base::string16& text, 240 void GetBookmarksMatching(const base::string16& text,
240 size_t max_count, 241 size_t max_count,
241 std::vector<bookmarks::BookmarkMatch>* matches); 242 std::vector<bookmarks::BookmarkMatch>* matches);
242 243
244 // Returns up to |max_count| of bookmarks containing each term from |text|
245 // in either the title or the URL.
246 // All terms in the query are matched by prefix.
247 void GetBookmarksMatchingPrefixes(
248 const base::string16& text,
249 size_t max_count,
250 std::vector<bookmarks::BookmarkMatch>* matches);
251
243 // Sets the store to NULL, making it so the BookmarkModel does not persist 252 // Sets the store to NULL, making it so the BookmarkModel does not persist
244 // any changes to disk. This is only useful during testing to speed up 253 // any changes to disk. This is only useful during testing to speed up
245 // testing. 254 // testing.
246 void ClearStore(); 255 void ClearStore();
247 256
248 // Returns the next node ID. 257 // Returns the next node ID.
249 int64 next_node_id() const { return next_node_id_; } 258 int64 next_node_id() const { return next_node_id_; }
250 259
251 // Returns the object responsible for tracking the set of expanded nodes in 260 // Returns the object responsible for tracking the set of expanded nodes in
252 // the bookmark editor. 261 // the bookmark editor.
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 423
415 // See description of IsDoingExtensiveChanges above. 424 // See description of IsDoingExtensiveChanges above.
416 int extensive_changes_; 425 int extensive_changes_;
417 426
418 scoped_ptr<bookmarks::BookmarkExpandedStateTracker> expanded_state_tracker_; 427 scoped_ptr<bookmarks::BookmarkExpandedStateTracker> expanded_state_tracker_;
419 428
420 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); 429 DISALLOW_COPY_AND_ASSIGN(BookmarkModel);
421 }; 430 };
422 431
423 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ 432 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698