Chromium Code Reviews| Index: ash/display/display_controller.cc |
| diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc |
| index 2aa2fc692c0133d44c7ae02998692b4175d7aaaa..8dfa740eb9578c2fbdec1aabf9a9c8579bd7d506 100644 |
| --- a/ash/display/display_controller.cc |
| +++ b/ash/display/display_controller.cc |
| @@ -631,7 +631,8 @@ bool DisplayController::UpdateWorkAreaOfDisplayNearestWindow( |
| } |
| void DisplayController::OnDisplayAdded(const gfx::Display& display) { |
| - if (GetDisplayManager()->IsInUnifiedMode()) { |
| +#if defined(OS_CHROMEOS) |
| + if (switches::UnifiedDesktopEnabled()) { |
|
Jun Mukai
2015/04/28 17:07:39
Does this mean it's always in the unified desktop
oshima
2015/04/28 17:10:18
That's a flag, so you can't change it on the fly a
oshima
2015/04/28 17:20:20
Actually, I should check the default multi display
|
| if (primary_display_id == gfx::Display::kInvalidDisplayID) |
| primary_display_id = display.id(); |
| AshWindowTreeHost* ash_host = |
| @@ -642,13 +643,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_. |
| } |
| - } |
| + } 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. |
| - else if (primary_tree_host_for_replace_) { |
| + 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_; |