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

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

Issue 1667163002: Add methods to NavigationHandle to allow refactoring webNavigation to use it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes based on Camille's review. Created 4 years, 10 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.cc
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
index 9dfe16c5340b02cfab9f7eb592c63c7b5c7d06f6..477a2b0bf79f238c255d57d6b78006284a8b2554 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -33,14 +33,18 @@ void UpdateThrottleCheckResult(
scoped_ptr<NavigationHandleImpl> NavigationHandleImpl::Create(
const GURL& url,
FrameTreeNode* frame_tree_node,
+ bool is_synchronous,
+ bool is_srcdoc,
const base::TimeTicks& navigation_start) {
- return scoped_ptr<NavigationHandleImpl>(
- new NavigationHandleImpl(url, frame_tree_node, navigation_start));
+ return scoped_ptr<NavigationHandleImpl>(new NavigationHandleImpl(
+ url, frame_tree_node, is_synchronous, is_srcdoc, navigation_start));
}
NavigationHandleImpl::NavigationHandleImpl(
const GURL& url,
FrameTreeNode* frame_tree_node,
+ bool is_synchronous,
+ bool is_srcdoc,
const base::TimeTicks& navigation_start)
: url_(url),
is_post_(false),
@@ -50,6 +54,9 @@ NavigationHandleImpl::NavigationHandleImpl(
net_error_code_(net::OK),
render_frame_host_(nullptr),
is_same_page_(false),
+ is_synchronous_(is_synchronous),
+ is_srcdoc_(is_srcdoc),
+ was_redirected_(false),
state_(INITIAL),
is_transferring_(false),
frame_tree_node_(frame_tree_node),
@@ -80,6 +87,36 @@ bool NavigationHandleImpl::IsInMainFrame() {
return frame_tree_node_->IsMainFrame();
}
+bool NavigationHandleImpl::IsParentMainFrame() {
+ if (frame_tree_node_->parent())
+ return frame_tree_node_->parent()->IsMainFrame();
+
+ return false;
+}
+
+bool NavigationHandleImpl::IsSynchronousNavigation() {
+ return is_synchronous_;
+}
+
+bool NavigationHandleImpl::IsSrcdoc() {
+ return is_srcdoc_;
+}
+
+bool NavigationHandleImpl::WasServerRedirect() {
+ return was_redirected_;
+}
+
+int NavigationHandleImpl::GetFrameTreeNodeId() {
+ return frame_tree_node_->frame_tree_node_id();
+}
+
+int NavigationHandleImpl::GetParentFrameTreeNodeId() {
+ if (frame_tree_node_->IsMainFrame())
+ return FrameTreeNode::kFrameTreeNodeInvalidId;
+
+ return frame_tree_node_->parent()->frame_tree_node_id();
+}
+
const base::TimeTicks& NavigationHandleImpl::NavigationStart() {
return navigation_start_;
}
@@ -268,6 +305,7 @@ void NavigationHandleImpl::WillRedirectRequest(
sanitized_referrer_ = Referrer::SanitizeForRequest(url_, sanitized_referrer_);
is_external_protocol_ = new_is_external_protocol;
response_headers_ = response_headers;
+ was_redirected_ = true;
state_ = WILL_REDIRECT_REQUEST;
complete_callback_ = callback;
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.h ('k') | content/browser/frame_host/navigation_handle_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698