Index: ash/display/display_controller.cc |
diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc |
index 2aa2fc692c0133d44c7ae02998692b4175d7aaaa..072b21de346b5037a39f4e756628a4995cbdd18f 100644 |
--- a/ash/display/display_controller.cc |
+++ b/ash/display/display_controller.cc |
@@ -631,7 +631,7 @@ bool DisplayController::UpdateWorkAreaOfDisplayNearestWindow( |
} |
void DisplayController::OnDisplayAdded(const gfx::Display& display) { |
- if (GetDisplayManager()->IsInUnifiedMode()) { |
+ if (switches::UnifiedDesktopEnabled()) { |
oshima
2015/04/28 07:29:41
I made this change when cleaning up the previous C
|
if (primary_display_id == gfx::Display::kInvalidDisplayID) |
primary_display_id = display.id(); |
AshWindowTreeHost* ash_host = |
@@ -642,6 +642,14 @@ 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_. |
} |
} |