Chromium Code Reviews| Index: ui/message_center/cocoa/notification_controller.mm |
| diff --git a/ui/message_center/cocoa/notification_controller.mm b/ui/message_center/cocoa/notification_controller.mm |
| index 5f642eb9f651247f75d2664bb2f8c7856eaffa84..ead8fc7f552a022f780ad1b3e8b602f2d778aa7f 100644 |
| --- a/ui/message_center/cocoa/notification_controller.mm |
| +++ b/ui/message_center/cocoa/notification_controller.mm |
| @@ -343,10 +343,13 @@ |
| message_center::kTextTopPadding - messageBottomGap - contextMessageTopGap; |
| // Set the title and recalculate the frame. |
| - [title_ setString:base::SysUTF16ToNSString( |
| - [self wrapText:notification_->title() |
| - forFont:[title_ font] |
| - maxNumberOfLines:message_center::kTitleLineLimit])]; |
| + int titleLineLimit = notification_->message().empty() |
| + ? message_center::kTitleNoMessageLineLimit |
| + : message_center::kTitleLineLimit; |
| + [title_ |
| + setString:base::SysUTF16ToNSString([self wrapText:notification_->title() |
|
Robert Sesek
2014/04/28 20:49:28
You probably clang-formatted this, but it looks wr
dewittj
2014/04/28 21:05:32
Done.
This is not actually churn just for the sak
Robert Sesek
2014/04/28 21:07:29
Yeah, I think the ObjC formatter is less-tested/us
|
| + forFont:[title_ font] |
| + maxNumberOfLines:titleLineLimit])]; |
| [title_ sizeToFit]; |
| NSRect titleFrame = [title_ frame]; |
| titleFrame.origin.y = NSMaxY(rootFrame) - titlePadding - NSHeight(titleFrame); |
| @@ -362,7 +365,10 @@ |
| // If there are list items, then the message_ view should not be displayed. |
| const std::vector<message_center::NotificationItem>& items = |
| notification->items(); |
| - if (items.size() > 0) { |
| + // If there are list items, don't show the main message. Also if the message |
| + // is empty, mark it as hidden and set 0 hight, so it doesn't take up any |
|
Robert Sesek
2014/04/28 20:49:28
nit: height
dewittj
2014/04/28 21:05:32
Done.
|
| + // space (size to fit leaves it 15 px tall. |
| + if (items.size() > 0 || notification_->message().empty()) { |
| [message_ setHidden:YES]; |
| messageFrame.origin.y = titleFrame.origin.y; |
| messageFrame.size.height = 0; |