Commit 1cc35fde authored by Shawn Gallea's avatar Shawn Gallea Committed by Commit Bot

EXO: Add OnDisplayMetricsChanged, TargetHandlers for WMHelperCastShell

Change OnDisplayMetricsChanged to create new ManagedDisplayInfo for
display if OnDisplayAdded was never called for the display.
This is needed for the initial display on cast.

Bug: 896710
Test: None
Change-Id: I3b7d4829874b61b2115d25071a0de7bb74dba246
Reviewed-on: https://chromium-review.googlesource.com/c/1329859
Commit-Queue: Daniel Nicoara <dnicoara@chromium.org>
Reviewed-by: default avatarDaniel Nicoara <dnicoara@chromium.org>
Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611692}
parent 60d9bb7b
......@@ -131,7 +131,7 @@ aura::client::CursorClient* WMHelperCastShell::GetCursorClient() {
}
void WMHelperCastShell::AddPreTargetHandler(ui::EventHandler* handler) {
NOTIMPLEMENTED();
cast_window_manager_aura_->GetRootWindow()->AddPreTargetHandler(handler);
}
void WMHelperCastShell::PrependPreTargetHandler(ui::EventHandler* handler) {
......@@ -139,15 +139,15 @@ void WMHelperCastShell::PrependPreTargetHandler(ui::EventHandler* handler) {
}
void WMHelperCastShell::RemovePreTargetHandler(ui::EventHandler* handler) {
NOTIMPLEMENTED();
cast_window_manager_aura_->GetRootWindow()->RemovePreTargetHandler(handler);
}
void WMHelperCastShell::AddPostTargetHandler(ui::EventHandler* handler) {
NOTIMPLEMENTED();
cast_window_manager_aura_->GetRootWindow()->AddPostTargetHandler(handler);
}
void WMHelperCastShell::RemovePostTargetHandler(ui::EventHandler* handler) {
NOTIMPLEMENTED();
cast_window_manager_aura_->GetRootWindow()->RemovePostTargetHandler(handler);
}
bool WMHelperCastShell::IsTabletModeWindowManagerEnabled() const {
......@@ -183,6 +183,12 @@ void WMHelperCastShell::CastDisplayObserver::OnDisplayRemoved(
void WMHelperCastShell::CastDisplayObserver::OnDisplayMetricsChanged(
const display::Display& display,
uint32_t changed_metrics) {
if (!base::ContainsValue(display_info_, display.id())) {
display::ManagedDisplayInfo md(display.id(), "CastDisplayInfo", true);
md.SetBounds(display.bounds());
display_info_.emplace(display.id(), md);
}
// Currently only updates bounds
if ((DISPLAY_METRIC_BOUNDS & changed_metrics) == DISPLAY_METRIC_BOUNDS)
display_info_[display.id()].SetBounds(display.bounds());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment