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

Side by Side Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 2954503003: Don't show current RenderWidgetHostView while interstitial is showing. (Closed)
Patch Set: Created 3 years, 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/frame_host/render_frame_host_manager.h" 5 #include "content/browser/frame_host/render_frame_host_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 RenderFrameHostManager::RenderFrameHostManager( 55 RenderFrameHostManager::RenderFrameHostManager(
56 FrameTreeNode* frame_tree_node, 56 FrameTreeNode* frame_tree_node,
57 RenderFrameHostDelegate* render_frame_delegate, 57 RenderFrameHostDelegate* render_frame_delegate,
58 RenderWidgetHostDelegate* render_widget_delegate, 58 RenderWidgetHostDelegate* render_widget_delegate,
59 Delegate* delegate) 59 Delegate* delegate)
60 : frame_tree_node_(frame_tree_node), 60 : frame_tree_node_(frame_tree_node),
61 delegate_(delegate), 61 delegate_(delegate),
62 render_frame_delegate_(render_frame_delegate), 62 render_frame_delegate_(render_frame_delegate),
63 render_widget_delegate_(render_widget_delegate), 63 render_widget_delegate_(render_widget_delegate),
64 interstitial_page_(nullptr),
65 weak_factory_(this) { 64 weak_factory_(this) {
66 DCHECK(frame_tree_node_); 65 DCHECK(frame_tree_node_);
67 } 66 }
68 67
69 RenderFrameHostManager::~RenderFrameHostManager() { 68 RenderFrameHostManager::~RenderFrameHostManager() {
70 if (pending_render_frame_host_) 69 if (pending_render_frame_host_)
71 UnsetPendingRenderFrameHost(); 70 UnsetPendingRenderFrameHost();
72 71
73 if (speculative_render_frame_host_) 72 if (speculative_render_frame_host_)
74 UnsetSpeculativeRenderFrameHost(); 73 UnsetSpeculativeRenderFrameHost();
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 if (speculative_render_frame_host_) 125 if (speculative_render_frame_host_)
127 return speculative_render_frame_host_->web_ui(); 126 return speculative_render_frame_host_->web_ui();
128 } else { 127 } else {
129 if (pending_render_frame_host_) 128 if (pending_render_frame_host_)
130 return pending_render_frame_host_->web_ui(); 129 return pending_render_frame_host_->web_ui();
131 } 130 }
132 return render_frame_host_->pending_web_ui(); 131 return render_frame_host_->pending_web_ui();
133 } 132 }
134 133
135 RenderWidgetHostView* RenderFrameHostManager::GetRenderWidgetHostView() const { 134 RenderWidgetHostView* RenderFrameHostManager::GetRenderWidgetHostView() const {
136 if (interstitial_page_) 135 if (delegate_->GetInterstitialForRenderManager())
137 return interstitial_page_->GetView(); 136 return delegate_->GetInterstitialForRenderManager()->GetView();
138 if (render_frame_host_) 137 if (render_frame_host_)
139 return render_frame_host_->GetView(); 138 return render_frame_host_->GetView();
140 return nullptr; 139 return nullptr;
141 } 140 }
142 141
143 bool RenderFrameHostManager::ForInnerDelegate() { 142 bool RenderFrameHostManager::ForInnerDelegate() {
144 return delegate_->GetOuterDelegateFrameTreeNodeId() != 143 return delegate_->GetOuterDelegateFrameTreeNodeId() !=
145 FrameTreeNode::kFrameTreeNodeInvalidId; 144 FrameTreeNode::kFrameTreeNodeInvalidId;
146 } 145 }
147 146
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1418 1417
1419 // TODO(creis): Once we intercept links and script-based navigations, we 1418 // TODO(creis): Once we intercept links and script-based navigations, we
1420 // will be able to enforce that all entries in a SiteInstance actually have 1419 // will be able to enforce that all entries in a SiteInstance actually have
1421 // the same site, and it will be safe to compare the URL against the 1420 // the same site, and it will be safe to compare the URL against the
1422 // SiteInstance's site, as follows: 1421 // SiteInstance's site, as follows:
1423 // const GURL& current_url = current_instance_impl->site(); 1422 // const GURL& current_url = current_instance_impl->site();
1424 // For now, though, we're in a hybrid model where you only switch 1423 // For now, though, we're in a hybrid model where you only switch
1425 // SiteInstances if you type in a cross-site URL. This means we have to 1424 // SiteInstances if you type in a cross-site URL. This means we have to
1426 // compare the entry's URL to the last committed entry's URL. 1425 // compare the entry's URL to the last committed entry's URL.
1427 NavigationEntry* current_entry = controller.GetLastCommittedEntry(); 1426 NavigationEntry* current_entry = controller.GetLastCommittedEntry();
1428 if (interstitial_page_) { 1427 if (delegate_->GetInterstitialForRenderManager()) {
1429 // The interstitial is currently the last committed entry, but we want to 1428 // The interstitial is currently the last committed entry, but we want to
1430 // compare against the last non-interstitial entry. 1429 // compare against the last non-interstitial entry.
1431 current_entry = controller.GetEntryAtOffset(-1); 1430 current_entry = controller.GetEntryAtOffset(-1);
1432 } 1431 }
1433 1432
1434 // View-source URLs must use a new SiteInstance and BrowsingInstance. 1433 // View-source URLs must use a new SiteInstance and BrowsingInstance.
1435 // We don't need a swap when going from view-source to a debug URL like 1434 // We don't need a swap when going from view-source to a debug URL like
1436 // chrome://crash, however. 1435 // chrome://crash, however.
1437 // TODO(creis): Refactor this method so this duplicated code isn't needed. 1436 // TODO(creis): Refactor this method so this duplicated code isn't needed.
1438 // See http://crbug.com/123007. 1437 // See http://crbug.com/123007.
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after
2844 resolved_url)) { 2843 resolved_url)) {
2845 DCHECK(!dest_instance || 2844 DCHECK(!dest_instance ||
2846 dest_instance == render_frame_host_->GetSiteInstance()); 2845 dest_instance == render_frame_host_->GetSiteInstance());
2847 return false; 2846 return false;
2848 } 2847 }
2849 2848
2850 return true; 2849 return true;
2851 } 2850 }
2852 2851
2853 void RenderFrameHostManager::EnsureRenderFrameHostVisibilityConsistent() { 2852 void RenderFrameHostManager::EnsureRenderFrameHostVisibilityConsistent() {
2854 if (render_frame_host_->GetView() && 2853 RenderWidgetHostView* view = GetRenderWidgetHostView();
2855 render_frame_host_->render_view_host()->GetWidget()->is_hidden() != 2854 if (view && static_cast<RenderWidgetHostImpl*>(view->GetRenderWidgetHost())
2856 delegate_->IsHidden()) { 2855 ->is_hidden() != delegate_->IsHidden()) {
2857 if (delegate_->IsHidden()) { 2856 if (delegate_->IsHidden()) {
2858 render_frame_host_->GetView()->Hide(); 2857 view->Hide();
2859 } else { 2858 } else {
2860 render_frame_host_->GetView()->Show(); 2859 view->Show();
2861 } 2860 }
2862 } 2861 }
2863 } 2862 }
2864 2863
2865 } // namespace content 2864 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698