summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authoroshima <oshima@chromium.org>2015-04-28 11:25:10 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-28 18:26:31 +0000
commitb8fb0b710079b91da5b9e6172c723e16130cf7ff (patch)
tree3f88fc10b0110db92f3308f8abfabb29f45d08d3 /ash
parent0aadb1da6531a92db44ebb34874c3932db25a9ba (diff)
downloadchromium_src-b8fb0b710079b91da5b9e6172c723e16130cf7ff.zip
chromium_src-b8fb0b710079b91da5b9e6172c723e16130cf7ff.tar.gz
chromium_src-b8fb0b710079b91da5b9e6172c723e16130cf7ff.tar.bz2
Don't dispatch event after shutdown on AshWTHUnified
in the same way as AshWTHX11/Ozone Fixed minor error introduced when cleaning up CL BUG=365662 TEST=UnifiedDesktopBasic will pass with real offscreen output surface Review URL: https://codereview.chromium.org/1113493002 Cr-Commit-Position: refs/heads/master@{#327333}
Diffstat (limited to 'ash')
-rw-r--r--ash/display/display_controller.cc23
-rw-r--r--ash/display/mirror_window_controller.cc6
-rw-r--r--ash/host/ash_window_tree_host_unified.cc4
3 files changed, 25 insertions, 8 deletions
diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc
index 2aa2fc6..5ccb002 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_;
diff --git a/ash/display/mirror_window_controller.cc b/ash/display/mirror_window_controller.cc
index 8fb7767..3e7df2d 100644
--- a/ash/display/mirror_window_controller.cc
+++ b/ash/display/mirror_window_controller.cc
@@ -145,7 +145,7 @@ void MirrorWindowController::UpdateWindow(
mirror_window->SetBounds(host->window()->bounds());
mirror_window->Show();
if (reflector_) {
- // TODO(oshima): Enable this once reflect change is landed.
+ // TODO(oshima): Enable this once reflector change is landed.
// reflector_->AddMirroringLayer(mirror_window->layer());
} else {
reflector_ =
@@ -267,7 +267,9 @@ void MirrorWindowController::CloseAndDeleteHost(MirroringHostInfo* host_info) {
host->RemoveObserver(Shell::GetInstance()->display_controller());
host->RemoveObserver(this);
- // reflector_->RemoveMirroringLayer(host_info->mirror_window->layer());
+ host_info->ash_host->PrepareForShutdown();
+ // TODO(oshima): Enable this once reflector change is landed.
+ // reflector_->RemovedMirroringLayer(mirror_window->layer());
delete host_info;
}
diff --git a/ash/host/ash_window_tree_host_unified.cc b/ash/host/ash_window_tree_host_unified.cc
index 4317365..b62de2e 100644
--- a/ash/host/ash_window_tree_host_unified.cc
+++ b/ash/host/ash_window_tree_host_unified.cc
@@ -10,6 +10,7 @@
#include "ui/aura/window_targeter.h"
#include "ui/compositor/compositor.h"
#include "ui/events/event_processor.h"
+#include "ui/events/null_event_targeter.h"
#include "ui/gfx/geometry/insets.h"
namespace ash {
@@ -56,6 +57,9 @@ AshWindowTreeHostUnified::~AshWindowTreeHostUnified() {
}
void AshWindowTreeHostUnified::PrepareForShutdown() {
+ window()->SetEventTargeter(
+ scoped_ptr<ui::EventTargeter>(new ui::NullEventTargeter));
+
for (auto host : mirroring_hosts_)
host->PrepareForShutdown();
}