| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |