Avi Drissman | 4e1b7bc3 | 2022-09-15 14:03:50 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CONTENT_BROWSER_RENDERER_HOST_NAVIGATOR_H_ |
| 6 | #define CONTENT_BROWSER_RENDERER_HOST_NAVIGATOR_H_ |
| 7 | |
| 8 | #include <memory> |
Arthur Sonzogni | c686e8f | 2024-01-11 08:36:37 | [diff] [blame] | 9 | #include <optional> |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 10 | |
Keishi Hattori | 0e45c02 | 2021-11-27 09:25:52 | [diff] [blame] | 11 | #include "base/memory/raw_ptr.h" |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 12 | #include "base/memory/ref_counted.h" |
Carlos Caballero | 40b0efd | 2021-01-26 11:55:00 | [diff] [blame] | 13 | #include "content/browser/renderer_host/navigation_controller_impl.h" |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 14 | #include "content/common/content_export.h" |
| 15 | #include "content/common/navigation_client.mojom.h" |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 16 | #include "content/public/browser/navigation_controller.h" |
Rakina Zata Amni | 58681c6 | 2024-06-25 06:32:13 | [diff] [blame] | 17 | #include "content/public/browser/navigation_discard_reason.h" |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 18 | #include "mojo/public/cpp/bindings/pending_associated_remote.h" |
| 19 | #include "mojo/public/cpp/bindings/pending_remote.h" |
W. James MacLean | 443ef3e | 2024-07-16 13:42:34 | [diff] [blame] | 20 | #include "net/storage_access_api/status.h" |
Gyuyoung Kim | 38e6363 | 2021-01-14 13:11:39 | [diff] [blame] | 21 | #include "third_party/blink/public/common/navigation/impression.h" |
Gyuyoung Kim | d85bd89 | 2021-04-13 02:11:55 | [diff] [blame] | 22 | #include "third_party/blink/public/mojom/frame/triggering_event_info.mojom-shared.h" |
Yao Xiao | 720ef9d6 | 2022-12-09 05:18:29 | [diff] [blame] | 23 | #include "third_party/blink/public/mojom/navigation/navigation_initiator_activation_and_ad_status.mojom.h" |
Minggang Wang | b9f3fa9 | 2021-07-01 15:30:31 | [diff] [blame] | 24 | #include "third_party/blink/public/mojom/navigation/navigation_params.mojom-forward.h" |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 25 | #include "ui/base/window_open_disposition.h" |
| 26 | |
| 27 | class GURL; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 28 | |
| 29 | namespace base { |
| 30 | class TimeTicks; |
| 31 | } |
| 32 | |
| 33 | namespace network { |
| 34 | class ResourceRequestBody; |
| 35 | } |
| 36 | |
| 37 | namespace content { |
| 38 | |
Carlos Caballero | 40b0efd | 2021-01-26 11:55:00 | [diff] [blame] | 39 | class BrowserContext; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 40 | class FrameNavigationEntry; |
Carlos Caballero | 40b0efd | 2021-01-26 11:55:00 | [diff] [blame] | 41 | class FrameTree; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 42 | class FrameTreeNode; |
Carlos Caballero | 40b0efd | 2021-01-26 11:55:00 | [diff] [blame] | 43 | class NavigationControllerDelegate; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 44 | class NavigationEntryImpl; |
| 45 | class NavigationRequest; |
Carlos Caballero | 40b0efd | 2021-01-26 11:55:00 | [diff] [blame] | 46 | class NavigatorDelegate; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 47 | class PrefetchedSignedExchangeCache; |
| 48 | class RenderFrameHostImpl; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 49 | struct LoadCommittedDetails; |
W. James MacLean | 46cf2621 | 2020-10-01 16:43:37 | [diff] [blame] | 50 | struct UrlInfo; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 51 | |
| 52 | // Navigator is responsible for performing navigations in nodes of the |
| 53 | // FrameTree. Its lifetime is bound to the FrameTree. |
| 54 | class CONTENT_EXPORT Navigator { |
| 55 | public: |
Carlos Caballero | 40b0efd | 2021-01-26 11:55:00 | [diff] [blame] | 56 | Navigator(BrowserContext* browser_context, |
| 57 | FrameTree& frame_tree, |
| 58 | NavigatorDelegate* delegate, |
| 59 | NavigationControllerDelegate* navigation_controller_delegate); |
Peter Boström | 828b902 | 2021-09-21 02:28:43 | [diff] [blame] | 60 | |
| 61 | Navigator(const Navigator&) = delete; |
| 62 | Navigator& operator=(const Navigator&) = delete; |
| 63 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 64 | ~Navigator(); |
| 65 | |
| 66 | // This method verifies that a navigation to |url| doesn't commit into a WebUI |
| 67 | // process if it is not allowed to. Callers of this method should take one of |
| 68 | // two actions if the method returns false: |
| 69 | // * When called from browser process logic (e.g. NavigationRequest), this |
| 70 | // indicates issues with the navigation logic and the browser process must |
| 71 | // be terminated to avoid security issues. |
| 72 | // * If the codepath is processing an IPC message from a renderer process, |
| 73 | // then the renderer process is misbehaving and must be terminated. |
| 74 | // TODO(nasko): Remove the is_renderer_initiated_check parameter when callers |
| 75 | // of this method are migrated to use CHECK instead of DumpWithoutCrashing. |
Daniel Cheng | 9c9fa1a | 2022-01-14 03:42:11 | [diff] [blame] | 76 | [[nodiscard]] static bool CheckWebUIRendererDoesNotDisplayNormalURL( |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 77 | RenderFrameHostImpl* render_frame_host, |
W. James MacLean | 46cf2621 | 2020-10-01 16:43:37 | [diff] [blame] | 78 | const UrlInfo& url_info, |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 79 | bool is_renderer_initiated_check); |
| 80 | |
| 81 | static bool ShouldIgnoreIncomingRendererRequest( |
| 82 | const NavigationRequest* ongoing_navigation_request, |
| 83 | bool has_user_gesture); |
| 84 | |
| 85 | // Returns the delegate of this Navigator. |
| 86 | NavigatorDelegate* GetDelegate(); |
| 87 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 88 | // Notifications coming from the RenderFrameHosts ---------------------------- |
| 89 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 90 | // The RenderFrameHostImpl has committed a navigation. The Navigator is |
| 91 | // responsible for resetting |navigation_request| at the end of this method |
| 92 | // and should not attempt to keep it alive. Note: it is possible that |
| 93 | // |navigation_request| is not the NavigationRequest stored in the |
| 94 | // RenderFrameHost that just committed. This happens for example when a |
| 95 | // same-page navigation commits while another navigation is ongoing. The |
| 96 | // Navigator should use the NavigationRequest provided by this method and not |
| 97 | // attempt to access the RenderFrameHost's NavigationsRequests. |
| 98 | void DidNavigate(RenderFrameHostImpl* render_frame_host, |
arthursonzogni | 73fe321 | 2020-11-17 13:24:07 | [diff] [blame] | 99 | const mojom::DidCommitProvisionalLoadParams& params, |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 100 | std::unique_ptr<NavigationRequest> navigation_request, |
| 101 | bool was_within_same_document); |
| 102 | |
| 103 | // Called on a newly created subframe during a history navigation. The browser |
| 104 | // process looks up the corresponding FrameNavigationEntry for the new frame |
| 105 | // navigates it in the correct process. Returns false if the |
| 106 | // FrameNavigationEntry can't be found or the navigation fails. |
| 107 | bool StartHistoryNavigationInNewSubframe( |
| 108 | RenderFrameHostImpl* render_frame_host, |
Hiroshige Hayashizaki | 5466bfe8 | 2023-05-17 00:34:33 | [diff] [blame] | 109 | mojo::PendingAssociatedRemote<mojom::NavigationClient>* navigation_client, |
| 110 | blink::LocalFrameToken initiator_frame_token, |
Charlie Reis | f4d51f40 | 2025-05-23 18:00:49 | [diff] [blame] | 111 | int initiator_process_id, |
| 112 | base::TimeTicks actual_navigation_start); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 113 | |
| 114 | // Navigation requests ------------------------------------------------------- |
| 115 | |
| 116 | // Called by the NavigationController to cause the Navigator to navigate to |
| 117 | // |navigation_request|. The NavigationController should be called back with |
| 118 | // RendererDidNavigate on success or DiscardPendingEntry on failure. The |
| 119 | // callbacks should be called in a future iteration of the message loop. |
| 120 | void Navigate(std::unique_ptr<NavigationRequest> request, |
Lukasz Anforowicz | 9ee83c27 | 2020-12-01 20:14:05 | [diff] [blame] | 121 | ReloadType reload_type); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 122 | |
| 123 | // The RenderFrameHostImpl has received a request to open a URL with the |
| 124 | // specified |disposition|. |
| 125 | void RequestOpenURL( |
| 126 | RenderFrameHostImpl* render_frame_host, |
| 127 | const GURL& url, |
Chris Hamilton | 83272dc | 2021-02-23 00:24:02 | [diff] [blame] | 128 | const blink::LocalFrameToken* initiator_frame_token, |
Antonio Sartori | 9a82f6f3 | 2020-12-14 09:22:45 | [diff] [blame] | 129 | int initiator_process_id, |
Arthur Sonzogni | c686e8f | 2024-01-11 08:36:37 | [diff] [blame] | 130 | const std::optional<url::Origin>& initiator_origin, |
| 131 | const std::optional<GURL>& initiator_base_url, |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 132 | const scoped_refptr<network::ResourceRequestBody>& post_body, |
| 133 | const std::string& extra_headers, |
| 134 | const Referrer& referrer, |
| 135 | WindowOpenDisposition disposition, |
| 136 | bool should_replace_current_entry, |
| 137 | bool user_gesture, |
Gyuyoung Kim | 16a12f5 | 2020-12-19 04:24:26 | [diff] [blame] | 138 | blink::mojom::TriggeringEventInfo triggering_event_info, |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 139 | const std::string& href_translate, |
| 140 | scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory, |
Kevin McNee | 6455638 | 2024-06-27 22:05:03 | [diff] [blame] | 141 | const std::optional<blink::Impression>& impression, |
| 142 | bool has_rel_opener); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 143 | |
| 144 | // Called when a document requests a navigation in another document through a |
Dave Tapuska | 2402595f | 2022-08-03 16:24:21 | [diff] [blame] | 145 | // `blink::RemoteFrame`. If `method` is "POST", then `post_body` needs to |
| 146 | // specify the request body, otherwise `post_body` should be null. |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 147 | void NavigateFromFrameProxy( |
| 148 | RenderFrameHostImpl* render_frame_host, |
| 149 | const GURL& url, |
Chris Hamilton | 83272dc | 2021-02-23 00:24:02 | [diff] [blame] | 150 | const blink::LocalFrameToken* initiator_frame_token, |
Antonio Sartori | 9a82f6f3 | 2020-12-14 09:22:45 | [diff] [blame] | 151 | int initiator_process_id, |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 152 | const url::Origin& initiator_origin, |
Arthur Sonzogni | c686e8f | 2024-01-11 08:36:37 | [diff] [blame] | 153 | const std::optional<GURL>& initiator_base_url, |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 154 | SiteInstance* source_site_instance, |
| 155 | const Referrer& referrer, |
| 156 | ui::PageTransition page_transition, |
| 157 | bool should_replace_current_entry, |
Yeunjoo Choi | 3df791a | 2021-02-17 07:07:25 | [diff] [blame] | 158 | blink::NavigationDownloadPolicy download_policy, |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 159 | const std::string& method, |
| 160 | scoped_refptr<network::ResourceRequestBody> post_body, |
| 161 | const std::string& extra_headers, |
| 162 | scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory, |
Antonio Sartori | 2f763d9d | 2021-04-21 10:04:14 | [diff] [blame] | 163 | network::mojom::SourceLocationPtr source_location, |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 164 | bool has_user_gesture, |
jongdeok.kim | 5de823b3 | 2022-06-14 04:37:50 | [diff] [blame] | 165 | bool is_form_submission, |
Arthur Sonzogni | c686e8f | 2024-01-11 08:36:37 | [diff] [blame] | 166 | const std::optional<blink::Impression>& impression, |
Yao Xiao | 720ef9d6 | 2022-12-09 05:18:29 | [diff] [blame] | 167 | blink::mojom::NavigationInitiatorActivationAndAdStatus |
| 168 | initiator_activation_and_ad_status, |
Charlie Reis | e1d9b818 | 2025-04-02 04:32:12 | [diff] [blame] | 169 | base::TimeTicks actual_navigation_start_time, |
Nan Lin | 944e9b4e | 2022-04-12 13:51:22 | [diff] [blame] | 170 | base::TimeTicks navigation_start_time, |
Garrett Tanzer | 405f340 | 2022-07-21 20:12:49 | [diff] [blame] | 171 | bool is_embedder_initiated_fenced_frame_navigation = false, |
Garrett Tanzer | bb8db41 | 2022-09-27 21:59:46 | [diff] [blame] | 172 | bool is_unfenced_top_navigation = false, |
Sergey Poromov | dd557c1 | 2023-03-01 11:28:45 | [diff] [blame] | 173 | bool force_new_browsing_instance = false, |
Camillia Smith Barnes | 6a64396 | 2023-03-03 00:28:58 | [diff] [blame] | 174 | bool is_container_initiated = false, |
Kevin McNee | 6455638 | 2024-06-27 22:05:03 | [diff] [blame] | 175 | bool has_rel_opener = false, |
W. James MacLean | 443ef3e | 2024-07-16 13:42:34 | [diff] [blame] | 176 | net::StorageAccessApiStatus storage_access_api_status = |
| 177 | net::StorageAccessApiStatus::kNone, |
Arthur Sonzogni | c686e8f | 2024-01-11 08:36:37 | [diff] [blame] | 178 | std::optional<std::u16string> embedder_shared_storage_context = |
| 179 | std::nullopt); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 180 | |
| 181 | // Called after BeforeUnloadCompleted callback is invoked from the renderer. |
Charlie Reis | 9e20dd1 | 2025-01-02 20:11:53 | [diff] [blame] | 182 | // If `frame_tree_node` has a NavigationRequest waiting for the renderer |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 183 | // response, then the request is either started or canceled, depending on the |
Charlie Reis | 9e20dd1 | 2025-01-02 20:11:53 | [diff] [blame] | 184 | // value of `proceed`. If `for_legacy` is true, then this beforeunload flow |
| 185 | // was only used to post a task and no beforeunload handlers were run. If |
| 186 | // `showed_dialog` is true, then a beforeunload dialog was displayed. |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 187 | void BeforeUnloadCompleted(FrameTreeNode* frame_tree_node, |
| 188 | bool proceed, |
Charlie Reis | 9e20dd1 | 2025-01-02 20:11:53 | [diff] [blame] | 189 | const base::TimeTicks& proceed_time, |
| 190 | bool for_legacy, |
| 191 | bool showed_dialog); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 192 | |
| 193 | // Used to start a new renderer-initiated navigation, following a |
| 194 | // BeginNavigation IPC from the renderer. |
| 195 | void OnBeginNavigation( |
| 196 | FrameTreeNode* frame_tree_node, |
Minggang Wang | b9f3fa9 | 2021-07-01 15:30:31 | [diff] [blame] | 197 | blink::mojom::CommonNavigationParamsPtr common_params, |
| 198 | blink::mojom::BeginNavigationParamsPtr begin_params, |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 199 | scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory, |
| 200 | mojo::PendingAssociatedRemote<mojom::NavigationClient> navigation_client, |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 201 | scoped_refptr<PrefetchedSignedExchangeCache> |
| 202 | prefetched_signed_exchange_cache, |
Hiroshige Hayashizaki | 5466bfe8 | 2023-05-17 00:34:33 | [diff] [blame] | 203 | int initiator_process_id, |
Rakina Zata Amni | af55b5b6 | 2022-07-19 23:11:03 | [diff] [blame] | 204 | mojo::PendingReceiver<mojom::NavigationRendererCancellationListener> |
| 205 | renderer_cancellation_listener); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 206 | |
| 207 | // Used to restart a navigation that was thought to be same-document in |
| 208 | // cross-document mode. |
| 209 | void RestartNavigationAsCrossDocument( |
| 210 | std::unique_ptr<NavigationRequest> navigation_request); |
| 211 | |
Rakina Zata Amni | f8f2bb6 | 2022-11-23 05:54:32 | [diff] [blame] | 212 | // Cancels the NavigationRequest owned by |frame_tree_node|. Note that this |
| 213 | // will only cancel NavigationRequests that haven't reached the "pending |
| 214 | // commit" stage yet, as after that the NavigationRequests will no longer be |
| 215 | // owned by the FrameTreeNode. |
Daniel Cheng | 390e2a7 | 2022-09-28 06:07:53 | [diff] [blame] | 216 | void CancelNavigation(FrameTreeNode* frame_tree_node, |
| 217 | NavigationDiscardReason reason); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 218 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 219 | // Called to record the time it took to execute the beforeunload hook for the |
Scott Violet | b1dd5459 | 2021-11-17 03:28:51 | [diff] [blame] | 220 | // current navigation. See RenderFrameHostImpl::SendBeforeUnload() for details |
| 221 | // on `for_legacy`. |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 222 | void LogBeforeUnloadTime(base::TimeTicks renderer_before_unload_start_time, |
| 223 | base::TimeTicks renderer_before_unload_end_time, |
Scott Violet | b1dd5459 | 2021-11-17 03:28:51 | [diff] [blame] | 224 | base::TimeTicks before_unload_sent_time, |
| 225 | bool for_legacy); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 226 | |
Katie Dillon | e893d00f | 2021-01-22 23:06:43 | [diff] [blame] | 227 | // Called to record the time that the RenderFrameHost told the renderer to |
| 228 | // commit the current navigation. |
| 229 | void LogCommitNavigationSent(); |
| 230 | |
Carlos Caballero | 04aab36 | 2021-02-15 17:38:16 | [diff] [blame] | 231 | // Returns the NavigationController associated with this Navigator. |
Carlos Caballero | 40b0efd | 2021-01-26 11:55:00 | [diff] [blame] | 232 | NavigationControllerImpl& controller() { return controller_; } |
Elad Alon | 32044f53 | 2025-03-04 22:16:03 | [diff] [blame] | 233 | const NavigationControllerImpl& controller() const { return controller_; } |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 234 | |
Liam Brady | edb866e | 2025-01-22 22:28:13 | [diff] [blame] | 235 | void SetWillNavigateFromFrameProxyCallbackForTesting( |
| 236 | const base::RepeatingClosure& callback); |
| 237 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 238 | private: |
| 239 | friend class NavigatorTestWithBrowserSideNavigation; |
| 240 | |
| 241 | // Holds data used to track browser side navigation metrics. |
| 242 | struct NavigationMetricsData; |
| 243 | |
| 244 | void RecordNavigationMetrics( |
| 245 | const LoadCommittedDetails& details, |
arthursonzogni | 73fe321 | 2020-11-17 13:24:07 | [diff] [blame] | 246 | const mojom::DidCommitProvisionalLoadParams& params, |
Rakina Zata Amni | 6345d2f | 2021-02-12 04:07:57 | [diff] [blame] | 247 | SiteInstance* site_instance, |
| 248 | const GURL& original_request_url); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 249 | |
| 250 | // Called when a renderer initiated navigation has started. Returns the |
| 251 | // pending NavigationEntry to be used. Either null or a new one owned |
| 252 | // NavigationController. |
| 253 | NavigationEntryImpl* GetNavigationEntryForRendererInitiatedNavigation( |
Minggang Wang | b9f3fa9 | 2021-07-01 15:30:31 | [diff] [blame] | 254 | const blink::mojom::CommonNavigationParams& common_params, |
Charlie Reis | f39757b | 2023-01-09 17:41:56 | [diff] [blame] | 255 | FrameTreeNode* frame_tree_node, |
| 256 | bool override_user_agent); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 257 | |
| 258 | // Called to record the time it took to execute beforeunload handlers for |
| 259 | // renderer-inititated navigations. It records the time it took to execute |
| 260 | // beforeunload handlers in the renderer process before sending the |
| 261 | // BeginNavigation IPC. |
| 262 | void LogRendererInitiatedBeforeUnloadTime( |
| 263 | base::TimeTicks renderer_before_unload_start_time, |
| 264 | base::TimeTicks renderer_before_unload_end_time); |
| 265 | |
| 266 | // The NavigationController that will keep track of session history for all |
| 267 | // RenderFrameHost objects using this Navigator. |
Carlos Caballero | 40b0efd | 2021-01-26 11:55:00 | [diff] [blame] | 268 | NavigationControllerImpl controller_; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 269 | |
| 270 | // Used to notify the object embedding this Navigator about navigation |
| 271 | // events. Can be nullptr in tests. |
Keishi Hattori | 0e45c02 | 2021-11-27 09:25:52 | [diff] [blame] | 272 | raw_ptr<NavigatorDelegate> delegate_; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 273 | |
Charlie Reis | 76bf805d | 2023-01-04 20:06:40 | [diff] [blame] | 274 | // Tracks metrics for each navigation. |
| 275 | std::unique_ptr<Navigator::NavigationMetricsData> metrics_data_; |
Liam Brady | edb866e | 2025-01-22 22:28:13 | [diff] [blame] | 276 | |
| 277 | // Called every time NavigateFromFrameProxy() is called. |
| 278 | base::RepeatingClosure will_navigate_from_frame_proxy_callback_for_testing_; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 279 | }; |
| 280 | |
| 281 | } // namespace content |
| 282 | |
| 283 | #endif // CONTENT_BROWSER_RENDERER_HOST_NAVIGATOR_H_ |