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 @@ ...@@ -11,8 +11,8 @@
@interface ConfirmInfoBarController () @interface ConfirmInfoBarController ()
// Accesses the view. // Overrides superclass property.
- (ConfirmInfoBarView*)view; @property(nonatomic, readwrite) ConfirmInfoBarView* view;
// Action for any of the user defined buttons. // Action for any of the user defined buttons.
- (void)infoBarButtonDidPress:(id)sender; - (void)infoBarButtonDidPress:(id)sender;
......
...@@ -23,8 +23,8 @@ class InfoBarControllerDelegate; ...@@ -23,8 +23,8 @@ class InfoBarControllerDelegate;
// Removes the view. // Removes the view.
- (void)removeView; - (void)removeView;
// Accesses the view. // The view.
- (UIView*)view; @property(nonatomic, readonly) UIView* view;
@property(nonatomic, assign) InfoBarControllerDelegate* delegate; // weak @property(nonatomic, assign) InfoBarControllerDelegate* delegate; // weak
......
...@@ -13,13 +13,12 @@ ...@@ -13,13 +13,12 @@
#error "This file requires ARC support." #error "This file requires ARC support."
#endif #endif
@interface InfoBarController () { @interface InfoBarController ()
UIView* _infoBarView;
}
@end @end
@implementation InfoBarController @implementation InfoBarController
@synthesize view = _view;
@synthesize delegate = _delegate; @synthesize delegate = _delegate;
@synthesize infoBarDelegate = _infoBarDelegate; @synthesize infoBarDelegate = _infoBarDelegate;
...@@ -30,21 +29,17 @@ ...@@ -30,21 +29,17 @@
self = [super init]; self = [super init];
if (self) { if (self) {
_infoBarDelegate = infoBarDelegate; _infoBarDelegate = infoBarDelegate;
_infoBarView = [self infobarView]; _view = [self infobarView];
} }
return self; return self;
} }
- (void)dealloc { - (void)dealloc {
[_infoBarView removeFromSuperview]; [_view removeFromSuperview];
}
- (UIView*)view {
return _infoBarView;
} }
- (void)removeView { - (void)removeView {
[_infoBarView removeFromSuperview]; [_view removeFromSuperview];
} }
- (void)detachView { - (void)detachView {
...@@ -56,7 +51,7 @@ ...@@ -56,7 +51,7 @@
- (UIView*)infobarView { - (UIView*)infobarView {
NOTREACHED() << "Must be overriden in subclasses."; NOTREACHED() << "Must be overriden in subclasses.";
return _infoBarView; return _view;
} }
- (BOOL)shouldIgnoreUserInteraction { - (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