Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: ui/message_center/views/notification_view.cc

Issue 114323002: Fixes the context menu for a notification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix2 Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/message_center/views/notification_view.h ('k') | ui/message_center/views/toast_contents_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698