OLD | NEW |
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/test/test_render_frame_host.h" | 5 #include "content/test/test_render_frame_host.h" |
6 | 6 |
7 #include "base/guid.h" | 7 #include "base/guid.h" |
8 #include "content/browser/frame_host/frame_tree.h" | 8 #include "content/browser/frame_host/frame_tree.h" |
9 #include "content/browser/frame_host/navigation_handle_impl.h" | 9 #include "content/browser/frame_host/navigation_handle_impl.h" |
10 #include "content/browser/frame_host/navigation_request.h" | 10 #include "content/browser/frame_host/navigation_request.h" |
11 #include "content/browser/frame_host/navigator.h" | 11 #include "content/browser/frame_host/navigator.h" |
12 #include "content/browser/frame_host/navigator_impl.h" | 12 #include "content/browser/frame_host/navigator_impl.h" |
13 #include "content/browser/frame_host/render_frame_host_delegate.h" | 13 #include "content/browser/frame_host/render_frame_host_delegate.h" |
14 #include "content/browser/web_contents/web_contents_impl.h" | 14 #include "content/browser/web_contents/web_contents_impl.h" |
15 #include "content/common/frame_messages.h" | 15 #include "content/common/frame_messages.h" |
| 16 #include "content/common/frame_owner_properties.h" |
16 #include "content/public/browser/stream_handle.h" | 17 #include "content/public/browser/stream_handle.h" |
17 #include "content/public/common/browser_side_navigation_policy.h" | 18 #include "content/public/common/browser_side_navigation_policy.h" |
18 #include "content/public/common/url_constants.h" | 19 #include "content/public/common/url_constants.h" |
19 #include "content/test/browser_side_navigation_test_utils.h" | 20 #include "content/test/browser_side_navigation_test_utils.h" |
20 #include "content/test/test_navigation_url_loader.h" | 21 #include "content/test/test_navigation_url_loader.h" |
21 #include "content/test/test_render_view_host.h" | 22 #include "content/test/test_render_view_host.h" |
22 #include "net/base/load_flags.h" | 23 #include "net/base/load_flags.h" |
23 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" | 24 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" |
24 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 25 #include "third_party/WebKit/public/web/WebSandboxFlags.h" |
25 #include "third_party/WebKit/public/web/WebTreeScopeType.h" | 26 #include "third_party/WebKit/public/web/WebTreeScopeType.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false); | 82 base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false); |
82 } | 83 } |
83 } | 84 } |
84 | 85 |
85 TestRenderFrameHost* TestRenderFrameHost::AppendChild( | 86 TestRenderFrameHost* TestRenderFrameHost::AppendChild( |
86 const std::string& frame_name) { | 87 const std::string& frame_name) { |
87 std::string frame_unique_name = base::GenerateGUID(); | 88 std::string frame_unique_name = base::GenerateGUID(); |
88 OnCreateChildFrame(GetProcess()->GetNextRoutingID(), | 89 OnCreateChildFrame(GetProcess()->GetNextRoutingID(), |
89 blink::WebTreeScopeType::Document, frame_name, | 90 blink::WebTreeScopeType::Document, frame_name, |
90 frame_unique_name, blink::WebSandboxFlags::None, | 91 frame_unique_name, blink::WebSandboxFlags::None, |
91 blink::WebFrameOwnerProperties()); | 92 FrameOwnerProperties()); |
92 return static_cast<TestRenderFrameHost*>( | 93 return static_cast<TestRenderFrameHost*>( |
93 child_creation_observer_.last_created_frame()); | 94 child_creation_observer_.last_created_frame()); |
94 } | 95 } |
95 | 96 |
96 void TestRenderFrameHost::Detach() { | 97 void TestRenderFrameHost::Detach() { |
97 OnDetach(); | 98 OnDetach(); |
98 } | 99 } |
99 | 100 |
100 void TestRenderFrameHost::SimulateNavigationStart(const GURL& url) { | 101 void TestRenderFrameHost::SimulateNavigationStart(const GURL& url) { |
101 if (IsBrowserSideNavigationEnabled()) { | 102 if (IsBrowserSideNavigationEnabled()) { |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 // cleared during DidFailProvisionalLoad). | 434 // cleared during DidFailProvisionalLoad). |
434 int page_id = entry ? entry->GetPageID() : -1; | 435 int page_id = entry ? entry->GetPageID() : -1; |
435 if (page_id == -1) { | 436 if (page_id == -1) { |
436 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); | 437 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); |
437 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; | 438 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; |
438 } | 439 } |
439 return page_id; | 440 return page_id; |
440 } | 441 } |
441 | 442 |
442 } // namespace content | 443 } // namespace content |
OLD | NEW |