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

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..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_;
« 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