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

Side by Side Diff: content/test/test_web_contents.cc

Issue 606113005: Move RenderViewHost swap out state to RenderFrameHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix review suggestions Created 6 years, 2 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 | « content/test/test_render_view_host.cc ('k') | 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/test/test_web_contents.h" 5 #include "content/test/test_web_contents.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/browser/browser_url_handler_impl.h" 9 #include "content/browser/browser_url_handler_impl.h"
10 #include "content/browser/frame_host/cross_process_frame_connector.h" 10 #include "content/browser/frame_host/cross_process_frame_connector.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 int page_id = entry->GetPageID(); 154 int page_id = entry->GetPageID();
155 if (page_id == -1) { 155 if (page_id == -1) {
156 // It's a new navigation, assign a never-seen page id to it. 156 // It's a new navigation, assign a never-seen page id to it.
157 page_id = GetMaxPageIDForSiteInstance(rfh->GetSiteInstance()) + 1; 157 page_id = GetMaxPageIDForSiteInstance(rfh->GetSiteInstance()) + 1;
158 } 158 }
159 159
160 rfh->SendNavigate(page_id, entry->GetURL()); 160 rfh->SendNavigate(page_id, entry->GetURL());
161 // Simulate the SwapOut_ACK. This is needed when cross-site navigation happens 161 // Simulate the SwapOut_ACK. This is needed when cross-site navigation happens
162 // (old_rfh != rfh). 162 // (old_rfh != rfh).
163 if (old_rfh != rfh) 163 if (old_rfh != rfh)
164 old_rfh->OnSwappedOut(false); 164 old_rfh->OnSwappedOut();
165 } 165 }
166 166
167 void TestWebContents::ProceedWithCrossSiteNavigation() { 167 void TestWebContents::ProceedWithCrossSiteNavigation() {
168 if (!GetPendingMainFrame()) 168 if (!GetPendingMainFrame())
169 return; 169 return;
170 GetMainFrame()->GetRenderViewHost()->SendBeforeUnloadACK(true); 170 GetMainFrame()->SendBeforeUnloadACK(true);
171 } 171 }
172 172
173 RenderViewHostDelegateView* TestWebContents::GetDelegateView() { 173 RenderViewHostDelegateView* TestWebContents::GetDelegateView() {
174 if (delegate_view_override_) 174 if (delegate_view_override_)
175 return delegate_view_override_; 175 return delegate_view_override_;
176 return WebContentsImpl::GetDelegateView(); 176 return WebContentsImpl::GetDelegateView();
177 } 177 }
178 178
179 void TestWebContents::SetOpener(TestWebContents* opener) { 179 void TestWebContents::SetOpener(TestWebContents* opener) {
180 // This is normally only set in the WebContents constructor, which also 180 // This is normally only set in the WebContents constructor, which also
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 250 }
251 251
252 void TestWebContents::ShowCreatedWidget(int route_id, 252 void TestWebContents::ShowCreatedWidget(int route_id,
253 const gfx::Rect& initial_pos) { 253 const gfx::Rect& initial_pos) {
254 } 254 }
255 255
256 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { 256 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) {
257 } 257 }
258 258
259 } // namespace content 259 } // namespace content
OLDNEW
« no previous file with comments | « content/test/test_render_view_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698