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

Unified Diff: ios/chrome/browser/ui/stack_view/stack_view_toolbar_controller.mm

Issue 2944443003: [ObjC ARC] Converts ios/chrome/browser/ui/stack_view:stack_view to ARC. (Closed)
Patch Set: Add and use explicit disconnect in CardSet. Created 3 years, 6 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/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];
« no previous file with comments | « ios/chrome/browser/ui/stack_view/stack_view_controller_private.h ('k') | ios/chrome/browser/ui/stack_view/title_label.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698