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

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

Issue 2392183002: Add check to identify the cause of the crash. (Closed)
Patch Set: Add check to identify the cause of the crash. Created 4 years, 2 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 | « ash/common/system/tray/system_tray.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/system_tray.cc
diff --git a/ash/common/system/tray/system_tray.cc b/ash/common/system/tray/system_tray.cc
index d8930080cb33bc1b0f3e4182a686b82349171fa7..b64a72b10858b2061ee3785c238793ea87c614bd 100644
--- a/ash/common/system/tray/system_tray.cc
+++ b/ash/common/system/tray/system_tray.cc
@@ -419,6 +419,7 @@ bool SystemTray::IsMouseInNotificationBubble() const {
bool SystemTray::CloseSystemBubble() const {
if (!system_bubble_)
return false;
+ CHECK(!activating_);
system_bubble_->bubble()->Close();
return true;
}
@@ -793,7 +794,13 @@ void SystemTray::CloseBubble(const ui::KeyEvent& key_event) {
void SystemTray::ActivateAndStartNavigation(const ui::KeyEvent& key_event) {
if (!system_bubble_)
return;
+ activating_ = true;
ActivateBubble();
+ activating_ = false;
+ // TODO(oshima): This is to troubleshoot the issue crbug.com/651242. Remove
+ // once the root cause is fixed.
+ CHECK(system_bubble_) << " the bubble was deleted while activaing it";
+
views::Widget* widget = GetSystemBubble()->bubble_view()->GetWidget();
widget->GetFocusManager()->OnKeyEvent(key_event);
}
@@ -846,6 +853,7 @@ bool SystemTray::PerformAction(const ui::Event& event) {
}
void SystemTray::CloseSystemBubbleAndDeactivateSystemTray() {
+ CHECK(!activating_);
activation_observer_.reset();
key_event_watcher_.reset();
system_bubble_.reset();
« no previous file with comments | « ash/common/system/tray/system_tray.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698