Commit 93117bfd authored by Avery Musbach's avatar Avery Musbach Committed by Commit Bot

overview: Add OnDisplayAdded and adjust OnDisplayRemoved

OverviewSession::OnDisplayRemoved is unreachable and contains a TODO
that describes behavior contrary to the current design decisions. Also,
when a display is added, overview ends (as expected) only because of
OverviewSession::OnShelfAlignmentChanged; the present CL adds
OverviewSession::OnDisplayAdded to improve code maintainability.

Test: ash_unittests OverviewSessionTest.Shutdown
Test: ash_unittests OverviewSessionTest.AddDisplay
Test: ash_unittests OverviewSessionTest.RemoveDisplay
Test: ash_unittests OverviewSessionTest.RemoveDisplayWithAnimation
Change-Id: If2a282364b72f5fcedac5bdbb7a9f0c1ab8ebd97
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1743114Reviewed-by: default avatarRobert Flack <flackr@chromium.org>
Commit-Queue: Avery Musbach <amusbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686563}
parent 21bbeb78
......@@ -755,11 +755,16 @@ void OverviewSession::OnHighlightedItemClosed(OverviewItem* item) {
item->CloseWindow();
}
void OverviewSession::OnDisplayRemoved(const display::Display& display) {
// TODO(flackr): Keep window selection active on remaining displays.
void OverviewSession::OnDisplayAdded(const display::Display& display) {
EndOverview();
}
void OverviewSession::OnDisplayRemoved(const display::Display& display) {
// Removing a display causes a window activation which will end overview mode
// so that |OnDisplayRemoved| is never called.
NOTREACHED();
}
void OverviewSession::OnDisplayMetricsChanged(const display::Display& display,
uint32_t metrics) {
// For metrics changes that happen when the split view mode is active, the
......
......@@ -239,6 +239,7 @@ class ASH_EXPORT OverviewSession : public display::DisplayObserver,
void OnHighlightedItemClosed(OverviewItem* item);
// display::DisplayObserver:
void OnDisplayAdded(const display::Display& display) override;
void OnDisplayRemoved(const display::Display& display) override;
void OnDisplayMetricsChanged(const display::Display& display,
uint32_t metrics) override;
......
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