blob: 30e46e222e6f0e746a4e58afdcf76d3791735c70 [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_APP_SPOTLIGHT_BOOKMARKS_SPOTLIGHT_MANAGER_H_
#define IOS_CHROME_APP_SPOTLIGHT_BOOKMARKS_SPOTLIGHT_MANAGER_H_
#import "ios/chrome/app/spotlight/base_spotlight_manager.h"
namespace bookmarks {
class BookmarkNode;
class BookmarkModel;
}
namespace ios {
class ChromeBrowserState;
} // namespace ios
@class CSSearchableItem;
@class TopSitesSpotlightManager;
@protocol BookmarkUpdatedDelegate
// Called when a bookmark is updated.
- (void)bookmarkUpdated;
@end
@interface BookmarksSpotlightManager : BaseSpotlightManager
// The delegate notified when a bookmark is updated.
@property(nonatomic, weak) id<BookmarkUpdatedDelegate> delegate;
+ (BookmarksSpotlightManager*)bookmarksSpotlightManagerWithBrowserState:
(ios::ChromeBrowserState*)browserState;
// Checks the date of the latest global indexation and reindex all bookmarks if
// needed.
- (void)reindexBookmarksIfNeeded;
// Methods below here are for testing use only.
- (instancetype)
initWithLargeIconService:(favicon::LargeIconService*)largeIconService
bookmarkModel:(bookmarks::BookmarkModel*)bookmarkModel;
// Recursively adds node ancestors titles to keywords. Permanent nodes are
// ignored.
- (void)getParentKeywordsForNode:(const bookmarks::BookmarkNode*)node
inArray:(NSMutableArray*)keywords;
// Adds keywords to |item|.
- (void)addKeywords:(NSArray*)keywords toSearchableItem:(CSSearchableItem*)item;
@end
#endif // IOS_CHROME_APP_SPOTLIGHT_BOOKMARKS_SPOTLIGHT_MANAGER_H_