OLD | NEW |
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_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1778 void WebContentsImpl::RenderViewForInterstitialPageCreated( | 1778 void WebContentsImpl::RenderViewForInterstitialPageCreated( |
1779 RenderViewHost* render_view_host) { | 1779 RenderViewHost* render_view_host) { |
1780 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 1780 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
1781 RenderViewForInterstitialPageCreated(render_view_host)); | 1781 RenderViewForInterstitialPageCreated(render_view_host)); |
1782 } | 1782 } |
1783 | 1783 |
1784 void WebContentsImpl::AttachInterstitialPage( | 1784 void WebContentsImpl::AttachInterstitialPage( |
1785 InterstitialPageImpl* interstitial_page) { | 1785 InterstitialPageImpl* interstitial_page) { |
1786 DCHECK(interstitial_page); | 1786 DCHECK(interstitial_page); |
1787 render_manager_.set_interstitial_page(interstitial_page); | 1787 render_manager_.set_interstitial_page(interstitial_page); |
| 1788 |
| 1789 // Cancel any visible dialogs so that they don't interfere with the |
| 1790 // interstitial. |
| 1791 if (dialog_manager_) |
| 1792 dialog_manager_->CancelActiveAndPendingDialogs(this); |
| 1793 |
1788 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 1794 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
1789 DidAttachInterstitialPage()); | 1795 DidAttachInterstitialPage()); |
1790 } | 1796 } |
1791 | 1797 |
1792 void WebContentsImpl::DetachInterstitialPage() { | 1798 void WebContentsImpl::DetachInterstitialPage() { |
1793 if (GetInterstitialPage()) | 1799 if (GetInterstitialPage()) |
1794 render_manager_.remove_interstitial_page(); | 1800 render_manager_.remove_interstitial_page(); |
1795 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 1801 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
1796 DidDetachInterstitialPage()); | 1802 DidDetachInterstitialPage()); |
1797 } | 1803 } |
(...skipping 2061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3859 gfx::Size WebContentsImpl::GetSizeForNewRenderView() const { | 3865 gfx::Size WebContentsImpl::GetSizeForNewRenderView() const { |
3860 gfx::Size size; | 3866 gfx::Size size; |
3861 if (delegate_) | 3867 if (delegate_) |
3862 size = delegate_->GetSizeForNewRenderView(this); | 3868 size = delegate_->GetSizeForNewRenderView(this); |
3863 if (size.IsEmpty()) | 3869 if (size.IsEmpty()) |
3864 size = view_->GetContainerSize(); | 3870 size = view_->GetContainerSize(); |
3865 return size; | 3871 return size; |
3866 } | 3872 } |
3867 | 3873 |
3868 } // namespace content | 3874 } // namespace content |
OLD | NEW |