Commit 598ab147 authored by sky's avatar sky Committed by Commit bot

Fixes bug in WmWindowAura::OnWindowVisibilityChanged()

The code was assuming window was this->window_, which is not
necessarily the case.

BUG=650755
TEST=none
R=oshima@chromium.org

Review-Url: https://codereview.chromium.org/2369413002
Cr-Commit-Position: refs/heads/master@{#421298}
parent c446e0ea
...@@ -857,6 +857,7 @@ void WmWindowAura::OnWindowDestroyed(aura::Window* window) { ...@@ -857,6 +857,7 @@ void WmWindowAura::OnWindowDestroyed(aura::Window* window) {
void WmWindowAura::OnWindowVisibilityChanging(aura::Window* window, void WmWindowAura::OnWindowVisibilityChanging(aura::Window* window,
bool visible) { bool visible) {
DCHECK_EQ(window, window_);
FOR_EACH_OBSERVER(WmWindowObserver, observers_, FOR_EACH_OBSERVER(WmWindowObserver, observers_,
OnWindowVisibilityChanging(this, visible)); OnWindowVisibilityChanging(this, visible));
} }
...@@ -864,7 +865,7 @@ void WmWindowAura::OnWindowVisibilityChanging(aura::Window* window, ...@@ -864,7 +865,7 @@ void WmWindowAura::OnWindowVisibilityChanging(aura::Window* window,
void WmWindowAura::OnWindowVisibilityChanged(aura::Window* window, void WmWindowAura::OnWindowVisibilityChanged(aura::Window* window,
bool visible) { bool visible) {
FOR_EACH_OBSERVER(WmWindowObserver, observers_, FOR_EACH_OBSERVER(WmWindowObserver, observers_,
OnWindowVisibilityChanged(this, visible)); OnWindowVisibilityChanged(Get(window), visible));
} }
void WmWindowAura::OnWindowTitleChanged(aura::Window* window) { void WmWindowAura::OnWindowTitleChanged(aura::Window* window) {
......
...@@ -70,6 +70,12 @@ class AURA_EXPORT WindowObserver { ...@@ -70,6 +70,12 @@ class AURA_EXPORT WindowObserver {
// value supplied to SetVisible(). If |visible| is true, window->IsVisible() // value supplied to SetVisible(). If |visible| is true, window->IsVisible()
// may still return false. See description in Window::IsVisible() for details. // may still return false. See description in Window::IsVisible() for details.
virtual void OnWindowVisibilityChanging(Window* window, bool visible) {} virtual void OnWindowVisibilityChanging(Window* window, bool visible) {}
// When the visibility of a Window changes OnWindowVisibilityChanged() is
// called for all observers attached to descendants of the Window as well
// as all observers attached to ancestors of the Window. The Window supplied
// to OnWindowVisibilityChanged() is the Window that Show()/Hide() was called
// on.
virtual void OnWindowVisibilityChanged(Window* window, bool visible) {} virtual void OnWindowVisibilityChanged(Window* window, bool visible) {}
// Invoked when SetBounds() is invoked on |window|. |old_bounds| and // Invoked when SetBounds() is invoked on |window|. |old_bounds| and
......
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