| Index: ui/aura/window.cc
|
| ===================================================================
|
| --- ui/aura/window.cc (revision 119986)
|
| +++ ui/aura/window.cc (working copy)
|
| @@ -294,8 +294,10 @@
|
| child->OnParentChanged();
|
|
|
| RootWindow* root_window = child->GetRootWindow();
|
| - if (root_window)
|
| - root_window->OnWindowAttachedToRootWindow(child);
|
| + if (root_window) {
|
| + root_window->OnWindowAddedToRootWindow(child);
|
| + NotifyAddedToRootWindow();
|
| + }
|
| }
|
|
|
| void Window::AddTransientChild(Window* child) {
|
| @@ -323,8 +325,10 @@
|
| layout_manager_->OnWillRemoveWindowFromLayout(child);
|
| FOR_EACH_OBSERVER(WindowObserver, observers_, OnWillRemoveWindow(child));
|
| RootWindow* root_window = child->GetRootWindow();
|
| - if (root_window)
|
| - root_window->OnWindowDetachingFromRootWindow(child);
|
| + if (root_window) {
|
| + root_window->OnWindowRemovedFromRootWindow(child);
|
| + child->NotifyRemovingFromRootWindow();
|
| + }
|
| child->parent_ = NULL;
|
| // We should only remove the child's layer if the child still owns that layer.
|
| // Someone else may have acquired ownership of it via AcquireLayer() and may
|
| @@ -519,12 +523,6 @@
|
| return it != children_.end();
|
| }
|
|
|
| -void Window::OnWindowDetachingFromRootWindow(aura::Window* window) {
|
| -}
|
| -
|
| -void Window::OnWindowAttachedToRootWindow(aura::Window* window) {
|
| -}
|
| -
|
| void Window::SetBoundsInternal(const gfx::Rect& new_bounds) {
|
| gfx::Rect actual_new_bounds(new_bounds);
|
|
|
| @@ -643,6 +641,24 @@
|
| FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowStackingChanged(this));
|
| }
|
|
|
| +void Window::NotifyRemovingFromRootWindow() {
|
| + FOR_EACH_OBSERVER(WindowObserver, observers_,
|
| + OnWindowRemovingFromRootWindow(this));
|
| + for (Window::Windows::const_iterator it = children_.begin();
|
| + it != children_.end(); ++it) {
|
| + (*it)->NotifyRemovingFromRootWindow();
|
| + }
|
| +}
|
| +
|
| +void Window::NotifyAddedToRootWindow() {
|
| + FOR_EACH_OBSERVER(WindowObserver, observers_,
|
| + OnWindowAddedToRootWindow(this));
|
| + for (Window::Windows::const_iterator it = children_.begin();
|
| + it != children_.end(); ++it) {
|
| + (*it)->NotifyAddedToRootWindow();
|
| + }
|
| +}
|
| +
|
| void Window::OnPaintLayer(gfx::Canvas* canvas) {
|
| if (delegate_)
|
| delegate_->OnPaint(canvas);
|
|
|