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

Unified Diff: ash/display/shutdown_observer_chromeos.cc

Issue 2523873002: Remove DisplayChangeObserver ash dependencies. (Closed)
Patch Set: Change DCO constructor slightly. Created 4 years 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/display/shutdown_observer_chromeos.h ('k') | ash/display/window_tree_host_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/shutdown_observer_chromeos.cc
diff --git a/ash/display/shutdown_observer_chromeos.cc b/ash/display/shutdown_observer_chromeos.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d1ddaa04b8ec0fe0f96a3b3421084af3e6a041e2
--- /dev/null
+++ b/ash/display/shutdown_observer_chromeos.cc
@@ -0,0 +1,28 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/display/shutdown_observer_chromeos.h"
+
+#include "ash/common/wm_shell.h"
+#include "ui/display/manager/chromeos/display_configurator.h"
+
+namespace ash {
+
+ShutdownObserver::ShutdownObserver(
+ ui::DisplayConfigurator* display_configurator)
+ : display_configurator_(display_configurator) {
+ WmShell::Get()->AddShellObserver(this);
+}
+
+ShutdownObserver::~ShutdownObserver() {
+ WmShell::Get()->RemoveShellObserver(this);
+}
+
+void ShutdownObserver::OnAppTerminating() {
+ // Stop handling display configuration events once the shutdown
+ // process starts. crbug.com/177014.
+ display_configurator_->PrepareForExit();
+}
+
+} // namespace ash
« no previous file with comments | « ash/display/shutdown_observer_chromeos.h ('k') | ash/display/window_tree_host_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698