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

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

Issue 137883003: Flash video doesn't play if opened in background tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 months 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 | « no previous file | 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
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index a05111f2d7507dc6f6c8af26c4139dafa3cd06fc..1b767fb454834a9564df35a0b5dd68a4684fc88d 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -764,17 +764,19 @@ class WebContentsViewAura::WindowObserver
// going to be deprecated in a year, this is ok for now. The test for this is
// PrintPreviewTest.WindowedNPAPIPluginHidden.
virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE {
- if (new_window == view_->window_)
- return;
-
- if (new_window == parent_)
- return; // This happens if the parent moves to the root window.
+ if (new_window != view_->window_) {
+ // Skip the case when the parent moves to the root window.
+ if (new_window != parent_) {
+ // Observe sibling windows of the WebContents, or children of the root
+ // window.
+ if (new_window->parent() == parent_ ||
+ new_window->parent() == view_->window_->GetRootWindow()) {
+ new_window->AddObserver(this);
+ }
+ }
+ }
- // Observe sibling windows of the WebContents, or children of the root
- // window.
- if (new_window->parent() == parent_ ||
- new_window->parent() == view_->window_->GetRootWindow()) {
- new_window->AddObserver(this);
+ if (new_window->parent() == parent_) {
UpdateConstrainedWindows(NULL);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698