| 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/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 | 615 |
| 616 void NotificationView::ClickOnNotification(const std::string& notification_id) { | 616 void NotificationView::ClickOnNotification(const std::string& notification_id) { |
| 617 controller_->ClickOnNotification(notification_id); | 617 controller_->ClickOnNotification(notification_id); |
| 618 } | 618 } |
| 619 | 619 |
| 620 void NotificationView::RemoveNotification(const std::string& notification_id, | 620 void NotificationView::RemoveNotification(const std::string& notification_id, |
| 621 bool by_user) { | 621 bool by_user) { |
| 622 controller_->RemoveNotification(notification_id, by_user); | 622 controller_->RemoveNotification(notification_id, by_user); |
| 623 } | 623 } |
| 624 | 624 |
| 625 void NotificationView::DisableNotificationsFromThisSource( | |
| 626 const NotifierId& notifier_id) { | |
| 627 controller_->DisableNotificationsFromThisSource(notifier_id); | |
| 628 } | |
| 629 | |
| 630 void NotificationView::ShowNotifierSettingsBubble() { | |
| 631 controller_->ShowNotifierSettingsBubble(); | |
| 632 } | |
| 633 | |
| 634 bool NotificationView::IsExpansionNeeded(int width) { | 625 bool NotificationView::IsExpansionNeeded(int width) { |
| 635 return (!is_expanded_ && | 626 return (!is_expanded_ && |
| 636 (image_view_ || | 627 (image_view_ || |
| 637 item_views_.size() || | 628 item_views_.size() || |
| 638 IsMessageExpansionNeeded(width))); | 629 IsMessageExpansionNeeded(width))); |
| 639 } | 630 } |
| 640 | 631 |
| 641 bool NotificationView::IsMessageExpansionNeeded(int width) { | 632 bool NotificationView::IsMessageExpansionNeeded(int width) { |
| 642 int current = GetMessageLines(width, GetMessageLineLimit(width)); | 633 int current = GetMessageLines(width, GetMessageLineLimit(width)); |
| 643 int expanded = GetMessageLines(width, | 634 int expanded = GetMessageLines(width, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 668 return message_view_ ? | 659 return message_view_ ? |
| 669 message_view_->GetLinesForWidthAndLimit(width, limit) : 0; | 660 message_view_->GetLinesForWidthAndLimit(width, limit) : 0; |
| 670 } | 661 } |
| 671 | 662 |
| 672 int NotificationView::GetMessageHeight(int width, int limit) { | 663 int NotificationView::GetMessageHeight(int width, int limit) { |
| 673 return message_view_ ? | 664 return message_view_ ? |
| 674 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; | 665 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; |
| 675 } | 666 } |
| 676 | 667 |
| 677 } // namespace message_center | 668 } // namespace message_center |
| OLD | NEW |