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

Unified Diff: ios/chrome/app/spotlight/actions_spotlight_manager.mm

Issue 2704193002: [ObjC ARC] Converts ios/chrome/app/spotlight:spotlight to ARC. (Closed)
Patch Set: s/unsafe/weak Created 3 years, 10 months 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
« no previous file with comments | « ios/chrome/app/spotlight/BUILD.gn ('k') | ios/chrome/app/spotlight/base_spotlight_manager.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
« no previous file with comments | « ios/chrome/app/spotlight/BUILD.gn ('k') | ios/chrome/app/spotlight/base_spotlight_manager.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698