| Index: content/browser/web_contents/web_contents_view_aura.cc
|
| ===================================================================
|
| --- content/browser/web_contents/web_contents_view_aura.cc (revision 235307)
|
| +++ content/browser/web_contents/web_contents_view_aura.cc (working copy)
|
| @@ -754,6 +754,15 @@
|
| // Windows, unregister first so that the debug check doesn't fire.
|
| if (parent && parent == window->GetRootWindow())
|
| parent->RemoveObserver(this);
|
| +
|
| + // We need to undo the above if we were parented to the root window and then
|
| + // got parented to another window. At that point, the code before the ifdef
|
| + // would have stopped watching the root window.
|
| + if (window->GetRootWindow() &&
|
| + parent != window->GetRootWindow() &&
|
| + !window->GetRootWindow()->HasObserver(this)) {
|
| + window->GetRootWindow()->AddObserver(this);
|
| + }
|
| #endif
|
|
|
| parent_ = parent;
|
| @@ -789,7 +798,8 @@
|
| if (window == view_->window_) {
|
| window->GetDispatcher()->AddRootWindowObserver(this);
|
| #if defined(OS_WIN)
|
| - window->GetRootWindow()->AddObserver(this);
|
| + if (!window->GetRootWindow()->HasObserver(this))
|
| + window->GetRootWindow()->AddObserver(this);
|
| #endif
|
| }
|
| }
|
|
|