Commit 899fc1d7 authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Make isFullScreen a property in BadgeItem

Bug: 976901
Change-Id: Ie956e580d406832b559815ca7a0fc8dabc2c30ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1830299
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701354}
parent 3ad7bd04
......@@ -22,6 +22,8 @@
@synthesize tappable = _tappable;
// Synthesized from BadgeItem.
@synthesize badgeState = _badgeState;
// Synthesized from BadgeItem.
@synthesize fullScreen = _fullScreen;
- (instancetype)initWithInfobarType:(InfobarType)type {
self = [super init];
......@@ -29,6 +31,7 @@
_tappable = YES;
_infobarType = type;
_badgeState = BadgeStateNone;
_fullScreen = NO;
}
return self;
}
......@@ -47,8 +50,4 @@
}
}
- (BOOL)isFullScreen {
return NO;
}
@end
......@@ -27,7 +27,7 @@ typedef NS_OPTIONS(NSUInteger, BadgeState) {
- (BadgeType)badgeType;
// Whether the badge should be displayed in the fullScreenBadge position. If
// YES, it will be displayed in both FullScreen and non FullScreen.
- (BOOL)isFullScreen;
@property(nonatomic, assign, readonly) BOOL fullScreen;
// Some badges may not be tappable if there is no action associated with it.
@property(nonatomic, assign, readonly, getter=isTappable) BOOL tappable;
// The BadgeState of the badge.
......
......@@ -145,7 +145,7 @@ const int kMinimumNonFullScreenBadgesForOverflow = 2;
[[NSMutableArray alloc] init];
// Get all non-fullscreen badges.
for (id<BadgeItem> item in self.badges) {
if (![item isFullScreen]) {
if (!item.fullScreen) {
[popupMenuBadges addObject:item];
}
}
......@@ -195,7 +195,7 @@ const int kMinimumNonFullScreenBadgesForOverflow = 2;
// displayedBadge if there are multiple badges.
id<BadgeItem> presentingBadge;
for (id<BadgeItem> item in self.badges) {
if ([item isFullScreen]) {
if (item.fullScreen) {
fullScreenBadge = item;
} else {
if (item.badgeState == BadgeStatePresented) {
......
......@@ -22,6 +22,8 @@
@synthesize tappable = _tappable;
// Sythesized from protocol.
@synthesize badgeState = _badgeState;
// Synthesized from BadgeItem.
@synthesize fullScreen = _fullScreen;
- (instancetype)initWithBadgeType:(BadgeType)badgeType {
self = [super init];
......@@ -29,6 +31,7 @@
_badgeType = badgeType;
_tappable = NO;
_badgeState = BadgeStateNone;
_fullScreen = badgeType == BadgeType::kBadgeTypeIncognito;
}
return self;
}
......@@ -39,8 +42,4 @@
return _badgeType;
}
- (BOOL)isFullScreen {
return self.badgeType == BadgeType::kBadgeTypeIncognito;
}
@end
......@@ -22,6 +22,8 @@
@synthesize tappable = _tappable;
// Synthesized from protocol.
@synthesize badgeState = _badgeState;
// Synthesized from BadgeItem.
@synthesize fullScreen = _fullScreen;
- (instancetype)initWithBadgeType:(BadgeType)badgeType {
self = [super init];
......@@ -29,14 +31,9 @@
_badgeType = badgeType;
_tappable = YES;
_badgeState = BadgeStateNone;
_fullScreen = NO;
}
return self;
}
#pragma mark - BadgeItem
- (BOOL)isFullScreen {
return NO;
}
@end
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