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

Unified Diff: ios/chrome/browser/ui/side_swipe/side_swipe_navigation_view.mm

Issue 2827643002: [ObjC ARC] Converts ios/chrome/browser/ui/side_swipe:side_swipe to ARC. (Closed)
Patch Set: weak Created 3 years, 8 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/browser/ui/side_swipe/side_swipe_navigation_view.mm
diff --git a/ios/chrome/browser/ui/side_swipe/side_swipe_navigation_view.mm b/ios/chrome/browser/ui/side_swipe/side_swipe_navigation_view.mm
index ca4fa6d282be5e5ccc09230ff1ef18b843b1dabe..83beea7ef9b01c8315f3795d1419addf40aa9c81 100644
--- a/ios/chrome/browser/ui/side_swipe/side_swipe_navigation_view.mm
+++ b/ios/chrome/browser/ui/side_swipe/side_swipe_navigation_view.mm
@@ -7,8 +7,7 @@
#include <cmath>
#include "base/logging.h"
-#include "base/mac/objc_property_releaser.h"
-#include "base/mac/scoped_nsobject.h"
+
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#import "ios/chrome/browser/ui/side_swipe/side_swipe_util.h"
@@ -17,6 +16,10 @@
#import "ios/chrome/browser/ui/uikit_ui_util.h"
#import "ios/chrome/common/material_timing.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
enum class SwipeType { CHANGE_TABS, NAVIGATION };
@@ -71,7 +74,7 @@ const CGFloat kSelectionAnimationDuration = 0.5;
BOOL thresholdTriggered_;
// The back or forward sprite image.
- base::scoped_nsobject<UIImageView> arrowView_;
+ UIImageView* arrowView_;
// The selection bubble.
CAShapeLayer* selectionCircleLayer_;
@@ -83,8 +86,6 @@ const CGFloat kSelectionAnimationDuration = 0.5;
// If |YES| arrowView_ is directionnal and must be rotated 180 degreed for the
// forward panes.
BOOL rotateForward_;
-
- base::mac::ObjCPropertyReleaser _propertyReleaser_SideSwipeNavigationView;
}
// Returns a newly allocated and configured selection circle shape.
- (CAShapeLayer*)newSelectionCircleLayer;
@@ -104,8 +105,6 @@ const CGFloat kSelectionAnimationDuration = 0.5;
rotateForward:(BOOL)rotateForward {
self = [super initWithFrame:frame];
if (self) {
- _propertyReleaser_SideSwipeNavigationView.Init(
- self, [SideSwipeNavigationView class]);
self.backgroundColor = [UIColor colorWithWhite:90.0 / 256 alpha:1.0];
canNavigate_ = canNavigate;
@@ -113,7 +112,7 @@ const CGFloat kSelectionAnimationDuration = 0.5;
if (canNavigate) {
image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
const CGRect imageSize = CGRectMake(0, 0, 24, 24);
- arrowView_.reset([[UIImageView alloc] initWithImage:image]);
+ arrowView_ = [[UIImageView alloc] initWithImage:image];
[arrowView_ setTintColor:[UIColor whiteColor]];
selectionCircleLayer_ = [self newSelectionCircleLayer];
[arrowView_ setFrame:imageSize];
@@ -123,8 +122,7 @@ const CGFloat kSelectionAnimationDuration = 0.5;
[UIImage imageNamed:@"side_swipe_navigation_content_shadow"];
CGRect borderFrame =
CGRectMake(0, 0, shadowImage.size.width, self.frame.size.height);
- base::scoped_nsobject<UIImageView> border(
- [[UIImageView alloc] initWithFrame:borderFrame]);
+ UIImageView* border = [[UIImageView alloc] initWithFrame:borderFrame];
[border setImage:shadowImage];
[self addSubview:border];
if (direction == UISwipeGestureRecognizerDirectionRight) {
« no previous file with comments | « ios/chrome/browser/ui/side_swipe/side_swipe_navigation_view.h ('k') | ios/chrome/browser/ui/side_swipe/side_swipe_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698