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/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_constants.h" | 9 #include "ui/message_center/message_center_constants.h" |
10 #include "ui/message_center/notification.h" | 10 #include "ui/message_center/notification.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 NotificationList::PopupNotifications popups = | 153 NotificationList::PopupNotifications popups = |
154 message_center()->notification_list()->GetPopupNotifications(); | 154 message_center()->notification_list()->GetPopupNotifications(); |
155 | 155 |
156 if (popups.size() == 0) { | 156 if (popups.size() == 0) { |
157 if (bubble_view()) | 157 if (bubble_view()) |
158 bubble_view()->delegate()->HideBubble(bubble_view()); // deletes |this| | 158 bubble_view()->delegate()->HideBubble(bubble_view()); // deletes |this| |
159 return; | 159 return; |
160 } | 160 } |
161 | 161 |
162 contents_view_->Update(popups); | 162 contents_view_->Update(popups); |
163 bubble_view()->Show(); | 163 bubble_view()->GetWidget()->Show(); |
164 bubble_view()->UpdateBubble(); | 164 bubble_view()->UpdateBubble(); |
165 | 165 |
166 std::set<std::string> old_popup_ids; | 166 std::set<std::string> old_popup_ids; |
167 old_popup_ids.swap(popup_ids_); | 167 old_popup_ids.swap(popup_ids_); |
168 | 168 |
169 // Start autoclose timers. | 169 // Start autoclose timers. |
170 for (NotificationList::PopupNotifications::const_iterator iter = | 170 for (NotificationList::PopupNotifications::const_iterator iter = |
171 popups.begin(); | 171 popups.begin(); |
172 iter != popups.end(); ++iter) { | 172 iter != popups.end(); ++iter) { |
173 std::string id = (*iter)->id(); | 173 std::string id = (*iter)->id(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 scoped_ptr<AutocloseTimer> release_timer(iter->second); | 216 scoped_ptr<AutocloseTimer> release_timer(iter->second); |
217 autoclose_timers_.erase(iter); | 217 autoclose_timers_.erase(iter); |
218 } | 218 } |
219 } | 219 } |
220 | 220 |
221 size_t MessagePopupBubble::NumMessageViewsForTest() const { | 221 size_t MessagePopupBubble::NumMessageViewsForTest() const { |
222 return contents_view_->NumMessageViews(); | 222 return contents_view_->NumMessageViews(); |
223 } | 223 } |
224 | 224 |
225 } // namespace message_center | 225 } // namespace message_center |
OLD | NEW |