OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_APP_SPOTLIGHT_BOOKMARKS_SPOTLIGHT_MANAGER_H_ |
| 6 #define IOS_CHROME_APP_SPOTLIGHT_BOOKMARKS_SPOTLIGHT_MANAGER_H_ |
| 7 |
| 8 #import "ios/chrome/app/spotlight/base_spotlight_manager.h" |
| 9 |
| 10 namespace bookmarks { |
| 11 class BookmarkNode; |
| 12 class BookmarkModel; |
| 13 } |
| 14 |
| 15 namespace ios { |
| 16 class ChromeBrowserState; |
| 17 } // namespace ios |
| 18 |
| 19 @class CSSearchableItem; |
| 20 @class TopSitesSpotlightManager; |
| 21 |
| 22 @protocol BookmarkUpdatedDelegate |
| 23 |
| 24 // Called when a bookmark is updated. |
| 25 - (void)bookmarkUpdated; |
| 26 |
| 27 @end |
| 28 |
| 29 @interface BookmarksSpotlightManager : BaseSpotlightManager |
| 30 |
| 31 // The delegate notified when a bookmark is updated. |
| 32 @property(nonatomic, assign) id<BookmarkUpdatedDelegate> delegate; |
| 33 |
| 34 + (BookmarksSpotlightManager*)bookmarksSpotlightManagerWithBrowserState: |
| 35 (ios::ChromeBrowserState*)browserState; |
| 36 |
| 37 // Checks the date of the latest global indexation and reindex all bookmarks if |
| 38 // needed. |
| 39 - (void)reindexBookmarksIfNeeded; |
| 40 |
| 41 // Methods below here are for testing use only. |
| 42 |
| 43 - (instancetype) |
| 44 initWithLargeIconService:(favicon::LargeIconService*)largeIconService |
| 45 bookmarkModel:(bookmarks::BookmarkModel*)bookmarkModel; |
| 46 |
| 47 // Recursively adds node ancestors titles to keywords. Permanent nodes are |
| 48 // ignored. |
| 49 - (void)getParentKeywordsForNode:(const bookmarks::BookmarkNode*)node |
| 50 inArray:(NSMutableArray*)keywords; |
| 51 |
| 52 // Adds keywords to |item|. |
| 53 - (void)addKeywords:(NSArray*)keywords toSearchableItem:(CSSearchableItem*)item; |
| 54 |
| 55 @end |
| 56 |
| 57 #endif // IOS_CHROME_APP_SPOTLIGHT_BOOKMARKS_SPOTLIGHT_MANAGER_H_ |
OLD | NEW |