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/browser/frame_host/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
6 | 6 |
7 #include "content/browser/frame_host/frame_tree_node.h" | 7 #include "content/browser/frame_host/frame_tree_node.h" |
8 #include "content/browser/frame_host/navigation_controller_impl.h" | 8 #include "content/browser/frame_host/navigation_controller_impl.h" |
9 #include "content/browser/frame_host/navigation_entry_impl.h" | 9 #include "content/browser/frame_host/navigation_entry_impl.h" |
10 #include "content/browser/frame_host/navigator_delegate.h" | 10 #include "content/browser/frame_host/navigator_delegate.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 int64 frame_id, | 31 int64 frame_id, |
32 int64 parent_frame_id, | 32 int64 parent_frame_id, |
33 bool is_main_frame, | 33 bool is_main_frame, |
34 const GURL& url) { | 34 const GURL& url) { |
35 bool is_error_page = (url.spec() == kUnreachableWebDataURL); | 35 bool is_error_page = (url.spec() == kUnreachableWebDataURL); |
36 bool is_iframe_srcdoc = (url.spec() == kAboutSrcDocURL); | 36 bool is_iframe_srcdoc = (url.spec() == kAboutSrcDocURL); |
37 GURL validated_url(url); | 37 GURL validated_url(url); |
38 RenderProcessHost* render_process_host = render_frame_host->GetProcess(); | 38 RenderProcessHost* render_process_host = render_frame_host->GetProcess(); |
39 RenderViewHost::FilterURL(render_process_host, false, &validated_url); | 39 RenderViewHost::FilterURL(render_process_host, false, &validated_url); |
40 | 40 |
| 41 // TODO(creis): This is a hack for now, until we mirror the frame tree and do |
| 42 // cross-process subframe navigations in actual subframes. As a result, we |
| 43 // can currently only support a single cross-process subframe per RVH. |
| 44 NavigationEntryImpl* pending_entry = |
| 45 NavigationEntryImpl::FromNavigationEntry(controller_->GetPendingEntry()); |
| 46 if (pending_entry && pending_entry->frame_tree_node_id() != -1) |
| 47 is_main_frame = false; |
| 48 |
41 if (is_main_frame) { | 49 if (is_main_frame) { |
42 // If there is no browser-initiated pending entry for this navigation and it | 50 // If there is no browser-initiated pending entry for this navigation and it |
43 // is not for the error URL, create a pending entry using the current | 51 // is not for the error URL, create a pending entry using the current |
44 // SiteInstance, and ensure the address bar updates accordingly. We don't | 52 // SiteInstance, and ensure the address bar updates accordingly. We don't |
45 // know the referrer or extra headers at this point, but the referrer will | 53 // know the referrer or extra headers at this point, but the referrer will |
46 // be set properly upon commit. | 54 // be set properly upon commit. |
47 NavigationEntryImpl* pending_entry = | |
48 NavigationEntryImpl::FromNavigationEntry( | |
49 controller_->GetPendingEntry()); | |
50 bool has_browser_initiated_pending_entry = pending_entry && | 55 bool has_browser_initiated_pending_entry = pending_entry && |
51 !pending_entry->is_renderer_initiated(); | 56 !pending_entry->is_renderer_initiated(); |
52 if (!has_browser_initiated_pending_entry && !is_error_page) { | 57 if (!has_browser_initiated_pending_entry && !is_error_page) { |
53 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( | 58 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( |
54 controller_->CreateNavigationEntry(validated_url, | 59 controller_->CreateNavigationEntry(validated_url, |
55 content::Referrer(), | 60 content::Referrer(), |
56 content::PAGE_TRANSITION_LINK, | 61 content::PAGE_TRANSITION_LINK, |
57 true /* is_renderer_initiated */, | 62 true /* is_renderer_initiated */, |
58 std::string(), | 63 std::string(), |
59 controller_->GetBrowserContext())); | 64 controller_->GetBrowserContext())); |
(...skipping 16 matching lines...) Expand all Loading... |
76 | 81 |
77 if (delegate_) { | 82 if (delegate_) { |
78 // Notify the observer about the start of the provisional load. | 83 // Notify the observer about the start of the provisional load. |
79 delegate_->DidStartProvisionalLoad( | 84 delegate_->DidStartProvisionalLoad( |
80 render_frame_host, frame_id, parent_frame_id, is_main_frame, | 85 render_frame_host, frame_id, parent_frame_id, is_main_frame, |
81 validated_url, is_error_page, is_iframe_srcdoc); | 86 validated_url, is_error_page, is_iframe_srcdoc); |
82 } | 87 } |
83 } | 88 } |
84 | 89 |
85 } // namespace content | 90 } // namespace content |
OLD | NEW |