Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(798)

Unified Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 73523002: Fix windowed NPAPI plugins appearing under dialogs when DWM compositing is disabled and the tab swi… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/location_bar/star_view_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
}
}
« no previous file with comments | « chrome/browser/ui/views/location_bar/star_view_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698