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/containers/scoped_ptr_hash_map.h" | 8 #include "base/containers/scoped_ptr_hash_map.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 class NavigatorTest; | 25 class NavigatorTest; |
26 struct LoadCommittedDetails; | 26 struct LoadCommittedDetails; |
27 | 27 |
28 // This class is an implementation of Navigator, responsible for managing | 28 // This class is an implementation of Navigator, responsible for managing |
29 // navigations in regular browser tabs. | 29 // navigations in regular browser tabs. |
30 class CONTENT_EXPORT NavigatorImpl : public Navigator { | 30 class CONTENT_EXPORT NavigatorImpl : public Navigator { |
31 public: | 31 public: |
32 NavigatorImpl(NavigationControllerImpl* navigation_controller, | 32 NavigatorImpl(NavigationControllerImpl* navigation_controller, |
33 NavigatorDelegate* delegate); | 33 NavigatorDelegate* delegate); |
34 | 34 |
| 35 static void CheckWebUIRendererDoesNotDisplayNormalURL( |
| 36 RenderFrameHostImpl* render_frame_host, |
| 37 const GURL& url); |
| 38 |
35 // Navigator implementation. | 39 // Navigator implementation. |
36 NavigatorDelegate* GetDelegate() override; | 40 NavigatorDelegate* GetDelegate() override; |
37 NavigationController* GetController() override; | 41 NavigationController* GetController() override; |
38 void DidStartProvisionalLoad( | 42 void DidStartProvisionalLoad( |
39 RenderFrameHostImpl* render_frame_host, | 43 RenderFrameHostImpl* render_frame_host, |
40 const GURL& url, | 44 const GURL& url, |
41 const base::TimeTicks& navigation_start) override; | 45 const base::TimeTicks& navigation_start) override; |
42 void DidFailProvisionalLoadWithError( | 46 void DidFailProvisionalLoadWithError( |
43 RenderFrameHostImpl* render_frame_host, | 47 RenderFrameHostImpl* render_frame_host, |
44 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) | 48 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) |
(...skipping 25 matching lines...) Expand all Loading... |
70 const std::vector<GURL>& redirect_chain, | 74 const std::vector<GURL>& redirect_chain, |
71 const Referrer& referrer, | 75 const Referrer& referrer, |
72 ui::PageTransition page_transition, | 76 ui::PageTransition page_transition, |
73 const GlobalRequestID& transferred_global_request_id, | 77 const GlobalRequestID& transferred_global_request_id, |
74 bool should_replace_current_entry) override; | 78 bool should_replace_current_entry) override; |
75 void OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, bool proceed) override; | 79 void OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, bool proceed) override; |
76 void OnBeginNavigation(FrameTreeNode* frame_tree_node, | 80 void OnBeginNavigation(FrameTreeNode* frame_tree_node, |
77 const CommonNavigationParams& common_params, | 81 const CommonNavigationParams& common_params, |
78 const BeginNavigationParams& begin_params, | 82 const BeginNavigationParams& begin_params, |
79 scoped_refptr<ResourceRequestBody> body) override; | 83 scoped_refptr<ResourceRequestBody> body) override; |
80 void CommitNavigation(NavigationRequest* navigation_request, | |
81 ResourceResponse* response, | |
82 scoped_ptr<StreamHandle> body) override; | |
83 void FailedNavigation(FrameTreeNode* frame_tree_node, | 84 void FailedNavigation(FrameTreeNode* frame_tree_node, |
84 bool has_stale_copy_in_cache, | 85 bool has_stale_copy_in_cache, |
85 int error_code) override; | 86 int error_code) override; |
86 void LogResourceRequestTime(base::TimeTicks timestamp, | 87 void LogResourceRequestTime(base::TimeTicks timestamp, |
87 const GURL& url) override; | 88 const GURL& url) override; |
88 void LogBeforeUnloadTime( | 89 void LogBeforeUnloadTime( |
89 const base::TimeTicks& renderer_before_unload_start_time, | 90 const base::TimeTicks& renderer_before_unload_start_time, |
90 const base::TimeTicks& renderer_before_unload_end_time) override; | 91 const base::TimeTicks& renderer_before_unload_end_time) override; |
91 void CancelNavigation(FrameTreeNode* frame_tree_node) override; | 92 void CancelNavigation(FrameTreeNode* frame_tree_node) override; |
92 | 93 |
93 private: | 94 private: |
94 // Holds data used to track browser side navigation metrics. | 95 // Holds data used to track browser side navigation metrics. |
95 struct NavigationMetricsData; | 96 struct NavigationMetricsData; |
96 | 97 |
97 friend class NavigatorTestWithBrowserSideNavigation; | 98 friend class NavigatorTestWithBrowserSideNavigation; |
98 ~NavigatorImpl() override; | 99 ~NavigatorImpl() override; |
99 | 100 |
100 // Navigates to the given entry, which might be the pending entry (if | 101 // Navigates to the given entry, which might be the pending entry (if |
101 // |is_pending_entry| is true). Private because all callers should use either | 102 // |is_pending_entry| is true). Private because all callers should use either |
102 // NavigateToPendingEntry or NavigateToNewChildFrame. | 103 // NavigateToPendingEntry or NavigateToNewChildFrame. |
103 bool NavigateToEntry(FrameTreeNode* frame_tree_node, | 104 bool NavigateToEntry(FrameTreeNode* frame_tree_node, |
104 const FrameNavigationEntry& frame_entry, | 105 const FrameNavigationEntry& frame_entry, |
105 const NavigationEntryImpl& entry, | 106 const NavigationEntryImpl& entry, |
106 NavigationController::ReloadType reload_type, | 107 NavigationController::ReloadType reload_type, |
107 bool is_same_document_history_load, | 108 bool is_same_document_history_load, |
108 bool is_pending_entry); | 109 bool is_pending_entry); |
109 | 110 |
110 bool ShouldAssignSiteForURL(const GURL& url); | 111 bool ShouldAssignSiteForURL(const GURL& url); |
111 | 112 |
112 void CheckWebUIRendererDoesNotDisplayNormalURL( | |
113 RenderFrameHostImpl* render_frame_host, | |
114 const GURL& url); | |
115 | |
116 // PlzNavigate: if needed, sends a BeforeUnload IPC to the renderer to ask it | 113 // PlzNavigate: if needed, sends a BeforeUnload IPC to the renderer to ask it |
117 // to execute the beforeUnload event. Otherwise, the navigation request will | 114 // to execute the beforeUnload event. Otherwise, the navigation request will |
118 // be started. | 115 // be started. |
119 void RequestNavigation(FrameTreeNode* frame_tree_node, | 116 void RequestNavigation(FrameTreeNode* frame_tree_node, |
120 const GURL& dest_url, | 117 const GURL& dest_url, |
121 const Referrer& dest_referrer, | 118 const Referrer& dest_referrer, |
122 const FrameNavigationEntry& frame_entry, | 119 const FrameNavigationEntry& frame_entry, |
123 const NavigationEntryImpl& entry, | 120 const NavigationEntryImpl& entry, |
124 NavigationController::ReloadType reload_type, | 121 NavigationController::ReloadType reload_type, |
125 LoFiState lofi_state, | 122 LoFiState lofi_state, |
(...skipping 27 matching lines...) Expand all Loading... |
153 NavigatorDelegate* delegate_; | 150 NavigatorDelegate* delegate_; |
154 | 151 |
155 scoped_ptr<NavigatorImpl::NavigationMetricsData> navigation_data_; | 152 scoped_ptr<NavigatorImpl::NavigationMetricsData> navigation_data_; |
156 | 153 |
157 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); | 154 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); |
158 }; | 155 }; |
159 | 156 |
160 } // namespace content | 157 } // namespace content |
161 | 158 |
162 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 159 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
OLD | NEW |