Index: ios/chrome/browser/geolocation/omnibox_geolocation_authorization_alert.mm |
diff --git a/ios/chrome/browser/geolocation/omnibox_geolocation_authorization_alert.mm b/ios/chrome/browser/geolocation/omnibox_geolocation_authorization_alert.mm |
index 0ce6d64ffc43e6a03c60bca773ba8a0f70314678..6fd9e7597a8a8335c936e346a4994ed947b16f44 100644 |
--- a/ios/chrome/browser/geolocation/omnibox_geolocation_authorization_alert.mm |
+++ b/ios/chrome/browser/geolocation/omnibox_geolocation_authorization_alert.mm |
@@ -6,27 +6,24 @@ |
#import <UIKit/UIKit.h> |
-#import "base/ios/weak_nsobject.h" |
#include "base/logging.h" |
-#include "base/mac/scoped_nsobject.h" |
#include "components/strings/grit/components_strings.h" |
#include "ios/chrome/grit/ios_chromium_strings.h" |
#include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
#include "ui/base/l10n/l10n_util_mac.h" |
-@interface OmniboxGeolocationAuthorizationAlert () { |
- base::WeakNSProtocol<id<OmniboxGeolocationAuthorizationAlertDelegate>> |
- delegate_; |
-} |
-@end |
+#if !defined(__has_feature) || !__has_feature(objc_arc) |
+#error "This file requires ARC support." |
+#endif |
@implementation OmniboxGeolocationAuthorizationAlert |
+@synthesize delegate = _delegate; |
- (instancetype)initWithDelegate: |
(id<OmniboxGeolocationAuthorizationAlertDelegate>)delegate { |
self = [super init]; |
if (self) { |
- delegate_.reset(delegate); |
+ _delegate = delegate; |
} |
return self; |
} |
@@ -35,14 +32,6 @@ |
return [self initWithDelegate:nil]; |
} |
-- (id<OmniboxGeolocationAuthorizationAlertDelegate>)delegate { |
- return delegate_.get(); |
-} |
- |
-- (void)setDelegate:(id<OmniboxGeolocationAuthorizationAlertDelegate>)delegate { |
- delegate_.reset(delegate); |
-} |
- |
- (void)showAuthorizationAlert { |
NSString* message = |
l10n_util::GetNSString(IDS_IOS_LOCATION_AUTHORIZATION_ALERT); |
@@ -51,7 +40,7 @@ |
// Use a UIAlertController to match the style of the iOS system location |
// alert. |
- base::WeakNSObject<OmniboxGeolocationAuthorizationAlert> weakSelf(self); |
+ __weak OmniboxGeolocationAuthorizationAlert* weakSelf = self; |
UIAlertController* alert = |
[UIAlertController alertControllerWithTitle:nil |
message:message |
@@ -61,8 +50,7 @@ |
actionWithTitle:ok |
style:UIAlertActionStyleDefault |
handler:^(UIAlertAction* action) { |
- base::scoped_nsobject<OmniboxGeolocationAuthorizationAlert> |
- strongSelf([weakSelf retain]); |
+ OmniboxGeolocationAuthorizationAlert* strongSelf = weakSelf; |
if (strongSelf) { |
[[strongSelf delegate] |
authorizationAlertDidAuthorize:strongSelf]; |
@@ -74,8 +62,7 @@ |
actionWithTitle:cancel |
style:UIAlertActionStyleCancel |
handler:^(UIAlertAction* action) { |
- base::scoped_nsobject<OmniboxGeolocationAuthorizationAlert> |
- strongSelf([weakSelf retain]); |
+ OmniboxGeolocationAuthorizationAlert* strongSelf = weakSelf; |
if (strongSelf) { |
[[strongSelf delegate] |
authorizationAlertDidCancel:strongSelf]; |