OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/message_center/views/notification_view.h" | 5 #include "ui/message_center/views/notification_view.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 void NotificationView::SetAccessibleName(const Notification& notification) { | 327 void NotificationView::SetAccessibleName(const Notification& notification) { |
328 std::vector<base::string16> accessible_lines; | 328 std::vector<base::string16> accessible_lines; |
329 accessible_lines.push_back(notification.title()); | 329 accessible_lines.push_back(notification.title()); |
330 accessible_lines.push_back(notification.message()); | 330 accessible_lines.push_back(notification.message()); |
331 accessible_lines.push_back(notification.context_message()); | 331 accessible_lines.push_back(notification.context_message()); |
332 std::vector<NotificationItem> items = notification.items(); | 332 std::vector<NotificationItem> items = notification.items(); |
333 for (size_t i = 0; i < items.size() && i < kNotificationMaximumItems; ++i) { | 333 for (size_t i = 0; i < items.size() && i < kNotificationMaximumItems; ++i) { |
334 accessible_lines.push_back(items[i].title + base::ASCIIToUTF16(" ") + | 334 accessible_lines.push_back(items[i].title + base::ASCIIToUTF16(" ") + |
335 items[i].message); | 335 items[i].message); |
336 } | 336 } |
337 set_accessible_name(JoinString(accessible_lines, '\n')); | 337 set_accessible_name( |
| 338 base::JoinString(accessible_lines, base::ASCIIToUTF16("\n"))); |
338 } | 339 } |
339 | 340 |
340 NotificationView::NotificationView(MessageCenterController* controller, | 341 NotificationView::NotificationView(MessageCenterController* controller, |
341 const Notification& notification) | 342 const Notification& notification) |
342 : MessageView(this, | 343 : MessageView(this, |
343 notification.id(), | 344 notification.id(), |
344 notification.notifier_id(), | 345 notification.notifier_id(), |
345 notification.small_image().AsImageSkia(), | 346 notification.small_image().AsImageSkia(), |
346 notification.display_source()), | 347 notification.display_source()), |
347 controller_(controller), | 348 controller_(controller), |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 | 786 |
786 return message_line_limit; | 787 return message_line_limit; |
787 } | 788 } |
788 | 789 |
789 int NotificationView::GetMessageHeight(int width, int limit) const { | 790 int NotificationView::GetMessageHeight(int width, int limit) const { |
790 return message_view_ ? | 791 return message_view_ ? |
791 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; | 792 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; |
792 } | 793 } |
793 | 794 |
794 } // namespace message_center | 795 } // namespace message_center |
OLD | NEW |