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 "content/browser/frame_host/ancestor_throttle.h" | 9 #include "content/browser/frame_host/ancestor_throttle.h" |
10 #include "content/browser/frame_host/frame_tree_node.h" | 10 #include "content/browser/frame_host/frame_tree_node.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 NavigationThrottle::ThrottleCheckResult result) { | 27 NavigationThrottle::ThrottleCheckResult result) { |
28 *to_update = result; | 28 *to_update = result; |
29 } | 29 } |
30 | 30 |
31 } // namespace | 31 } // namespace |
32 | 32 |
33 // static | 33 // static |
34 std::unique_ptr<NavigationHandleImpl> NavigationHandleImpl::Create( | 34 std::unique_ptr<NavigationHandleImpl> NavigationHandleImpl::Create( |
35 const GURL& url, | 35 const GURL& url, |
36 FrameTreeNode* frame_tree_node, | 36 FrameTreeNode* frame_tree_node, |
| 37 bool is_renderer_initiated, |
37 bool is_synchronous, | 38 bool is_synchronous, |
38 bool is_srcdoc, | 39 bool is_srcdoc, |
39 const base::TimeTicks& navigation_start, | 40 const base::TimeTicks& navigation_start, |
40 int pending_nav_entry_id) { | 41 int pending_nav_entry_id) { |
41 return std::unique_ptr<NavigationHandleImpl>( | 42 return std::unique_ptr<NavigationHandleImpl>( |
42 new NavigationHandleImpl(url, frame_tree_node, is_synchronous, is_srcdoc, | 43 new NavigationHandleImpl(url, frame_tree_node, is_renderer_initiated, |
43 navigation_start, pending_nav_entry_id)); | 44 is_synchronous, is_srcdoc, navigation_start, |
| 45 pending_nav_entry_id)); |
44 } | 46 } |
45 | 47 |
46 NavigationHandleImpl::NavigationHandleImpl( | 48 NavigationHandleImpl::NavigationHandleImpl( |
47 const GURL& url, | 49 const GURL& url, |
48 FrameTreeNode* frame_tree_node, | 50 FrameTreeNode* frame_tree_node, |
| 51 bool is_renderer_initiated, |
49 bool is_synchronous, | 52 bool is_synchronous, |
50 bool is_srcdoc, | 53 bool is_srcdoc, |
51 const base::TimeTicks& navigation_start, | 54 const base::TimeTicks& navigation_start, |
52 int pending_nav_entry_id) | 55 int pending_nav_entry_id) |
53 : url_(url), | 56 : url_(url), |
54 has_user_gesture_(false), | 57 has_user_gesture_(false), |
55 transition_(ui::PAGE_TRANSITION_LINK), | 58 transition_(ui::PAGE_TRANSITION_LINK), |
56 is_external_protocol_(false), | 59 is_external_protocol_(false), |
57 net_error_code_(net::OK), | 60 net_error_code_(net::OK), |
58 render_frame_host_(nullptr), | 61 render_frame_host_(nullptr), |
| 62 is_renderer_initiated_(is_renderer_initiated), |
59 is_same_page_(false), | 63 is_same_page_(false), |
60 is_synchronous_(is_synchronous), | 64 is_synchronous_(is_synchronous), |
61 is_srcdoc_(is_srcdoc), | 65 is_srcdoc_(is_srcdoc), |
62 was_redirected_(false), | 66 was_redirected_(false), |
63 state_(INITIAL), | 67 state_(INITIAL), |
64 is_transferring_(false), | 68 is_transferring_(false), |
65 frame_tree_node_(frame_tree_node), | 69 frame_tree_node_(frame_tree_node), |
66 next_index_(0), | 70 next_index_(0), |
67 navigation_start_(navigation_start), | 71 navigation_start_(navigation_start), |
68 pending_nav_entry_id_(pending_nav_entry_id) { | 72 pending_nav_entry_id_(pending_nav_entry_id) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 return frame_tree_node_->IsMainFrame(); | 107 return frame_tree_node_->IsMainFrame(); |
104 } | 108 } |
105 | 109 |
106 bool NavigationHandleImpl::IsParentMainFrame() { | 110 bool NavigationHandleImpl::IsParentMainFrame() { |
107 if (frame_tree_node_->parent()) | 111 if (frame_tree_node_->parent()) |
108 return frame_tree_node_->parent()->IsMainFrame(); | 112 return frame_tree_node_->parent()->IsMainFrame(); |
109 | 113 |
110 return false; | 114 return false; |
111 } | 115 } |
112 | 116 |
| 117 bool NavigationHandleImpl::IsRendererInitiated() { |
| 118 return is_renderer_initiated_; |
| 119 } |
| 120 |
113 bool NavigationHandleImpl::IsSynchronousNavigation() { | 121 bool NavigationHandleImpl::IsSynchronousNavigation() { |
114 return is_synchronous_; | 122 return is_synchronous_; |
115 } | 123 } |
116 | 124 |
117 bool NavigationHandleImpl::IsSrcdoc() { | 125 bool NavigationHandleImpl::IsSrcdoc() { |
118 return is_srcdoc_; | 126 return is_srcdoc_; |
119 } | 127 } |
120 | 128 |
121 bool NavigationHandleImpl::WasServerRedirect() { | 129 bool NavigationHandleImpl::WasServerRedirect() { |
122 return was_redirected_; | 130 return was_redirected_; |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 complete_callback_.Reset(); | 510 complete_callback_.Reset(); |
503 | 511 |
504 if (!callback.is_null()) | 512 if (!callback.is_null()) |
505 callback.Run(result); | 513 callback.Run(result); |
506 | 514 |
507 // No code after running the callback, as it might have resulted in our | 515 // No code after running the callback, as it might have resulted in our |
508 // destruction. | 516 // destruction. |
509 } | 517 } |
510 | 518 |
511 } // namespace content | 519 } // namespace content |
OLD | NEW |