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

Unified Diff: ash/system/tray/system_tray.cc

Issue 10260034: ash: Do not add the tray bubble twice in the message-loop's observer list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/system_tray.cc
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc
index 4555bcb19eb81b8a7cfa17424c4ba7206b3c4a0f..5db8c25352ac398cae3e1a1356bcedc190a2776b 100644
--- a/ash/system/tray/system_tray.cc
+++ b/ash/system/tray/system_tray.cc
@@ -475,11 +475,13 @@ SystemTrayBubble::SystemTrayBubble(
items_(items),
detailed_(detailed),
autoclose_delay_(0) {
- MessageLoopForUI::current()->AddObserver(this);
}
SystemTrayBubble::~SystemTrayBubble() {
+ // The bubble may be closing without having been hidden first. So it may still
+ // be in the message-loop's observer list.
MessageLoopForUI::current()->RemoveObserver(this);
+
DestroyItemViews();
// Reset the host pointer in bubble_view_ in case its destruction is deferred.
if (bubble_view_)
@@ -510,7 +512,6 @@ void SystemTrayBubble::InitView(views::View* anchor,
DCHECK(bubble_widget_ == NULL);
bubble_widget_ = views::BubbleDelegateView::CreateBubble(bubble_view_);
-
// Must occur after call to CreateBubble()
bubble_view_->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE);
bubble_widget_->non_client_view()->frame_view()->set_background(NULL);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698