Chromium Code Reviews| Index: ui/message_center/views/notification_view.cc |
| diff --git a/ui/message_center/views/notification_view.cc b/ui/message_center/views/notification_view.cc |
| index be77657f6e0dc522854ebeffeaff888419488b41..21127737e66ac7a2fbda3f84cb3621fc5aa6bb1a 100644 |
| --- a/ui/message_center/views/notification_view.cc |
| +++ b/ui/message_center/views/notification_view.cc |
| @@ -532,7 +532,9 @@ void NotificationView::CreateOrUpdateTitleView( |
| int padding = kTitleLineHeight - font_list.GetHeight(); |
| title_view_ = new BoundedLabel( |
| - gfx::TruncateString(notification.title(), title_character_limit), |
| + gfx::TruncateString(notification.title(), |
|
msw
2014/07/21 15:26:07
nit: init a shared local |title| string outside th
Marc Treib
2014/07/21 16:43:52
Done.
|
| + title_character_limit, |
| + gfx::WORD_BREAK), |
| font_list); |
| title_view_->SetLineHeight(kTitleLineHeight); |
| title_view_->SetLineLimit(kMaxTitleLines); |
| @@ -542,7 +544,9 @@ void NotificationView::CreateOrUpdateTitleView( |
| top_view_->AddChildView(title_view_); |
| } else { |
| title_view_->SetText( |
| - gfx::TruncateString(notification.title(), title_character_limit)); |
| + gfx::TruncateString(notification.title(), |
| + title_character_limit, |
| + gfx::WORD_BREAK)); |
| } |
| } |
| @@ -561,16 +565,18 @@ void NotificationView::CreateOrUpdateMessageView( |
| if (!message_view_) { |
| int padding = kMessageLineHeight - views::Label().font_list().GetHeight(); |
| - message_view_ = new BoundedLabel( |
| - gfx::TruncateString(notification.message(), kMessageCharacterLimit)); |
| + message_view_ = new BoundedLabel(gfx::TruncateString(notification.message(), |
|
msw
2014/07/21 15:26:07
ditto
Marc Treib
2014/07/21 16:43:52
Done.
|
| + kMessageCharacterLimit, |
| + gfx::WORD_BREAK)); |
| message_view_->SetLineHeight(kMessageLineHeight); |
| message_view_->SetColors(message_center::kRegularTextColor, |
| kDimTextBackgroundColor); |
| message_view_->SetBorder(MakeTextBorder(padding, 4, 0)); |
| top_view_->AddChildView(message_view_); |
| } else { |
| - message_view_->SetText( |
| - gfx::TruncateString(notification.message(), kMessageCharacterLimit)); |
| + message_view_->SetText(gfx::TruncateString(notification.message(), |
| + kMessageCharacterLimit, |
| + gfx::WORD_BREAK)); |
| } |
| message_view_->SetVisible(!notification.items().size()); |
| @@ -591,8 +597,10 @@ void NotificationView::CreateOrUpdateContextMessageView( |
| if (!context_message_view_) { |
| int padding = kMessageLineHeight - views::Label().font_list().GetHeight(); |
| - context_message_view_ = new BoundedLabel(gfx::TruncateString( |
| - notification.context_message(), kContextMessageCharacterLimit)); |
| + context_message_view_ = |
| + new BoundedLabel(gfx::TruncateString(notification.context_message(), |
|
msw
2014/07/21 15:26:07
ditto
Marc Treib
2014/07/21 16:43:52
Done.
|
| + kContextMessageCharacterLimit, |
| + gfx::WORD_BREAK)); |
| context_message_view_->SetLineLimit( |
| message_center::kContextMessageLineLimit); |
| context_message_view_->SetLineHeight(kMessageLineHeight); |
| @@ -601,8 +609,10 @@ void NotificationView::CreateOrUpdateContextMessageView( |
| context_message_view_->SetBorder(MakeTextBorder(padding, 4, 0)); |
| top_view_->AddChildView(context_message_view_); |
| } else { |
| - context_message_view_->SetText(gfx::TruncateString( |
| - notification.context_message(), kContextMessageCharacterLimit)); |
| + context_message_view_->SetText( |
| + gfx::TruncateString(notification.context_message(), |
| + kContextMessageCharacterLimit, |
| + gfx::WORD_BREAK)); |
| } |
| } |