| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/navigation_handle_impl.h" | 5 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/debug/dump_without_crashing.h" | 9 #include "base/debug/dump_without_crashing.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 | 42 |
| 43 } // namespace | 43 } // namespace |
| 44 | 44 |
| 45 // static | 45 // static |
| 46 std::unique_ptr<NavigationHandleImpl> NavigationHandleImpl::Create( | 46 std::unique_ptr<NavigationHandleImpl> NavigationHandleImpl::Create( |
| 47 const GURL& url, | 47 const GURL& url, |
| 48 FrameTreeNode* frame_tree_node, | 48 FrameTreeNode* frame_tree_node, |
| 49 bool is_renderer_initiated, | 49 bool is_renderer_initiated, |
| 50 bool is_same_page, | 50 bool is_same_page, |
| 51 bool is_srcdoc, | |
| 52 const base::TimeTicks& navigation_start, | 51 const base::TimeTicks& navigation_start, |
| 53 int pending_nav_entry_id, | 52 int pending_nav_entry_id, |
| 54 bool started_from_context_menu) { | 53 bool started_from_context_menu) { |
| 55 return std::unique_ptr<NavigationHandleImpl>(new NavigationHandleImpl( | 54 return std::unique_ptr<NavigationHandleImpl>(new NavigationHandleImpl( |
| 56 url, frame_tree_node, is_renderer_initiated, is_same_page, is_srcdoc, | 55 url, frame_tree_node, is_renderer_initiated, is_same_page, |
| 57 navigation_start, pending_nav_entry_id, started_from_context_menu)); | 56 navigation_start, pending_nav_entry_id, started_from_context_menu)); |
| 58 } | 57 } |
| 59 | 58 |
| 60 NavigationHandleImpl::NavigationHandleImpl( | 59 NavigationHandleImpl::NavigationHandleImpl( |
| 61 const GURL& url, | 60 const GURL& url, |
| 62 FrameTreeNode* frame_tree_node, | 61 FrameTreeNode* frame_tree_node, |
| 63 bool is_renderer_initiated, | 62 bool is_renderer_initiated, |
| 64 bool is_same_page, | 63 bool is_same_page, |
| 65 bool is_srcdoc, | |
| 66 const base::TimeTicks& navigation_start, | 64 const base::TimeTicks& navigation_start, |
| 67 int pending_nav_entry_id, | 65 int pending_nav_entry_id, |
| 68 bool started_from_context_menu) | 66 bool started_from_context_menu) |
| 69 : url_(url), | 67 : url_(url), |
| 70 has_user_gesture_(false), | 68 has_user_gesture_(false), |
| 71 transition_(ui::PAGE_TRANSITION_LINK), | 69 transition_(ui::PAGE_TRANSITION_LINK), |
| 72 is_external_protocol_(false), | 70 is_external_protocol_(false), |
| 73 net_error_code_(net::OK), | 71 net_error_code_(net::OK), |
| 74 render_frame_host_(nullptr), | 72 render_frame_host_(nullptr), |
| 75 is_renderer_initiated_(is_renderer_initiated), | 73 is_renderer_initiated_(is_renderer_initiated), |
| 76 is_same_page_(is_same_page), | 74 is_same_page_(is_same_page), |
| 77 is_srcdoc_(is_srcdoc), | |
| 78 was_redirected_(false), | 75 was_redirected_(false), |
| 79 connection_info_(net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN), | 76 connection_info_(net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN), |
| 80 original_url_(url), | 77 original_url_(url), |
| 81 state_(INITIAL), | 78 state_(INITIAL), |
| 82 is_transferring_(false), | 79 is_transferring_(false), |
| 83 frame_tree_node_(frame_tree_node), | 80 frame_tree_node_(frame_tree_node), |
| 84 next_index_(0), | 81 next_index_(0), |
| 85 navigation_start_(navigation_start), | 82 navigation_start_(navigation_start), |
| 86 pending_nav_entry_id_(pending_nav_entry_id), | 83 pending_nav_entry_id_(pending_nav_entry_id), |
| 87 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED), | 84 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED), |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 if (frame_tree_node_->parent()) | 144 if (frame_tree_node_->parent()) |
| 148 return frame_tree_node_->parent()->IsMainFrame(); | 145 return frame_tree_node_->parent()->IsMainFrame(); |
| 149 | 146 |
| 150 return false; | 147 return false; |
| 151 } | 148 } |
| 152 | 149 |
| 153 bool NavigationHandleImpl::IsRendererInitiated() { | 150 bool NavigationHandleImpl::IsRendererInitiated() { |
| 154 return is_renderer_initiated_; | 151 return is_renderer_initiated_; |
| 155 } | 152 } |
| 156 | 153 |
| 157 bool NavigationHandleImpl::IsSrcdoc() { | |
| 158 return is_srcdoc_; | |
| 159 } | |
| 160 | |
| 161 bool NavigationHandleImpl::WasServerRedirect() { | 154 bool NavigationHandleImpl::WasServerRedirect() { |
| 162 return was_redirected_; | 155 return was_redirected_; |
| 163 } | 156 } |
| 164 | 157 |
| 165 int NavigationHandleImpl::GetFrameTreeNodeId() { | 158 int NavigationHandleImpl::GetFrameTreeNodeId() { |
| 166 return frame_tree_node_->frame_tree_node_id(); | 159 return frame_tree_node_->frame_tree_node_id(); |
| 167 } | 160 } |
| 168 | 161 |
| 169 int NavigationHandleImpl::GetParentFrameTreeNodeId() { | 162 int NavigationHandleImpl::GetParentFrameTreeNodeId() { |
| 170 if (frame_tree_node_->IsMainFrame()) | 163 if (frame_tree_node_->IsMainFrame()) |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 throttles_to_register.end()); | 752 throttles_to_register.end()); |
| 760 throttles_to_register.weak_clear(); | 753 throttles_to_register.weak_clear(); |
| 761 } | 754 } |
| 762 } | 755 } |
| 763 | 756 |
| 764 bool NavigationHandleImpl::WasStartedFromContextMenu() const { | 757 bool NavigationHandleImpl::WasStartedFromContextMenu() const { |
| 765 return started_from_context_menu_; | 758 return started_from_context_menu_; |
| 766 } | 759 } |
| 767 | 760 |
| 768 } // namespace content | 761 } // namespace content |
| OLD | NEW |