Commit df8b70f7 authored by Moe Ahmadi's avatar Moe Ahmadi Committed by Commit Bot

[IOS] Replaces InfobarController's view accessor with readonly property

Bug: 892376
Change-Id: I6f3a802cb11eb18f6470b35d70f683a7b0c9abaa
Reviewed-on: https://chromium-review.googlesource.com/c/1335879Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610102}
parent 063ed10c
......@@ -11,8 +11,8 @@
@interface ConfirmInfoBarController ()
// Accesses the view.
- (ConfirmInfoBarView*)view;
// Overrides superclass property.
@property(nonatomic, readwrite) ConfirmInfoBarView* view;
// Action for any of the user defined buttons.
- (void)infoBarButtonDidPress:(id)sender;
......
......@@ -23,8 +23,8 @@ class InfoBarControllerDelegate;
// Removes the view.
- (void)removeView;
// Accesses the view.
- (UIView*)view;
// The view.
@property(nonatomic, readonly) UIView* view;
@property(nonatomic, assign) InfoBarControllerDelegate* delegate; // weak
......
......@@ -13,13 +13,12 @@
#error "This file requires ARC support."
#endif
@interface InfoBarController () {
UIView* _infoBarView;
}
@interface InfoBarController ()
@end
@implementation InfoBarController
@synthesize view = _view;
@synthesize delegate = _delegate;
@synthesize infoBarDelegate = _infoBarDelegate;
......@@ -30,21 +29,17 @@
self = [super init];
if (self) {
_infoBarDelegate = infoBarDelegate;
_infoBarView = [self infobarView];
_view = [self infobarView];
}
return self;
}
- (void)dealloc {
[_infoBarView removeFromSuperview];
}
- (UIView*)view {
return _infoBarView;
[_view removeFromSuperview];
}
- (void)removeView {
[_infoBarView removeFromSuperview];
[_view removeFromSuperview];
}
- (void)detachView {
......@@ -56,7 +51,7 @@
- (UIView*)infobarView {
NOTREACHED() << "Must be overriden in subclasses.";
return _infoBarView;
return _view;
}
- (BOOL)shouldIgnoreUserInteraction {
......
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