Commit 58a14298 authored by stkhapugin's avatar stkhapugin Committed by Commit bot

[ObjC ARC] Converts ios/chrome/browser/web:web to ARC.

Automatically generated ARCMigrate commit
Notable issues:None
BUG=624363
TEST=None

Review-Url: https://codereview.chromium.org/2518583002
Cr-Commit-Position: refs/heads/master@{#438883}
parent 88dc5d75
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
import("//ios/web/js_compile.gni") import("//ios/web/js_compile.gni")
source_set("web") { source_set("web") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [ sources = [
"dom_altering_lock.h", "dom_altering_lock.h",
"dom_altering_lock.mm", "dom_altering_lock.mm",
......
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
#include "base/logging.h" #include "base/logging.h"
#include "ios/web/public/web_thread.h" #include "ios/web/public/web_thread.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
DEFINE_WEB_STATE_USER_DATA_KEY(DOMAlteringLock); DEFINE_WEB_STATE_USER_DATA_KEY(DOMAlteringLock);
DOMAlteringLock::DOMAlteringLock(web::WebState* web_state) { DOMAlteringLock::DOMAlteringLock(web::WebState* web_state) {
......
...@@ -5,13 +5,15 @@ ...@@ -5,13 +5,15 @@
#import "ios/chrome/browser/web/resubmit_data_controller.h" #import "ios/chrome/browser/web/resubmit_data_controller.h"
#import "base/logging.h" #import "base/logging.h"
#include "base/mac/scoped_block.h"
#import "base/mac/scoped_nsobject.h"
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
@interface ResubmitDataController () { @interface ResubmitDataController () {
base::scoped_nsobject<UIAlertController> _alertController; UIAlertController* _alertController;
} }
@end @end
...@@ -36,15 +38,13 @@ ...@@ -36,15 +38,13 @@
l10n_util::GetNSString(IDS_HTTP_POST_WARNING_RESEND); l10n_util::GetNSString(IDS_HTTP_POST_WARNING_RESEND);
NSString* cancelTitle = l10n_util::GetNSString(IDS_CANCEL); NSString* cancelTitle = l10n_util::GetNSString(IDS_CANCEL);
_alertController.reset([[UIAlertController _alertController = [UIAlertController
alertControllerWithTitle:nil alertControllerWithTitle:nil
message:message message:message
preferredStyle:UIAlertControllerStyleActionSheet] retain]); preferredStyle:UIAlertControllerStyleActionSheet];
// Make sure the blocks are located on the heap. // Make sure the blocks are located on the heap.
base::mac::ScopedBlock<ProceduralBlock> guaranteeOnHeap; continueBlock = [continueBlock copy];
guaranteeOnHeap.reset([continueBlock copy]); cancelBlock = [cancelBlock copy];
guaranteeOnHeap.reset([cancelBlock copy]);
UIAlertAction* cancelAction = UIAlertAction* cancelAction =
[UIAlertAction actionWithTitle:cancelTitle [UIAlertAction actionWithTitle:cancelTitle
...@@ -65,9 +65,9 @@ ...@@ -65,9 +65,9 @@
} }
- (void)presentActionSheetFromRect:(CGRect)rect inView:(UIView*)view { - (void)presentActionSheetFromRect:(CGRect)rect inView:(UIView*)view {
_alertController.get().modalPresentationStyle = UIModalPresentationPopover; _alertController.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController* popPresenter = UIPopoverPresentationController* popPresenter =
_alertController.get().popoverPresentationController; _alertController.popoverPresentationController;
popPresenter.sourceView = view; popPresenter.sourceView = view;
popPresenter.sourceRect = rect; popPresenter.sourceRect = rect;
...@@ -80,9 +80,8 @@ ...@@ -80,9 +80,8 @@
} }
- (void)dismissActionSheet { - (void)dismissActionSheet {
[_alertController.get().presentingViewController [_alertController.presentingViewController dismissViewControllerAnimated:YES
dismissViewControllerAnimated:YES completion:nil];
completion:nil];
} }
@end @end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment