| Index: ios/chrome/app/spotlight/actions_spotlight_manager.mm
|
| diff --git a/ios/chrome/app/spotlight/actions_spotlight_manager.mm b/ios/chrome/app/spotlight/actions_spotlight_manager.mm
|
| index 5702538788d04cefe9142ea63118ba7b3413931d..1d453c5891b127622c6afeb1a2cad31d17322bda 100644
|
| --- a/ios/chrome/app/spotlight/actions_spotlight_manager.mm
|
| +++ b/ios/chrome/app/spotlight/actions_spotlight_manager.mm
|
| @@ -6,7 +6,6 @@
|
|
|
| #import <CoreSpotlight/CoreSpotlight.h>
|
|
|
| -#include "base/ios/weak_nsobject.h"
|
| #include "base/mac/foundation_util.h"
|
| #include "base/metrics/histogram_macros.h"
|
| #include "base/strings/sys_string_conversions.h"
|
| @@ -18,6 +17,10 @@
|
| #include "ui/base/l10n/l10n_util.h"
|
| #include "url/gurl.h"
|
|
|
| +#if !defined(__has_feature) || !__has_feature(objc_arc)
|
| +#error "This file requires ARC support."
|
| +#endif
|
| +
|
| namespace {
|
|
|
| NSString* SpotlightActionFromString(NSString* query) {
|
| @@ -108,20 +111,19 @@ BOOL SetStartupParametersForSpotlightAction(
|
| @implementation ActionsSpotlightManager
|
|
|
| + (ActionsSpotlightManager*)actionsSpotlightManager {
|
| - return [[[ActionsSpotlightManager alloc]
|
| + return [[ActionsSpotlightManager alloc]
|
| initWithLargeIconService:nil
|
| - domain:spotlight::DOMAIN_ACTIONS] autorelease];
|
| + domain:spotlight::DOMAIN_ACTIONS];
|
| }
|
|
|
| #pragma mark public methods
|
|
|
| - (void)indexActions {
|
| - base::WeakNSObject<ActionsSpotlightManager> weakSelf(self);
|
| + __weak ActionsSpotlightManager* weakSelf = self;
|
| dispatch_after(
|
| dispatch_time(DISPATCH_TIME_NOW, static_cast<int64_t>(1 * NSEC_PER_SEC)),
|
| dispatch_get_main_queue(), ^{
|
| - base::scoped_nsobject<ActionsSpotlightManager> strongSelf(
|
| - [weakSelf retain]);
|
| + ActionsSpotlightManager* strongSelf = weakSelf;
|
| [strongSelf clearAndAddSpotlightActions];
|
| });
|
| }
|
| @@ -133,13 +135,12 @@ BOOL SetStartupParametersForSpotlightAction(
|
| if (!experimental_flags::IsSpotlightActionsEnabled()) {
|
| return;
|
| }
|
| - base::WeakNSObject<ActionsSpotlightManager> weakSelf(self);
|
| + __weak ActionsSpotlightManager* weakSelf = self;
|
| dispatch_after(
|
| dispatch_time(DISPATCH_TIME_NOW,
|
| static_cast<int64_t>(1 * NSEC_PER_SEC)),
|
| dispatch_get_main_queue(), ^{
|
| - base::scoped_nsobject<ActionsSpotlightManager> strongSelf(
|
| - [weakSelf retain]);
|
| + ActionsSpotlightManager* strongSelf = weakSelf;
|
|
|
| if (!strongSelf) {
|
| return;
|
| @@ -181,10 +182,10 @@ BOOL SetStartupParametersForSpotlightAction(
|
| }
|
|
|
| - (CSSearchableItem*)getItemForAction:(NSString*)action title:(NSString*)title {
|
| - base::scoped_nsobject<CSSearchableItemAttributeSet> attributeSet(
|
| + CSSearchableItemAttributeSet* attributeSet =
|
| [[CSSearchableItemAttributeSet alloc]
|
| initWithItemContentType:spotlight::StringFromSpotlightDomain(
|
| - spotlight::DOMAIN_ACTIONS)]);
|
| + spotlight::DOMAIN_ACTIONS)];
|
| [attributeSet setTitle:title];
|
| [attributeSet setDisplayName:title];
|
|
|
|
|