Index: ui/aura/window.cc |
diff --git a/ui/aura/window.cc b/ui/aura/window.cc |
index 8ea6ddfa8c5173760b3282b811190b1cacb3f472..b6097b5b1ed0b63d6eb4d1000ff7a5c1b1aacf5a 100644 |
--- a/ui/aura/window.cc |
+++ b/ui/aura/window.cc |
@@ -597,9 +597,17 @@ void Window::SetBoundsInternal(const gfx::Rect& new_bounds) { |
std::max(min_size.height(), actual_new_bounds.height())); |
} |
+ gfx::Rect old_bounds = GetTargetBounds(); |
+ |
// Always need to set the layer's bounds -- even if it is to the same thing. |
// This may cause important side effects such as stopping animation. |
layer_->SetBounds(actual_new_bounds); |
+ |
+ // If we are currently not the layer's delegate, we will not get bounds |
+ // changed notification from the layer (this typically happens after animating |
+ // hidden). We must notify ourselves. |
+ if (layer_->delegate() != this) |
+ OnLayerBoundsChanged(old_bounds, ContainsMouse()); |
} |
void Window::SetVisible(bool visible) { |
@@ -813,14 +821,8 @@ void Window::OnPaintLayer(gfx::Canvas* canvas) { |
} |
base::Closure Window::PrepareForLayerBoundsChange() { |
- bool contains_mouse = false; |
- if (IsVisible()) { |
- RootWindow* root_window = GetRootWindow(); |
- contains_mouse = |
- root_window && ContainsPointInRoot(root_window->last_mouse_location()); |
- } |
return base::Bind(&Window::OnLayerBoundsChanged, base::Unretained(this), |
- bounds(), contains_mouse); |
+ bounds(), ContainsMouse()); |
} |
void Window::UpdateLayerName(const std::string& name) { |
@@ -840,6 +842,16 @@ void Window::UpdateLayerName(const std::string& name) { |
#endif |
} |
+bool Window::ContainsMouse() { |
+ bool contains_mouse = false; |
+ if (IsVisible()) { |
+ RootWindow* root_window = GetRootWindow(); |
+ contains_mouse = |
+ root_window && ContainsPointInRoot(root_window->last_mouse_location()); |
+ } |
+ return contains_mouse; |
+} |
+ |
#ifndef NDEBUG |
std::string Window::GetDebugInfo() const { |
return StringPrintf( |