Set multi-line attribute on the label before call SizeToFit to avoid DCHECK-ing.

BUG=252667
TEST=No dchecking on calls to LabelTrayView::CreateChildView from ChromeOS.
TBR=sadrul@chromium.org

Review URL: https://chromiumcodereview.appspot.com/17550003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207915 0039d316-1c4b-4281-b951-d872f2087c98
parent ef19fb90
...@@ -50,13 +50,14 @@ views::View* LabelTrayView::CreateChildView( ...@@ -50,13 +50,14 @@ views::View* LabelTrayView::CreateChildView(
child->set_border( child->set_border(
views::Border::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, views::Border::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal,
0, kTrayPopupPaddingHorizontal)); 0, kTrayPopupPaddingHorizontal));
child->text_label()->SetMultiLine(true);
child->text_label()->SizeToFit(kTrayNotificationContentsWidth); child->text_label()->SizeToFit(kTrayNotificationContentsWidth);
} else { } else {
child->AddLabel(message, gfx::Font::NORMAL); child->AddLabel(message, gfx::Font::NORMAL);
child->text_label()->SetMultiLine(true);
child->text_label()->SizeToFit(kTrayNotificationContentsWidth + child->text_label()->SizeToFit(kTrayNotificationContentsWidth +
kNotificationIconWidth); kNotificationIconWidth);
} }
child->text_label()->SetMultiLine(true);
child->text_label()->SetAllowCharacterBreak(true); child->text_label()->SetAllowCharacterBreak(true);
child->SetExpandable(true); child->SetExpandable(true);
child->SetVisible(true); child->SetVisible(true);
......
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