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

Unified Diff: content/browser/frame_host/navigation_handle_impl.h

Issue 2657323003: Convert HistoryTabHelper to use the new navigation callbacks. (Closed)
Patch Set: better fix to send this data from the renderer initially Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_handle_impl.h
diff --git a/content/browser/frame_host/navigation_handle_impl.h b/content/browser/frame_host/navigation_handle_impl.h
index 279c45977f11f54826448381cc86351d1f125bae..26e62cdf2a79bbc5de8b853f2322748c92729550 100644
--- a/content/browser/frame_host/navigation_handle_impl.h
+++ b/content/browser/frame_host/navigation_handle_impl.h
@@ -76,12 +76,15 @@ class ServiceWorkerNavigationHandle;
// the RenderFrameHost still apply.
class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
public:
+ // If |redirect_chain| is empty, then the redirect chain will be created to
+ // start with |url|. Otherwise |redirect_chain| is used as the starting point.
// |navigation_start| comes from the DidStartProvisionalLoad IPC, which tracks
// both renderer-initiated and browser-initiated navigation start.
// PlzNavigate: This value always comes from the CommonNavigationParams
// associated with this navigation.
static std::unique_ptr<NavigationHandleImpl> Create(
const GURL& url,
+ const std::vector<GURL>& redirect_chain,
FrameTreeNode* frame_tree_node,
bool is_renderer_initiated,
bool is_same_page,
@@ -111,6 +114,8 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
bool IsSamePage() override;
bool HasCommitted() override;
bool IsErrorPage() override;
+ bool DidReplaceEntry() override;
+ bool ShouldUpdateHistory() override;
const net::HttpResponseHeaders* GetResponseHeaders() override;
net::HttpResponseInfo::ConnectionInfo GetConnectionInfo() override;
void Resume() override;
@@ -276,9 +281,11 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
// Called when the navigation was committed in |render_frame_host|. This will
// update the |state_|.
+ // |did_replace_entry| is true if the committed entry has replaced the
+ // existing one. A non-user initiated redirect causes such replacement.
void DidCommitNavigation(
const FrameHostMsg_DidCommitProvisionalLoad_Params& params,
- bool same_page,
+ bool did_replace_entry,
RenderFrameHostImpl* render_frame_host);
// Called during commit. Takes ownership of the embedder's NavigationData
@@ -321,6 +328,7 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
};
NavigationHandleImpl(const GURL& url,
+ const std::vector<GURL>& redirect_chain,
FrameTreeNode* frame_tree_node,
bool is_renderer_initiated,
bool is_same_page,
@@ -367,6 +375,8 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
const bool is_renderer_initiated_;
const bool is_same_page_;
bool was_redirected_;
+ bool did_replace_entry_;
+ bool should_update_history_;
scoped_refptr<net::HttpResponseHeaders> response_headers_;
net::HttpResponseInfo::ConnectionInfo connection_info_;

Powered by Google App Engine
This is Rietveld 408576698