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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 : parent_(parent), | 55 : parent_(parent), |
56 message_center_(message_center), | 56 message_center_(message_center), |
57 tray_(tray), | 57 tray_(tray), |
58 alignment_delegate_(alignment_delegate), | 58 alignment_delegate_(alignment_delegate), |
59 defer_counter_(0), | 59 defer_counter_(0), |
60 latest_toast_entered_(NULL), | 60 latest_toast_entered_(NULL), |
61 user_is_closing_toasts_by_clicking_(false), | 61 user_is_closing_toasts_by_clicking_(false), |
62 context_menu_controller_(new MessageViewContextMenuController(this)), | 62 context_menu_controller_(new MessageViewContextMenuController(this)), |
63 weak_factory_(this) { | 63 weak_factory_(this) { |
64 DCHECK(message_center_); | 64 DCHECK(message_center_); |
65 defer_timer_.reset(new base::OneShotTimer<MessagePopupCollection>); | 65 defer_timer_.reset(new base::OneShotTimer); |
66 message_center_->AddObserver(this); | 66 message_center_->AddObserver(this); |
67 alignment_delegate_->set_collection(this); | 67 alignment_delegate_->set_collection(this); |
68 } | 68 } |
69 | 69 |
70 MessagePopupCollection::~MessagePopupCollection() { | 70 MessagePopupCollection::~MessagePopupCollection() { |
71 weak_factory_.InvalidateWeakPtrs(); | 71 weak_factory_.InvalidateWeakPtrs(); |
72 | 72 |
73 message_center_->RemoveObserver(this); | 73 message_center_->RemoveObserver(this); |
74 | 74 |
75 CloseAllWidgets(); | 75 CloseAllWidgets(); |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 views::Widget* widget = (*iter)->GetWidget(); | 504 views::Widget* widget = (*iter)->GetWidget(); |
505 if (widget) | 505 if (widget) |
506 return widget->GetWindowBoundsInScreen(); | 506 return widget->GetWindowBoundsInScreen(); |
507 break; | 507 break; |
508 } | 508 } |
509 } | 509 } |
510 return gfx::Rect(); | 510 return gfx::Rect(); |
511 } | 511 } |
512 | 512 |
513 } // namespace message_center | 513 } // namespace message_center |
OLD | NEW |