Index: ios/chrome/app/spotlight/bookmarks_spotlight_manager.h |
diff --git a/ios/chrome/app/spotlight/bookmarks_spotlight_manager.h b/ios/chrome/app/spotlight/bookmarks_spotlight_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..31534ed3d9fc5966e8e5ff1743c49513fecc461f |
--- /dev/null |
+++ b/ios/chrome/app/spotlight/bookmarks_spotlight_manager.h |
@@ -0,0 +1,57 @@ |
+// 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, assign) 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_ |