Chromium Code Reviews| 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 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/linked_ptr.h" | |
| 8 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/browser/frame_host/navigation_controller_impl.h" | 11 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 11 #include "content/browser/frame_host/navigator.h" | 12 #include "content/browser/frame_host/navigator.h" |
| 12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 13 | 14 |
| 14 class GURL; | 15 class GURL; |
| 15 struct FrameMsg_Navigate_Params; | 16 struct FrameMsg_Navigate_Params; |
| 16 | 17 |
| 17 namespace content { | 18 namespace content { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 virtual void RequestTransferURL( | 61 virtual void RequestTransferURL( |
| 61 RenderFrameHostImpl* render_frame_host, | 62 RenderFrameHostImpl* render_frame_host, |
| 62 const GURL& url, | 63 const GURL& url, |
| 63 const std::vector<GURL>& redirect_chain, | 64 const std::vector<GURL>& redirect_chain, |
| 64 const Referrer& referrer, | 65 const Referrer& referrer, |
| 65 ui::PageTransition page_transition, | 66 ui::PageTransition page_transition, |
| 66 WindowOpenDisposition disposition, | 67 WindowOpenDisposition disposition, |
| 67 const GlobalRequestID& transferred_global_request_id, | 68 const GlobalRequestID& transferred_global_request_id, |
| 68 bool should_replace_current_entry, | 69 bool should_replace_current_entry, |
| 69 bool user_gesture) OVERRIDE; | 70 bool user_gesture) OVERRIDE; |
| 71 virtual void OnBeginNavigation( | |
| 72 FrameTreeNode* frame_tree_node, | |
| 73 const FrameHostMsg_BeginNavigation_Params& params, | |
| 74 const CommonNavigationParams& common_params) OVERRIDE; | |
| 70 virtual void CommitNavigation( | 75 virtual void CommitNavigation( |
| 71 RenderFrameHostImpl* render_frame_host, | 76 FrameTreeNode* frame_tree_node, |
| 72 const GURL& stream_url, | 77 const NavigationBeforeCommitInfo& info) OVERRIDE; |
| 73 const CommonNavigationParams& common_params, | 78 virtual void CancelNavigation(FrameTreeNode* frame_tree_node) OVERRIDE; |
| 74 const CommitNavigationParams& commit_params) OVERRIDE; | |
| 75 | 79 |
| 76 private: | 80 private: |
| 77 virtual ~NavigatorImpl() {} | 81 virtual ~NavigatorImpl(); |
| 78 | 82 |
| 79 // Navigates to the given entry, which must be the pending entry. Private | 83 // Navigates to the given entry, which must be the pending entry. Private |
| 80 // because all callers should use NavigateToPendingEntry. | 84 // because all callers should use NavigateToPendingEntry. |
| 81 bool NavigateToEntry( | 85 bool NavigateToEntry( |
| 82 RenderFrameHostImpl* render_frame_host, | 86 RenderFrameHostImpl* render_frame_host, |
| 83 const NavigationEntryImpl& entry, | 87 const NavigationEntryImpl& entry, |
| 84 NavigationController::ReloadType reload_type); | 88 NavigationController::ReloadType reload_type); |
| 85 | 89 |
| 86 bool ShouldAssignSiteForURL(const GURL& url); | 90 bool ShouldAssignSiteForURL(const GURL& url); |
| 87 | 91 |
| 88 void CheckWebUIRendererDoesNotDisplayNormalURL( | 92 void CheckWebUIRendererDoesNotDisplayNormalURL( |
| 89 RenderFrameHostImpl* render_frame_host, | 93 RenderFrameHostImpl* render_frame_host, |
| 90 const GURL& url); | 94 const GURL& url); |
| 91 | 95 |
| 96 // PlzNavigate: sends a RequestNavigation IPC to the renderer to ask it to | |
| 97 // navigate. If no live renderer is present, then the navigation request will | |
| 98 // be sent directly to the ResourceDispatcherHost. | |
| 99 bool RequestNavigation(FrameTreeNode* frame_tree_node, | |
| 100 const NavigationEntryImpl& entry, | |
| 101 NavigationController::ReloadType reload_type, | |
| 102 base::TimeTicks navigation_start); | |
| 103 | |
| 92 // The NavigationController that will keep track of session history for all | 104 // The NavigationController that will keep track of session history for all |
| 93 // RenderFrameHost objects using this NavigatorImpl. | 105 // RenderFrameHost objects using this NavigatorImpl. |
| 94 // TODO(nasko): Move ownership of the NavigationController from | 106 // TODO(nasko): Move ownership of the NavigationController from |
| 95 // WebContentsImpl to this class. | 107 // WebContentsImpl to this class. |
| 96 NavigationControllerImpl* controller_; | 108 NavigationControllerImpl* controller_; |
| 97 | 109 |
| 98 // Used to notify the object embedding this Navigator about navigation | 110 // Used to notify the object embedding this Navigator about navigation |
| 99 // events. Can be NULL in tests. | 111 // events. Can be NULL in tests. |
| 100 NavigatorDelegate* delegate_; | 112 NavigatorDelegate* delegate_; |
| 101 | 113 |
| 114 // PlzNavigate: used to track the various ongoing NavigationRequests in the | |
| 115 // different FrameTreeNode, based on the frame_tree_node_id. | |
|
nasko
2014/10/01 15:59:49
nit: nodes should be plural, based on the sentence
clamy
2014/10/01 17:10:43
Done.
| |
| 116 typedef base::hash_map<int64, linked_ptr<NavigationRequest>> | |
|
nasko
2014/10/01 15:59:50
Why linked_ptr? Why not scoped_ptr?
clamy
2014/10/01 17:10:43
I was under the impression that you should not put
nasko
2014/10/01 18:20:19
Why not use ScopedPtrHashMap then? Scoped pointers
clamy
2014/10/01 22:30:46
Because I did not know we had a ScopedPtrHashMap :
| |
| 117 NavigationRequestMap; | |
| 118 NavigationRequestMap navigation_request_map_; | |
|
carlosk
2014/10/01 18:31:10
More of a design discussion: this is in fact repli
clamy
2014/10/01 22:30:46
I don't think there is such a plan. And we are not
nasko
2014/10/02 00:09:39
There is no plan to have Navigator be 1-1 with Fra
| |
| 119 | |
| 102 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); | 120 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); |
| 103 }; | 121 }; |
| 104 | 122 |
| 105 } // namespace content | 123 } // namespace content |
| 106 | 124 |
| 107 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 125 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
| OLD | NEW |