Commit 95ce24e7 authored by sczs's avatar sczs Committed by Commit Bot

[ios] Uses ConfirmInfobarDelegate icon on Banner.

Uses the InfobarDelegate Icon to populate the Banner's icon.

Screenshot:
https://drive.google.com/open?id=1ig7tT72B6mFsqHtrAmDO5ANww6HKEGpj

Bug: 961343
Change-Id: If9b8cddfd41b3cef7bc45e7165234f543b3a681d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1857048Reviewed-by: default avatarChris Lu <thegreenfrog@chromium.org>
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705573}
parent 9aac7e89
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#import "ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator_implementation.h" #import "ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator_implementation.h"
#import "ios/chrome/browser/ui/infobars/infobar_container.h" #import "ios/chrome/browser/ui/infobars/infobar_container.h"
#import "ios/chrome/browser/ui/infobars/modals/infobar_modal_view_controller.h" #import "ios/chrome/browser/ui/infobars/modals/infobar_modal_view_controller.h"
#include "ui/gfx/image/image.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -60,6 +61,9 @@ ...@@ -60,6 +61,9 @@
self.bannerViewController.buttonText = self.bannerViewController.buttonText =
base::SysUTF16ToNSString(self.confirmInfobarDelegate->GetButtonLabel( base::SysUTF16ToNSString(self.confirmInfobarDelegate->GetButtonLabel(
ConfirmInfoBarDelegate::BUTTON_OK)); ConfirmInfoBarDelegate::BUTTON_OK));
gfx::Image modelIcon = self.confirmInfobarDelegate->GetIcon();
if (!modelIcon.IsEmpty())
self.bannerViewController.iconImage = modelIcon.ToUIImage();
} }
} }
......
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