| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 : NULL); | 625 : NULL); |
| 626 } | 626 } |
| 627 | 627 |
| 628 void NotificationView::CreateOrUpdateActionButtonViews( | 628 void NotificationView::CreateOrUpdateActionButtonViews( |
| 629 const Notification& notification) { | 629 const Notification& notification) { |
| 630 std::vector<ButtonInfo> buttons = notification.buttons(); | 630 std::vector<ButtonInfo> buttons = notification.buttons(); |
| 631 bool new_buttons = action_buttons_.size() != buttons.size(); | 631 bool new_buttons = action_buttons_.size() != buttons.size(); |
| 632 | 632 |
| 633 if (new_buttons || buttons.size() == 0) { | 633 if (new_buttons || buttons.size() == 0) { |
| 634 // STLDeleteElements also clears the container. | 634 // STLDeleteElements also clears the container. |
| 635 STLDeleteElements(&separators_); | 635 base::STLDeleteElements(&separators_); |
| 636 STLDeleteElements(&action_buttons_); | 636 base::STLDeleteElements(&action_buttons_); |
| 637 } | 637 } |
| 638 | 638 |
| 639 DCHECK(bottom_view_); | 639 DCHECK(bottom_view_); |
| 640 DCHECK_EQ(this, bottom_view_->parent()); | 640 DCHECK_EQ(this, bottom_view_->parent()); |
| 641 | 641 |
| 642 for (size_t i = 0; i < buttons.size(); ++i) { | 642 for (size_t i = 0; i < buttons.size(); ++i) { |
| 643 ButtonInfo button_info = buttons[i]; | 643 ButtonInfo button_info = buttons[i]; |
| 644 if (new_buttons) { | 644 if (new_buttons) { |
| 645 views::View* separator = new views::ImageView(); | 645 views::View* separator = new views::ImageView(); |
| 646 separator->SetBorder(MakeSeparatorBorder(1, 0, kButtonSeparatorColor)); | 646 separator->SetBorder(MakeSeparatorBorder(1, 0, kButtonSeparatorColor)); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 | 704 |
| 705 return message_line_limit; | 705 return message_line_limit; |
| 706 } | 706 } |
| 707 | 707 |
| 708 int NotificationView::GetMessageHeight(int width, int limit) const { | 708 int NotificationView::GetMessageHeight(int width, int limit) const { |
| 709 return message_view_ ? | 709 return message_view_ ? |
| 710 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; | 710 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; |
| 711 } | 711 } |
| 712 | 712 |
| 713 } // namespace message_center | 713 } // namespace message_center |
| OLD | NEW |