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

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

Issue 15071002: WIP - loop in LayoutManager for preferred size changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: scoped layouter Created 7 years, 7 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 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/message_popup_bubble.h" 5 #include "ui/message_center/views/message_popup_bubble.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "ui/message_center/message_center.h" 9 #include "ui/message_center/message_center.h"
10 #include "ui/message_center/message_center_style.h" 10 #include "ui/message_center/message_center_style.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 for (NotificationList::PopupNotifications::const_iterator iter = 60 for (NotificationList::PopupNotifications::const_iterator iter =
61 popup_notifications.begin(); 61 popup_notifications.begin();
62 iter != popup_notifications.end(); ++iter) { 62 iter != popup_notifications.end(); ++iter) {
63 // NotificationViews are expanded by default here because MessagePopupBubble 63 // NotificationViews are expanded by default here because MessagePopupBubble
64 // hasn't been tested yet with changing subview sizes, and such changes 64 // hasn't been tested yet with changing subview sizes, and such changes
65 // could come if those subviews were initially collapsed and allowed to be 65 // could come if those subviews were initially collapsed and allowed to be
66 // expanded by users. TODO(dharcourt): Fix. 66 // expanded by users. TODO(dharcourt): Fix.
67 content_->AddChildView( 67 content_->AddChildView(
68 NotificationView::Create(*(*iter), message_center_, true)); 68 NotificationView::Create(*(*iter), message_center_, true));
69 } 69 }
70 content_->SizeToPreferredSize(); 70 views::ScopedMaybeLayout layout(content_);
71 content_->InvalidateLayout(); 71 // content_->SizeToPreferredSize();
72 // content_->InvalidateLayout();
72 Layout(); 73 Layout();
73 if (GetWidget()) 74 if (GetWidget())
74 GetWidget()->GetRootView()->SchedulePaint(); 75 GetWidget()->GetRootView()->SchedulePaint();
75 } 76 }
76 77
77 // The timer to call OnAutoClose for |notification|. 78 // The timer to call OnAutoClose for |notification|.
78 class MessagePopupBubble::AutocloseTimer { 79 class MessagePopupBubble::AutocloseTimer {
79 public: 80 public:
80 AutocloseTimer(Notification* notification, MessagePopupBubble* bubble); 81 AutocloseTimer(Notification* notification, MessagePopupBubble* bubble);
81 82
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 scoped_ptr<AutocloseTimer> release_timer(iter->second); 229 scoped_ptr<AutocloseTimer> release_timer(iter->second);
229 autoclose_timers_.erase(iter); 230 autoclose_timers_.erase(iter);
230 } 231 }
231 } 232 }
232 233
233 size_t MessagePopupBubble::NumMessageViewsForTest() const { 234 size_t MessagePopupBubble::NumMessageViewsForTest() const {
234 return contents_view_->NumMessageViews(); 235 return contents_view_->NumMessageViews();
235 } 236 }
236 237
237 } // namespace message_center 238 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/views/message_center_view.cc ('k') | ui/views/controls/button/label_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698