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

Unified Diff: ash/common/wm/screen_dimmer.cc

Issue 2359633003: Makes ScreenDimmer deal with the shell going away (Closed)
Patch Set: comment Created 4 years, 3 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 | ash/wm/screen_dimmer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/screen_dimmer.cc
diff --git a/ash/common/wm/screen_dimmer.cc b/ash/common/wm/screen_dimmer.cc
index b00ac9052f783197bc776c92630e9d1383a19883..00e936ae2d2ab10bccb6153bd5ef413b6538c69b 100644
--- a/ash/common/wm/screen_dimmer.cc
+++ b/ash/common/wm/screen_dimmer.cc
@@ -32,7 +32,9 @@ ScreenDimmer::ScreenDimmer(Container container)
}
ScreenDimmer::~ScreenDimmer() {
- WmShell::Get()->RemoveShellObserver(this);
+ // Usage in chrome results in ScreenDimmer outliving the shell.
+ if (WmShell::HasInstance())
+ WmShell::Get()->RemoveShellObserver(this);
}
void ScreenDimmer::SetDimming(bool should_dim) {
« no previous file with comments | « no previous file | ash/wm/screen_dimmer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698