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

Unified Diff: ash/system/cast/tray_cast.cc

Issue 1614233002: Shutdown the status tray before the system tray delegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fix test failures Created 4 years, 11 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/shell.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/cast/tray_cast.cc
diff --git a/ash/system/cast/tray_cast.cc b/ash/system/cast/tray_cast.cc
index 7c744851b2fc674ce42b320db9573db969ff03bd..e41f7cd81a0111a448a6d44330c4fc8ab156a500 100644
--- a/ash/system/cast/tray_cast.cc
+++ b/ash/system/cast/tray_cast.cc
@@ -42,12 +42,6 @@ const int kStopButtonRightPadding = 18;
// Returns the active CastConfigDelegate instance.
ash::CastConfigDelegate* GetCastConfigDelegate() {
- // When shutting down Chrome, there may not be a shell or a delegate instance.
- if (!ash::Shell::GetInstance() ||
- !ash::Shell::GetInstance()->system_tray_delegate()) {
- return nullptr;
- }
-
return ash::Shell::GetInstance()
->system_tray_delegate()
->GetCastConfigDelegate();
@@ -560,14 +554,9 @@ TrayCast::TrayCast(SystemTray* system_tray) : SystemTrayItem(system_tray) {
}
TrayCast::~TrayCast() {
- // TODO(jdufault): Remove these if checks (and the ones in
- // GetCastConfigDelegate) by fixing deinit order. See crbug.com/577413.
- if (Shell::GetInstance())
- Shell::GetInstance()->RemoveShellObserver(this);
-
- ash::CastConfigDelegate* cast_config_delegate = GetCastConfigDelegate();
- if (added_observer_ && cast_config_delegate)
- cast_config_delegate->RemoveObserver(this);
+ Shell::GetInstance()->RemoveShellObserver(this);
+ if (added_observer_)
+ GetCastConfigDelegate()->RemoveObserver(this);
}
void TrayCast::StartCastForTest(const std::string& receiver_id) {
« no previous file with comments | « ash/shell.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698