chromeos: make WindowWatcher a ShellObserver vs DisplayObserver

Desktop / Chromium - Scott Violet [chromium.org] - 13 July 2017 18:39 EDT

Ash may recycle a WindowTreeHost for a different display. This means overriding OnDisplayAdded() and looking up a root window may result in getting a root already seen. Fix this by converting to ShellObserver::OnRootWindowAdded() which doesn't suffer from this problem.

BUG=740589 TEST=none (this code is only used in non-production code)

Change-Id: Ic4accf920cedfe0f6c9c3b2ce2ed27c7bf2a9f37 Reviewed-on: https://chromium-review.googlesource.com/570777

82ea846 chromeos: make WindowWatcher a ShellObserver vs DisplayObserver
ash/mus/standalone/ash_standalone_main.cc | 6 ------
ash/shell.h | 5 -----
ash/shell/content/client/shell_browser_main_parts.cc | 7 ++-----
ash/shell/content/client/shell_browser_main_parts.h | 2 +-
ash/shell/window_watcher.cc | 20 ++++++--------------
ash/shell/window_watcher.h | 15 ++++-----------
6 files changed, 13 insertions(+), 42 deletions(-)

Upstream: git.chromium.org


  • Share