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

Unified Diff: ios/chrome/app/safe_mode/safe_mode_view_controller.mm

Issue 2894003002: [ObjC ARC] Converts ios/chrome/app/safe_mode:safe_mode to ARC. (Closed)
Patch Set: Addressed all comments Created 3 years, 7 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
Index: ios/chrome/app/safe_mode/safe_mode_view_controller.mm
diff --git a/ios/chrome/app/safe_mode/safe_mode_view_controller.mm b/ios/chrome/app/safe_mode/safe_mode_view_controller.mm
index fbd921c49e2c743ed3cfe2dd7b2fa3e18de9bb27..5a3eb5a229b14c9429374207f125460d1b6679c4 100644
--- a/ios/chrome/app/safe_mode/safe_mode_view_controller.mm
+++ b/ios/chrome/app/safe_mode/safe_mode_view_controller.mm
@@ -16,6 +16,10 @@
#include "ios/chrome/grit/ios_chromium_strings.h"
#import "ui/gfx/ios/NSString+CrStringDrawing.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
const CGFloat kVerticalSpacing = 20;
const CGFloat kUploadProgressSpacing = 5;
@@ -139,8 +143,7 @@ const NSTimeInterval kUploadTotalTime = 5;
if (IsLandscape()) {
mainBounds.size = CGSizeMake(mainBounds.size.height, mainBounds.size.width);
}
- base::scoped_nsobject<UIScrollView> scrollView(
- [[UIScrollView alloc] initWithFrame:mainBounds]);
+ UIScrollView* scrollView = [[UIScrollView alloc] initWithFrame:mainBounds];
self.view = scrollView;
[self.view setBackgroundColor:[UIColor colorWithWhite:0.902 alpha:1.0]];
const CGFloat kIPadInset =
@@ -157,8 +160,7 @@ const NSTimeInterval kUploadTotalTime = 5;
[scrollView addSubview:innerView_];
UIImage* fatalImage = [UIImage imageNamed:@"fatal_error.png"];
- base::scoped_nsobject<UIImageView> imageView(
- [[UIImageView alloc] initWithImage:fatalImage]);
+ UIImageView* imageView = [[UIImageView alloc] initWithImage:fatalImage];
// Shift the image down a bit.
CGRect imageFrame = [imageView frame];
imageFrame.origin.y = kVerticalSpacing;
@@ -166,7 +168,7 @@ const NSTimeInterval kUploadTotalTime = 5;
[self centerView:imageView afterView:nil];
[innerView_ addSubview:imageView];
- base::scoped_nsobject<UILabel> awSnap([[UILabel alloc] init]);
+ UILabel* awSnap = [[UILabel alloc] init];
[awSnap setText:NSLocalizedString(@"IDS_IOS_SAFE_MODE_AW_SNAP", @"")];
[awSnap setBackgroundColor:[UIColor clearColor]];
[awSnap setTextColor:[UIColor blackColor]];
@@ -175,7 +177,7 @@ const NSTimeInterval kUploadTotalTime = 5;
[self centerView:awSnap afterView:imageView];
[innerView_ addSubview:awSnap];
- base::scoped_nsobject<UILabel> description([[UILabel alloc] init]);
+ UILabel* description = [[UILabel alloc] init];
[description setText:[self startupCrashModuleText]];
[description setBackgroundColor:[UIColor clearColor]];
[description setTextColor:[UIColor colorWithWhite:0.31 alpha:1.0]];
@@ -265,13 +267,13 @@ const NSTimeInterval kUploadTotalTime = 5;
#pragma mark - Private
- (void)startUploadProgress {
- uploadStartTime_.reset([[NSDate date] retain]);
- uploadTimer_.reset(
- [[NSTimer scheduledTimerWithTimeInterval:kUploadPumpInterval
- target:self
- selector:@selector(pumpUploadProgress)
- userInfo:nil
- repeats:YES] retain]);
+ uploadStartTime_.reset([NSDate date]);
+ uploadTimer_.reset([NSTimer
+ scheduledTimerWithTimeInterval:kUploadPumpInterval
+ target:self
+ selector:@selector(pumpUploadProgress)
+ userInfo:nil
+ repeats:YES]);
}
- (void)pumpUploadProgress {

Powered by Google App Engine
This is Rietveld 408576698