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

Unified Diff: ash/display/display_controller.cc

Issue 1113493002: Don't dispatch event after shutdown on AshWTHUnified (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | ash/display/mirror_window_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_controller.cc
diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc
index 2aa2fc692c0133d44c7ae02998692b4175d7aaaa..5ccb002af8fd3500417860f7fe440e92bb3734ea 100644
--- a/ash/display/display_controller.cc
+++ b/ash/display/display_controller.cc
@@ -631,7 +631,9 @@ bool DisplayController::UpdateWorkAreaOfDisplayNearestWindow(
}
void DisplayController::OnDisplayAdded(const gfx::Display& display) {
- if (GetDisplayManager()->IsInUnifiedMode()) {
+#if defined(OS_CHROMEOS)
+ if (GetDisplayManager()->default_multi_display_mode() ==
+ DisplayManager::UNIFIED) {
if (primary_display_id == gfx::Display::kInvalidDisplayID)
primary_display_id = display.id();
AshWindowTreeHost* ash_host =
@@ -642,13 +644,22 @@ void DisplayController::OnDisplayAdded(const gfx::Display& display) {
AshWindowTreeHost* to_delete = primary_tree_host_for_replace_;
primary_tree_host_for_replace_ = nullptr;
DeleteHost(to_delete);
+#ifndef NDEBUG
+ auto iter = std::find_if(
+ window_tree_hosts_.begin(), window_tree_hosts_.end(),
+ [to_delete](const std::pair<int64, AshWindowTreeHost*>& pair) {
+ return pair.second == to_delete;
+ });
+ DCHECK(iter == window_tree_hosts_.end());
+#endif
// the host has already been removed from the window_tree_host_.
}
- }
- // TODO(oshima): It should be possible to consolidate logic for
- // unified and non unified, but I'm keeping them separated to minimize
- // the risk in M44. I'll consolidate this in M45.
- else if (primary_tree_host_for_replace_) {
+ } else
+#endif
+ // TODO(oshima): It should be possible to consolidate logic for
+ // unified and non unified, but I'm keeping them separated to minimize
+ // the risk in M44. I'll consolidate this in M45.
+ if (primary_tree_host_for_replace_) {
DCHECK(window_tree_hosts_.empty());
primary_display_id = display.id();
window_tree_hosts_[display.id()] = primary_tree_host_for_replace_;
« no previous file with comments | « no previous file | ash/display/mirror_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698