Index: ios/chrome/browser/ui/stack_view/stack_view_toolbar_controller.mm |
diff --git a/ios/chrome/browser/ui/stack_view/stack_view_toolbar_controller.mm b/ios/chrome/browser/ui/stack_view/stack_view_toolbar_controller.mm |
index cc9fceb3df05bb6dfee78d545ee5aa6d57e74c44..8960e4f9e83fbe35c285b0be674a6b9da0830bd6 100644 |
--- a/ios/chrome/browser/ui/stack_view/stack_view_toolbar_controller.mm |
+++ b/ios/chrome/browser/ui/stack_view/stack_view_toolbar_controller.mm |
@@ -12,6 +12,10 @@ |
#include "ios/chrome/browser/ui/toolbar/new_tab_button.h" |
#import "ios/chrome/browser/ui/uikit_ui_util.h" |
+#if !defined(__has_feature) || !__has_feature(objc_arc) |
+#error "This file requires ARC support." |
+#endif |
+ |
using base::UserMetricsAction; |
namespace { |
@@ -21,19 +25,19 @@ const CGFloat kBackgroundViewColorAlpha = 0.95; |
} |
@implementation StackViewToolbarController { |
- base::scoped_nsobject<UIView> _stackViewToolbar; |
- base::scoped_nsobject<NewTabButton> _openNewTabButton; |
+ UIView* _stackViewToolbar; |
+ NewTabButton* _openNewTabButton; |
} |
- (instancetype)initWithStackViewToolbar { |
self = [super initWithStyle:ToolbarControllerStyleDarkMode]; |
if (self) { |
- _stackViewToolbar.reset( |
- [[UIView alloc] initWithFrame:[self specificControlsArea]]); |
+ _stackViewToolbar = |
+ [[UIView alloc] initWithFrame:[self specificControlsArea]]; |
[_stackViewToolbar setAutoresizingMask:UIViewAutoresizingFlexibleHeight | |
UIViewAutoresizingFlexibleWidth]; |
- _openNewTabButton.reset([[NewTabButton alloc] initWithFrame:CGRectZero]); |
+ _openNewTabButton = [[NewTabButton alloc] initWithFrame:CGRectZero]; |
[_openNewTabButton |
setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin | |
@@ -61,11 +65,11 @@ const CGFloat kBackgroundViewColorAlpha = 0.95; |
} |
- (NewTabButton*)openNewTabButton { |
- return _openNewTabButton.get(); |
+ return _openNewTabButton; |
} |
- (IBAction)recordUserMetrics:(id)sender { |
- if (sender == _openNewTabButton.get()) |
+ if (sender == _openNewTabButton) |
base::RecordAction(UserMetricsAction("MobileToolbarStackViewNewTab")); |
else |
[super recordUserMetrics:sender]; |