Commit d6171a2c authored by mukai@chromium.org's avatar mukai@chromium.org

Move the logic of getting root window to StartObserving()

Crashes are reported around getting root window in UpdateShelf(),
however the new AshPopupAlignmentDelegate is mostly same as
old WorkAreaObserver. One difference is the location of getting
root window. This could fix the problem.

If this doesn't fix the problem, then the problem happens outside
of this file.

BUG=400492
R=stevenjb@chromium.org
TEST=None

Review URL: https://codereview.chromium.org/441013003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287859 0039d316-1c4b-4281-b951-d872f2087c98
parent 7d69ee8d
......@@ -51,6 +51,8 @@ void AshPopupAlignmentDelegate::StartObserving(gfx::Screen* screen,
const gfx::Display& display) {
screen_ = screen;
display_id_ = display.id();
root_window_ = ash::Shell::GetInstance()->display_controller()->
GetRootWindowForDisplayId(display_id_);
UpdateShelf();
screen->AddObserver(this);
Shell::GetInstance()->AddShellObserver(this);
......@@ -124,9 +126,7 @@ void AshPopupAlignmentDelegate::UpdateShelf() {
if (shelf_)
return;
aura::Window* root_window = ash::Shell::GetInstance()->display_controller()->
GetRootWindowForDisplayId(display_id_);
shelf_ = ShelfLayoutManager::ForShelf(root_window);
shelf_ = ShelfLayoutManager::ForShelf(root_window_);
if (shelf_)
shelf_->AddObserver(this);
}
......
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