| Index: ui/message_center/views/custom_notification_view.cc
|
| diff --git a/ui/message_center/views/custom_notification_view.cc b/ui/message_center/views/custom_notification_view.cc
|
| index b3528679e22a823ac5110b4380df567cd9119dce..b94e7227364fc4e08c9259a98ee2d3b2a5f8a983 100644
|
| --- a/ui/message_center/views/custom_notification_view.cc
|
| +++ b/ui/message_center/views/custom_notification_view.cc
|
| @@ -20,18 +20,21 @@ CustomNotificationView::CustomNotificationView(
|
| : MessageView(controller, notification) {
|
| DCHECK_EQ(NOTIFICATION_TYPE_CUSTOM, notification.type());
|
|
|
| - contents_view_ = notification.delegate()->CreateCustomContent().release();
|
| + auto custom_content = notification.delegate()->CreateCustomContent();
|
| +
|
| + contents_view_ = custom_content->view.release();
|
| DCHECK(contents_view_);
|
| AddChildView(contents_view_);
|
|
|
| + contents_view_delegate_ = std::move(custom_content->delegate);
|
| + DCHECK(contents_view_delegate_);
|
| +
|
| if (contents_view_->background()) {
|
| background_view()->background()->SetNativeControlColor(
|
| contents_view_->background()->get_color());
|
| }
|
|
|
| AddChildView(small_image());
|
| -
|
| - CreateOrUpdateCloseButtonView(notification);
|
| }
|
|
|
| CustomNotificationView::~CustomNotificationView() {}
|
| @@ -44,6 +47,23 @@ void CustomNotificationView::SetDrawBackgroundAsActive(bool active) {
|
| MessageView::SetDrawBackgroundAsActive(active);
|
| }
|
|
|
| +bool CustomNotificationView::IsCloseButtonFocused() const {
|
| + if (!contents_view_delegate_)
|
| + return false;
|
| + return contents_view_delegate_->IsCloseButtonFocused();
|
| +}
|
| +
|
| +void CustomNotificationView::RequestFocusOnCloseButton() {
|
| + if (contents_view_delegate_)
|
| + contents_view_delegate_->RequestFocusOnCloseButton();
|
| +}
|
| +
|
| +bool CustomNotificationView::IsPinned() const {
|
| + if (!contents_view_delegate_)
|
| + return false;
|
| + return contents_view_delegate_->IsPinned();
|
| +}
|
| +
|
| gfx::Size CustomNotificationView::GetPreferredSize() const {
|
| const gfx::Insets insets = GetInsets();
|
| const int contents_width = kNotificationWidth - insets.width();
|
|
|