| 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( | 337 set_accessible_name(JoinString(accessible_lines, '\n')); |
| 338 base::JoinString(accessible_lines, base::ASCIIToUTF16("\n"))); | |
| 339 } | 338 } |
| 340 | 339 |
| 341 NotificationView::NotificationView(MessageCenterController* controller, | 340 NotificationView::NotificationView(MessageCenterController* controller, |
| 342 const Notification& notification) | 341 const Notification& notification) |
| 343 : MessageView(this, | 342 : MessageView(this, |
| 344 notification.id(), | 343 notification.id(), |
| 345 notification.notifier_id(), | 344 notification.notifier_id(), |
| 346 notification.small_image().AsImageSkia(), | 345 notification.small_image().AsImageSkia(), |
| 347 notification.display_source()), | 346 notification.display_source()), |
| 348 controller_(controller), | 347 controller_(controller), |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 | 785 |
| 787 return message_line_limit; | 786 return message_line_limit; |
| 788 } | 787 } |
| 789 | 788 |
| 790 int NotificationView::GetMessageHeight(int width, int limit) const { | 789 int NotificationView::GetMessageHeight(int width, int limit) const { |
| 791 return message_view_ ? | 790 return message_view_ ? |
| 792 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; | 791 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; |
| 793 } | 792 } |
| 794 | 793 |
| 795 } // namespace message_center | 794 } // namespace message_center |
| OLD | NEW |