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

Unified Diff: ui/message_center/message_popup_bubble.cc

Issue 12326091: Made notification center notifications collapsed and expandable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased, which led to many changes. Created 7 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: ui/message_center/message_popup_bubble.cc
diff --git a/ui/message_center/message_popup_bubble.cc b/ui/message_center/message_popup_bubble.cc
index 8b271799d38ab4f91ca1f28d993b9caa773994e1..92e53b309a92648d31cbf2b960bc0d4b16193208 100644
--- a/ui/message_center/message_popup_bubble.cc
+++ b/ui/message_center/message_popup_bubble.cc
@@ -30,7 +30,7 @@ class PopupBubbleContentsView : public views::View {
}
private:
- NotificationList::Delegate* list_delegate_;
+ NotificationList::Delegate* list_delegate_; // Weak reference.
views::View* content_;
DISALLOW_COPY_AND_ASSIGN(PopupBubbleContentsView);
@@ -59,7 +59,12 @@ void PopupBubbleContentsView::Update(
for (NotificationList::PopupNotifications::const_iterator iter =
popup_notifications.begin();
iter != popup_notifications.end(); ++iter) {
- content_->AddChildView(NotificationView::Create(*(*iter), list_delegate_));
+ // NotificationViews are expanded by default here because MessagePopupBubble
+ // hasn't been tested yet with changing subview sizes, and such changes
+ // could come if those subviews were initially collapsed and allowed to be
+ // expanded by users. TODO(dharcourt): Fix.
+ content_->AddChildView(NotificationView::Create(*(*iter), list_delegate_,
+ true));
}
content_->SizeToPreferredSize();
content_->InvalidateLayout();
@@ -113,8 +118,8 @@ void MessagePopupBubble::AutocloseTimer::Suspend() {
}
// MessagePopupBubble
-MessagePopupBubble::MessagePopupBubble(NotificationList::Delegate* delegate)
- : MessageBubbleBase(delegate),
+MessagePopupBubble::MessagePopupBubble(MessageCenter* message_center)
+ : MessageBubbleBase(message_center),
contents_view_(NULL) {
}
@@ -135,7 +140,7 @@ views::TrayBubbleView::InitParams MessagePopupBubble::GetInitParams(
void MessagePopupBubble::InitializeContents(
views::TrayBubbleView* new_bubble_view) {
set_bubble_view(new_bubble_view);
- contents_view_ = new PopupBubbleContentsView(list_delegate());
+ contents_view_ = new PopupBubbleContentsView(message_center());
bubble_view()->AddChildView(contents_view_);
UpdateBubbleView();
}
@@ -146,7 +151,7 @@ void MessagePopupBubble::OnBubbleViewDestroyed() {
void MessagePopupBubble::UpdateBubbleView() {
NotificationList::PopupNotifications popups =
- list_delegate()->GetNotificationList()->GetPopupNotifications();
+ message_center()->notification_list()->GetPopupNotifications();
if (popups.size() == 0) {
if (bubble_view())
@@ -200,7 +205,7 @@ void MessagePopupBubble::OnMouseExitedView() {
void MessagePopupBubble::OnAutoClose(const std::string& id) {
DeleteTimer(id);
- list_delegate()->GetNotificationList()->MarkSinglePopupAsShown(id, false);
+ message_center()->notification_list()->MarkSinglePopupAsShown(id, false);
UpdateBubbleView();
}

Powered by Google App Engine
This is Rietveld 408576698