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

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

Issue 2938313002: Don't show current RenderWidgetHostView while interstitial is showing. (Closed)
Patch Set: Fix typo. Created 3 years, 6 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 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 1430
1432 // TODO(creis): Once we intercept links and script-based navigations, we 1431 // TODO(creis): Once we intercept links and script-based navigations, we
1433 // will be able to enforce that all entries in a SiteInstance actually have 1432 // will be able to enforce that all entries in a SiteInstance actually have
1434 // the same site, and it will be safe to compare the URL against the 1433 // the same site, and it will be safe to compare the URL against the
1435 // SiteInstance's site, as follows: 1434 // SiteInstance's site, as follows:
1436 // const GURL& current_url = current_instance_impl->site(); 1435 // const GURL& current_url = current_instance_impl->site();
1437 // For now, though, we're in a hybrid model where you only switch 1436 // For now, though, we're in a hybrid model where you only switch
1438 // SiteInstances if you type in a cross-site URL. This means we have to 1437 // SiteInstances if you type in a cross-site URL. This means we have to
1439 // compare the entry's URL to the last committed entry's URL. 1438 // compare the entry's URL to the last committed entry's URL.
1440 NavigationEntry* current_entry = controller.GetLastCommittedEntry(); 1439 NavigationEntry* current_entry = controller.GetLastCommittedEntry();
1441 if (interstitial_page_) { 1440 if (delegate_->GetInterstitialForRenderManager()) {
1442 // The interstitial is currently the last committed entry, but we want to 1441 // The interstitial is currently the last committed entry, but we want to
1443 // compare against the last non-interstitial entry. 1442 // compare against the last non-interstitial entry.
1444 current_entry = controller.GetEntryAtOffset(-1); 1443 current_entry = controller.GetEntryAtOffset(-1);
1445 } 1444 }
1446 1445
1447 // View-source URLs must use a new SiteInstance and BrowsingInstance. 1446 // View-source URLs must use a new SiteInstance and BrowsingInstance.
1448 // We don't need a swap when going from view-source to a debug URL like 1447 // We don't need a swap when going from view-source to a debug URL like
1449 // chrome://crash, however. 1448 // chrome://crash, however.
1450 // TODO(creis): Refactor this method so this duplicated code isn't needed. 1449 // TODO(creis): Refactor this method so this duplicated code isn't needed.
1451 // See http://crbug.com/123007. 1450 // See http://crbug.com/123007.
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after
2857 resolved_url)) { 2856 resolved_url)) {
2858 DCHECK(!dest_instance || 2857 DCHECK(!dest_instance ||
2859 dest_instance == render_frame_host_->GetSiteInstance()); 2858 dest_instance == render_frame_host_->GetSiteInstance());
2860 return false; 2859 return false;
2861 } 2860 }
2862 2861
2863 return true; 2862 return true;
2864 } 2863 }
2865 2864
2866 void RenderFrameHostManager::EnsureRenderFrameHostVisibilityConsistent() { 2865 void RenderFrameHostManager::EnsureRenderFrameHostVisibilityConsistent() {
2867 if (render_frame_host_->GetView() && 2866 RenderWidgetHostView* view = GetRenderWidgetHostView();
2868 render_frame_host_->render_view_host()->GetWidget()->is_hidden() != 2867 if (view && static_cast<RenderWidgetHostImpl*>(view->GetRenderWidgetHost())
2869 delegate_->IsHidden()) { 2868 ->is_hidden() != delegate_->IsHidden()) {
2870 if (delegate_->IsHidden()) { 2869 if (delegate_->IsHidden()) {
2871 render_frame_host_->GetView()->Hide(); 2870 view->Hide();
2872 } else { 2871 } else {
2873 render_frame_host_->GetView()->Show(); 2872 view->Show();
2874 } 2873 }
2875 } 2874 }
2876 } 2875 }
2877 2876
2878 } // namespace content 2877 } // 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