Commit bed6b883 authored by yoshiki iguchi's avatar yoshiki iguchi Committed by Commit Bot

Fix memory leak whthout lock screen notification on NotificationHiddenView

If the lock screen notification is disabled, NotificationHiddenView had
a leak. This CL fixes that.

Bug: None
Change-Id: I0ddb2a37777849c44ac19e4398ea88369fcb4a08
Reviewed-on: https://chromium-review.googlesource.com/1208694Reviewed-by: default avatarTatsuhisa Yamaguchi <yamaguchi@chromium.org>
Commit-Queue: Yoshiki Iguchi <yoshiki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589113}
parent d57ab4ca
......@@ -32,12 +32,6 @@ NotificationHiddenView::NotificationHiddenView() {
label->SetLineHeight(kUnifiedNotificationHiddenLineHeight);
label->SetBorder(views::CreateEmptyBorder(kUnifiedNotificationHiddenPadding));
auto* clear_all_button = new RoundedLabelButton(
this,
l10n_util::GetStringUTF16(IDS_ASH_MESSAGE_CENTER_LOCKSCREEN_CHANGE));
clear_all_button->SetTooltipText(l10n_util::GetStringUTF16(
IDS_ASH_MESSAGE_CENTER_LOCKSCREEN_CHANGE_TOOLTIP));
auto* container = new views::View;
container->SetBackground(views::CreateBackgroundFromPainter(
views::Painter::CreateSolidRoundRectPainter(kUnifiedMenuButtonColor,
......@@ -48,8 +42,15 @@ NotificationHiddenView::NotificationHiddenView() {
container->AddChildView(label);
layout->SetFlexForView(label, 1);
if (lock_screen_notification_enabled) {
container->AddChildView(clear_all_button);
auto* change_button = new RoundedLabelButton(
this,
l10n_util::GetStringUTF16(IDS_ASH_MESSAGE_CENTER_LOCKSCREEN_CHANGE));
change_button->SetTooltipText(l10n_util::GetStringUTF16(
IDS_ASH_MESSAGE_CENTER_LOCKSCREEN_CHANGE_TOOLTIP));
container->AddChildView(change_button);
}
SetBorder(
......
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