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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/web_contents_view_aura.h" 5 #include "content/browser/web_contents/web_contents_view_aura.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 757
758 // Overridden from aura::WindowObserver: 758 // Overridden from aura::WindowObserver:
759 #if defined(OS_WIN) 759 #if defined(OS_WIN)
760 // Constrained windows are added as children of the parent's parent's view 760 // Constrained windows are added as children of the parent's parent's view
761 // which may overlap with windowed NPAPI plugins. In that case, tell the RWHV 761 // which may overlap with windowed NPAPI plugins. In that case, tell the RWHV
762 // so that it can update the plugins' cutout rects accordingly. 762 // so that it can update the plugins' cutout rects accordingly.
763 // Note: this is hard coding how Chrome layer adds its dialogs. Since NPAPI is 763 // Note: this is hard coding how Chrome layer adds its dialogs. Since NPAPI is
764 // going to be deprecated in a year, this is ok for now. The test for this is 764 // going to be deprecated in a year, this is ok for now. The test for this is
765 // PrintPreviewTest.WindowedNPAPIPluginHidden. 765 // PrintPreviewTest.WindowedNPAPIPluginHidden.
766 virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE { 766 virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE {
767 if (new_window == view_->window_) 767 if (new_window != view_->window_) {
768 return; 768 // Skip the case when the parent moves to the root window.
769 if (new_window != parent_) {
770 // Observe sibling windows of the WebContents, or children of the root
771 // window.
772 if (new_window->parent() == parent_ ||
773 new_window->parent() == view_->window_->GetRootWindow()) {
774 new_window->AddObserver(this);
775 }
776 }
777 }
769 778
770 if (new_window == parent_) 779 if (new_window->parent() == parent_) {
771 return; // This happens if the parent moves to the root window.
772
773 // Observe sibling windows of the WebContents, or children of the root
774 // window.
775 if (new_window->parent() == parent_ ||
776 new_window->parent() == view_->window_->GetRootWindow()) {
777 new_window->AddObserver(this);
778 UpdateConstrainedWindows(NULL); 780 UpdateConstrainedWindows(NULL);
779 } 781 }
780 } 782 }
781 783
782 virtual void OnWillRemoveWindow(aura::Window* window) OVERRIDE { 784 virtual void OnWillRemoveWindow(aura::Window* window) OVERRIDE {
783 if (window == view_->window_) 785 if (window == view_->window_)
784 return; 786 return;
785 787
786 window->RemoveObserver(this); 788 window->RemoveObserver(this);
787 UpdateConstrainedWindows(window); 789 UpdateConstrainedWindows(window);
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
1790 event.location(), 1792 event.location(),
1791 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), 1793 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(),
1792 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); 1794 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags()));
1793 if (drag_dest_delegate_) 1795 if (drag_dest_delegate_)
1794 drag_dest_delegate_->OnDrop(); 1796 drag_dest_delegate_->OnDrop();
1795 current_drop_data_.reset(); 1797 current_drop_data_.reset();
1796 return current_drag_op_; 1798 return current_drag_op_;
1797 } 1799 }
1798 1800
1799 } // namespace content 1801 } // namespace content
OLDNEW
« 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