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

Unified Diff: ios/chrome/app/spotlight/base_spotlight_manager.h

Issue 2580363002: Upstream Chrome on iOS source code [1/11]. (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/app/spotlight/base_spotlight_manager.h
diff --git a/ios/chrome/app/spotlight/base_spotlight_manager.h b/ios/chrome/app/spotlight/base_spotlight_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..bdf5ffa94aedd01b5d20aa08b016f2f167faa9fb
--- /dev/null
+++ b/ios/chrome/app/spotlight/base_spotlight_manager.h
@@ -0,0 +1,62 @@
+// 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_BASE_SPOTLIGHT_MANAGER_H_
+#define IOS_CHROME_APP_SPOTLIGHT_BASE_SPOTLIGHT_MANAGER_H_
+
+#import <CoreSpotlight/CoreSpotlight.h>
+#import <UIKit/UIKit.h>
+
+#include "base/mac/scoped_nsobject.h"
+#include "ios/chrome/app/spotlight/spotlight_util.h"
+
+class GURL;
+
+namespace favicon {
+class LargeIconService;
+}
+
+@interface BaseSpotlightManager : NSObject
+
+- (instancetype)initWithLargeIconService:
+ (favicon::LargeIconService*)largeIconService
+ domain:(spotlight::Domain)domain
+ NS_DESIGNATED_INITIALIZER;
+
+- (instancetype)init NS_UNAVAILABLE;
+
+// Refreshes all items that point to |URLToRefresh|, using title |title|, by
+// calling spotlightItemsWithURL on given URL. The values of |title| and |URL|
+// will be passed to spotlightItemsWithURL.
+- (void)refreshItemsWithURL:(const GURL&)URLToRefresh title:(NSString*)title;
+
+// Creates a spotlight item with |itemID|, using the |attributeSet|.
+- (CSSearchableItem*)spotlightItemWithItemID:(NSString*)itemID
+ attributeSet:
+ (CSSearchableItemAttributeSet*)attributeSet;
+
+// Creates spotlight items in the class's domain for |URL|,
+// using |favicon| and |defaultTitle|
+// Base implementation creates a single item directly using provided arguments
+// and expects a non-nil title.
+- (NSArray*)spotlightItemsWithURL:(const GURL&)URL
+ favicon:(UIImage*)favicon
+ defaultTitle:(NSString*)defaultTitle;
+
+// Removes all items in the current manager's domain from the Spotlight
+// index, then calls |callback| on completion
+- (void)clearAllSpotlightItems:(BlockWithError)callback;
+
+// Cancel all large icon pending tasks.
+- (void)cancelAllLargeIconPendingTasks;
+
+// Returns the spotlight ID for an item indexing |URL| and |title|.
+- (NSString*)spotlightIDForURL:(const GURL&)URL title:(NSString*)title;
+
+// Returns the number of pending large icon query tasks
+- (NSUInteger)pendingLargeIconTasksCount;
+
+@end
+
+#endif // IOS_CHROME_APP_SPOTLIGHT_BASE_SPOTLIGHT_MANAGER_H_
« no previous file with comments | « ios/chrome/app/spotlight/actions_spotlight_manager.mm ('k') | ios/chrome/app/spotlight/base_spotlight_manager.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698