Commit 37868065 authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Remove Messages Badge selection logic

Removes circular background behind Messages badge that existed when
it was selected. Removes methods that only serve to toggle the selected
state of the badge.

Change-Id: I255b98290223c955d24abf4cf44aef7dabb36225
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1637592Reviewed-by: default avatarStepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666052}
parent b6167b44
...@@ -10,9 +10,6 @@ ...@@ -10,9 +10,6 @@
// A button for an Infobar that contains a badge image. // A button for an Infobar that contains a badge image.
@interface InfobarBadgeButton : ExtendedTouchTargetButton @interface InfobarBadgeButton : ExtendedTouchTargetButton
// Gives the badge a dark gray background if |selected| is YES. Removes the
// background if |selected| is NO. Will animate change if |animated| is YES.
- (void)setSelected:(BOOL)selected animated:(BOOL)animated;
// Sets the badge color to blue if |active| is YES, light gray if |active| is // Sets the badge color to blue if |active| is YES, light gray if |active| is
// NO. Will animate change if |animated| is YES. // NO. Will animate change if |animated| is YES.
- (void)setActive:(BOOL)active animated:(BOOL)animated; - (void)setActive:(BOOL)active animated:(BOOL)animated;
......
...@@ -15,8 +15,6 @@ namespace { ...@@ -15,8 +15,6 @@ namespace {
const CGFloat kButtonAnimationDuration = 0.2; const CGFloat kButtonAnimationDuration = 0.2;
// Edge insets of button. // Edge insets of button.
const CGFloat kButtonEdgeInset = 6; const CGFloat kButtonEdgeInset = 6;
// White value of the button background in a selected state.
const CGFloat kSelectedWhiteValue = 0.80;
// Tint color of the button in an active state. // Tint color of the button in an active state.
const CGFloat kActiveTintColor = 0x1A73E8; const CGFloat kActiveTintColor = 0x1A73E8;
// To achieve a circular corner radius, divide length of a side by 2. // To achieve a circular corner radius, divide length of a side by 2.
...@@ -50,21 +48,6 @@ const CGFloat kCircularCornerRadiusDivisor = 2.0; ...@@ -50,21 +48,6 @@ const CGFloat kCircularCornerRadiusDivisor = 2.0;
self.bounds.size.height / kCircularCornerRadiusDivisor; self.bounds.size.height / kCircularCornerRadiusDivisor;
} }
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
void (^changeBackgroundColor)() = ^{
self.backgroundColor =
selected ? [UIColor colorWithWhite:kSelectedWhiteValue alpha:1.0]
: [UIColor clearColor];
};
if (animated) {
[UIView animateWithDuration:kButtonAnimationDuration
animations:^{
changeBackgroundColor();
}];
} else {
changeBackgroundColor();
}
}
- (void)setActive:(BOOL)active animated:(BOOL)animated { - (void)setActive:(BOOL)active animated:(BOOL)animated {
void (^changeTintColor)() = ^{ void (^changeTintColor)() = ^{
self.tintColor = self.tintColor =
......
...@@ -39,11 +39,6 @@ ...@@ -39,11 +39,6 @@
// Infobar redesign. // Infobar redesign.
- (void)displayInfobarBadge:(BOOL)display type:(InfobarType)infobarType; - (void)displayInfobarBadge:(BOOL)display type:(InfobarType)infobarType;
// Notifies the consumer that the InfobarBadge select state has changed.
// TODO(crbug.com/935804): This method is currently only being used in the
// Infobar redesign.
- (void)selectInfobarBadge:(BOOL)select;
// Notifies the consumer that the InfobarBadge active state has changed. // Notifies the consumer that the InfobarBadge active state has changed.
// TODO(crbug.com/935804): This method is currently only being used in the // TODO(crbug.com/935804): This method is currently only being used in the
// Infobar redesign. // Infobar redesign.
......
...@@ -393,10 +393,6 @@ const int kLocationAuthorizationStatusCount = 4; ...@@ -393,10 +393,6 @@ const int kLocationAuthorizationStatusCount = 4;
metricsRecorder:metricsRecorder]; metricsRecorder:metricsRecorder];
} }
- (void)selectInfobarBadge:(BOOL)select {
[self.viewController setInfobarButtonStyleSelected:select];
}
- (void)activeInfobarBadge:(BOOL)active { - (void)activeInfobarBadge:(BOOL)active {
[self.viewController setInfobarButtonStyleActive:active]; [self.viewController setInfobarButtonStyleActive:active];
} }
......
...@@ -168,7 +168,6 @@ ...@@ -168,7 +168,6 @@
- (void)setBadgeState:(InfobarBadgeState)badgeState { - (void)setBadgeState:(InfobarBadgeState)badgeState {
_badgeState = badgeState; _badgeState = badgeState;
[self.consumer selectInfobarBadge:_badgeState & InfobarBadgeStateSelected];
[self.consumer activeInfobarBadge:_badgeState & InfobarBadgeStateAccepted]; [self.consumer activeInfobarBadge:_badgeState & InfobarBadgeStateAccepted];
} }
......
...@@ -81,11 +81,6 @@ ...@@ -81,11 +81,6 @@
// Infobar redesign. // Infobar redesign.
- (void)displayInfobarButton:(BOOL)display - (void)displayInfobarButton:(BOOL)display
metricsRecorder:(InfobarMetricsRecorder*)metricsRecorder; metricsRecorder:(InfobarMetricsRecorder*)metricsRecorder;
// If |selected| is YES applies the selected styling to the InfobarButton, if NO
// it removes it.
// TODO(crbug.com/935804): This method is currently only being used in the
// Infobar redesign.
- (void)setInfobarButtonStyleSelected:(BOOL)selected;
// If |active| is YES applies the active styling to the InfobarButton, if NO it // If |active| is YES applies the active styling to the InfobarButton, if NO it
// removes it. // removes it.
// TODO(crbug.com/935804): This method is currently only being used in the // TODO(crbug.com/935804): This method is currently only being used in the
......
...@@ -482,10 +482,6 @@ typedef NS_ENUM(int, TrailingButtonState) { ...@@ -482,10 +482,6 @@ typedef NS_ENUM(int, TrailingButtonState) {
[self.dispatcher displayModalInfobar]; [self.dispatcher displayModalInfobar];
} }
- (void)setInfobarButtonStyleSelected:(BOOL)selected {
[self.locationBarSteadyView.leadingButton setSelected:selected animated:YES];
}
- (void)setInfobarButtonStyleActive:(BOOL)active { - (void)setInfobarButtonStyleActive:(BOOL)active {
self.activeBadge = active; self.activeBadge = active;
[self.locationBarSteadyView.leadingButton setActive:active animated:YES]; [self.locationBarSteadyView.leadingButton setActive:active animated:YES];
......
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