| Index: content/browser/web_contents/web_contents_impl.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
| index 7f4a8b07365c8220cc67f849f887d5a17282e1be..cf3111fe1c2b5fa2cac50fbe20d4115ea594c33c 100644
|
| --- a/content/browser/web_contents/web_contents_impl.cc
|
| +++ b/content/browser/web_contents/web_contents_impl.cc
|
| @@ -481,6 +481,7 @@ WebContentsImpl::WebContentsImpl(BrowserContext* browser_context)
|
| upload_size_(0),
|
| upload_position_(0),
|
| is_resume_pending_(false),
|
| + interstitial_page_(nullptr),
|
| has_accessed_initial_document_(false),
|
| theme_color_(SK_ColorTRANSPARENT),
|
| last_sent_theme_color_(SK_ColorTRANSPARENT),
|
| @@ -1291,8 +1292,7 @@ SiteInstanceImpl* WebContentsImpl::GetPendingSiteInstance() const {
|
|
|
| bool WebContentsImpl::IsLoading() const {
|
| return frame_tree_.IsLoading() &&
|
| - !(ShowingInterstitialPage() &&
|
| - GetRenderManager()->interstitial_page()->pause_throbber());
|
| + !(ShowingInterstitialPage() && interstitial_page_->pause_throbber());
|
| }
|
|
|
| bool WebContentsImpl::IsLoadingToDifferentDocument() const {
|
| @@ -1975,9 +1975,7 @@ RenderWidgetHostImpl* WebContentsImpl::GetFocusedRenderWidgetHost(
|
| // interstitial's widget.
|
| if (focused_contents->ShowingInterstitialPage()) {
|
| return static_cast<RenderFrameHostImpl*>(
|
| - focused_contents->GetRenderManager()
|
| - ->interstitial_page()
|
| - ->GetMainFrame())
|
| + focused_contents->interstitial_page_->GetMainFrame())
|
| ->GetRenderWidgetHost();
|
| }
|
|
|
| @@ -2010,9 +2008,7 @@ RenderWidgetHostImpl* WebContentsImpl::GetRenderWidgetHostWithPageFocus() {
|
|
|
| if (focused_web_contents->ShowingInterstitialPage()) {
|
| return static_cast<RenderFrameHostImpl*>(
|
| - focused_web_contents->GetRenderManager()
|
| - ->interstitial_page()
|
| - ->GetMainFrame())
|
| + focused_web_contents->interstitial_page_->GetMainFrame())
|
| ->GetRenderWidgetHost();
|
| }
|
|
|
| @@ -2857,8 +2853,8 @@ void WebContentsImpl::RenderFrameForInterstitialPageCreated(
|
|
|
| void WebContentsImpl::AttachInterstitialPage(
|
| InterstitialPageImpl* interstitial_page) {
|
| - DCHECK(interstitial_page);
|
| - GetRenderManager()->set_interstitial_page(interstitial_page);
|
| + DCHECK(!interstitial_page_ && interstitial_page);
|
| + interstitial_page_ = interstitial_page;
|
|
|
| // Cancel any visible dialogs so that they don't interfere with the
|
| // interstitial.
|
| @@ -2887,8 +2883,7 @@ void WebContentsImpl::AttachInterstitialPage(
|
|
|
| void WebContentsImpl::DidProceedOnInterstitial() {
|
| // The interstitial page should no longer be pausing the throbber.
|
| - DCHECK(!(ShowingInterstitialPage() &&
|
| - GetRenderManager()->interstitial_page()->pause_throbber()));
|
| + DCHECK(!(ShowingInterstitialPage() && interstitial_page_->pause_throbber()));
|
|
|
| // Restart the throbber now that the interstitial page no longer pauses it.
|
| if (ShowingInterstitialPage() && frame_tree_.IsLoading())
|
| @@ -2910,10 +2905,9 @@ void WebContentsImpl::DetachInterstitialPage() {
|
| }
|
|
|
| bool interstitial_pausing_throbber =
|
| - ShowingInterstitialPage() &&
|
| - GetRenderManager()->interstitial_page()->pause_throbber();
|
| + ShowingInterstitialPage() && interstitial_page_->pause_throbber();
|
| if (ShowingInterstitialPage())
|
| - GetRenderManager()->remove_interstitial_page();
|
| + interstitial_page_ = nullptr;
|
| for (auto& observer : observers_)
|
| observer.DidDetachInterstitialPage();
|
|
|
| @@ -3126,7 +3120,7 @@ void WebContentsImpl::RestoreFocus() {
|
|
|
| void WebContentsImpl::FocusThroughTabTraversal(bool reverse) {
|
| if (ShowingInterstitialPage()) {
|
| - GetRenderManager()->interstitial_page()->FocusThroughTabTraversal(reverse);
|
| + interstitial_page_->FocusThroughTabTraversal(reverse);
|
| return;
|
| }
|
| RenderWidgetHostView* const fullscreen_view =
|
| @@ -3139,11 +3133,11 @@ void WebContentsImpl::FocusThroughTabTraversal(bool reverse) {
|
| }
|
|
|
| bool WebContentsImpl::ShowingInterstitialPage() const {
|
| - return GetRenderManager()->interstitial_page() != NULL;
|
| + return interstitial_page_ != nullptr;
|
| }
|
|
|
| InterstitialPage* WebContentsImpl::GetInterstitialPage() const {
|
| - return GetRenderManager()->interstitial_page();
|
| + return interstitial_page_;
|
| }
|
|
|
| bool WebContentsImpl::IsSavable() {
|
| @@ -4275,8 +4269,7 @@ void WebContentsImpl::LoadingStateChanged(bool to_different_document,
|
| LoadNotificationDetails* details) {
|
| // Do not send notifications about loading changes in the FrameTree while the
|
| // interstitial page is pausing the throbber.
|
| - if (ShowingInterstitialPage() &&
|
| - GetRenderManager()->interstitial_page()->pause_throbber() &&
|
| + if (ShowingInterstitialPage() && interstitial_page_->pause_throbber() &&
|
| !due_to_interstitial) {
|
| return;
|
| }
|
| @@ -4991,8 +4984,7 @@ void WebContentsImpl::SetAsFocusedWebContentsIfNecessary() {
|
| GetRenderManager()->GetProxyToOuterDelegate()->SetFocusedFrame();
|
|
|
| if (ShowingInterstitialPage()) {
|
| - static_cast<RenderFrameHostImpl*>(
|
| - GetRenderManager()->interstitial_page()->GetMainFrame())
|
| + static_cast<RenderFrameHostImpl*>(interstitial_page_->GetMainFrame())
|
| ->GetRenderWidgetHost()
|
| ->SetPageFocus(true);
|
| } else {
|
| @@ -5201,6 +5193,10 @@ NavigationEntry*
|
| return controller_.GetLastCommittedEntry();
|
| }
|
|
|
| +InterstitialPageImpl* WebContentsImpl::GetInterstitialForRenderManager() {
|
| + return interstitial_page_;
|
| +}
|
| +
|
| void WebContentsImpl::CreateRenderWidgetHostViewForRenderManager(
|
| RenderViewHost* render_view_host) {
|
| RenderWidgetHostViewBase* rwh_view =
|
|
|