Commit a718f913 authored by Peter K. Lee's avatar Peter K. Lee Committed by Commit Bot

Changed button type to UIButtonTypeSystem to get default treatment

This gives the image button a pressed state provided by the system.

Bug: 848879
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I8912e4cf438a57f27bf432ccb0b1bec10146672c
Reviewed-on: https://chromium-review.googlesource.com/1182669Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: Peter Lee <pkl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584741}
parent d07a4a17
......@@ -284,7 +284,9 @@ UIFont* InfoBarMessageFont() {
// Add the close button. The close button is fixed to the trailing edge of the
// infobar since it cannot expand.
DCHECK(self.closeButtonImage);
UIButton* closeButton = [UIButton buttonWithType:UIButtonTypeCustom];
UIButton* closeButton =
[UIButton buttonWithType:IsRefreshInfobarEnabled() ? UIButtonTypeSystem
: UIButtonTypeCustom];
closeButton.translatesAutoresizingMaskIntoConstraints = NO;
[closeButton setImage:self.closeButtonImage forState:UIControlStateNormal];
closeButton.contentEdgeInsets =
......
......@@ -777,7 +777,9 @@ UIImage* InfoBarCloseImage() {
action:(SEL)action {
DCHECK(!closeButton_);
UIImage* image = InfoBarCloseImage();
closeButton_ = [UIButton buttonWithType:UIButtonTypeCustom];
closeButton_ =
[UIButton buttonWithType:IsRefreshInfobarEnabled() ? UIButtonTypeSystem
: UIButtonTypeCustom];
[closeButton_ setExclusiveTouch:YES];
[closeButton_ setImage:image forState:UIControlStateNormal];
[closeButton_ addTarget:target
......
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