OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_collection.h" | 5 #include "ui/message_center/views/message_popup_collection.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 | 95 |
96 MessagePopupCollection::~MessagePopupCollection() { | 96 MessagePopupCollection::~MessagePopupCollection() { |
97 weak_factory_.InvalidateWeakPtrs(); | 97 weak_factory_.InvalidateWeakPtrs(); |
98 | 98 |
99 gfx::Screen* screen = parent_ ? | 99 gfx::Screen* screen = parent_ ? |
100 gfx::Screen::GetScreenFor(parent_) : gfx::Screen::GetNativeScreen(); | 100 gfx::Screen::GetScreenFor(parent_) : gfx::Screen::GetNativeScreen(); |
101 screen->RemoveObserver(this); | 101 screen->RemoveObserver(this); |
102 message_center_->RemoveObserver(this); | 102 message_center_->RemoveObserver(this); |
103 | 103 |
| 104 CloseAllWidgets(); |
| 105 } |
| 106 |
| 107 void MessagePopupCollection::MarkAllPopupsShown() { |
104 std::set<std::string> closed_ids = CloseAllWidgets(); | 108 std::set<std::string> closed_ids = CloseAllWidgets(); |
105 for (std::set<std::string>::iterator iter = closed_ids.begin(); | 109 for (std::set<std::string>::iterator iter = closed_ids.begin(); |
106 iter != closed_ids.end(); iter++) { | 110 iter != closed_ids.end(); iter++) { |
107 message_center_->MarkSinglePopupAsShown(*iter, false); | 111 message_center_->MarkSinglePopupAsShown(*iter, false); |
108 } | 112 } |
109 } | 113 } |
110 | 114 |
111 void MessagePopupCollection::UpdateWidgets() { | 115 void MessagePopupCollection::UpdateWidgets() { |
112 NotificationList::PopupNotifications popups = | 116 NotificationList::PopupNotifications popups = |
113 message_center_->GetPopupNotifications(); | 117 message_center_->GetPopupNotifications(); |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 views::Widget* widget = (*iter)->GetWidget(); | 575 views::Widget* widget = (*iter)->GetWidget(); |
572 if (widget) | 576 if (widget) |
573 return widget->GetWindowBoundsInScreen(); | 577 return widget->GetWindowBoundsInScreen(); |
574 break; | 578 break; |
575 } | 579 } |
576 } | 580 } |
577 return gfx::Rect(); | 581 return gfx::Rect(); |
578 } | 582 } |
579 | 583 |
580 } // namespace message_center | 584 } // namespace message_center |
OLD | NEW |