| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/containers/scoped_ptr_hash_map.h" | 10 #include "base/containers/scoped_ptr_hash_map.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "content/browser/frame_host/navigation_controller_impl.h" | 14 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 15 #include "content/browser/frame_host/navigator.h" | 15 #include "content/browser/frame_host/navigator.h" |
| 16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 17 #include "content/common/navigation_params.h" | 17 #include "content/common/navigation_params.h" |
| 18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 19 | 19 |
| 20 class GURL; | 20 class GURL; |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 | 23 |
| 24 class NavigationControllerImpl; | 24 class NavigationControllerImpl; |
| 25 class NavigatorDelegate; | 25 class NavigatorDelegate; |
| 26 class NavigatorTest; | 26 class NavigatorTest; |
| 27 class ResourceRequestBody; |
| 27 struct LoadCommittedDetails; | 28 struct LoadCommittedDetails; |
| 28 | 29 |
| 29 // This class is an implementation of Navigator, responsible for managing | 30 // This class is an implementation of Navigator, responsible for managing |
| 30 // navigations in regular browser tabs. | 31 // navigations in regular browser tabs. |
| 31 class CONTENT_EXPORT NavigatorImpl : public Navigator { | 32 class CONTENT_EXPORT NavigatorImpl : public Navigator { |
| 32 public: | 33 public: |
| 33 NavigatorImpl(NavigationControllerImpl* navigation_controller, | 34 NavigatorImpl(NavigationControllerImpl* navigation_controller, |
| 34 NavigatorDelegate* delegate); | 35 NavigatorDelegate* delegate); |
| 35 | 36 |
| 36 static void CheckWebUIRendererDoesNotDisplayNormalURL( | 37 static void CheckWebUIRendererDoesNotDisplayNormalURL( |
| (...skipping 25 matching lines...) Expand all Loading... |
| 62 bool is_same_document_history_load) override; | 63 bool is_same_document_history_load) override; |
| 63 bool NavigateNewChildFrame(RenderFrameHostImpl* render_frame_host, | 64 bool NavigateNewChildFrame(RenderFrameHostImpl* render_frame_host, |
| 64 const std::string& unique_name) override; | 65 const std::string& unique_name) override; |
| 65 void RequestOpenURL(RenderFrameHostImpl* render_frame_host, | 66 void RequestOpenURL(RenderFrameHostImpl* render_frame_host, |
| 66 const GURL& url, | 67 const GURL& url, |
| 67 SiteInstance* source_site_instance, | 68 SiteInstance* source_site_instance, |
| 68 const Referrer& referrer, | 69 const Referrer& referrer, |
| 69 WindowOpenDisposition disposition, | 70 WindowOpenDisposition disposition, |
| 70 bool should_replace_current_entry, | 71 bool should_replace_current_entry, |
| 71 bool user_gesture) override; | 72 bool user_gesture) override; |
| 72 void RequestTransferURL(RenderFrameHostImpl* render_frame_host, | 73 void RequestTransferURL( |
| 73 const GURL& url, | 74 RenderFrameHostImpl* render_frame_host, |
| 74 SiteInstance* source_site_instance, | 75 const GURL& url, |
| 75 const std::vector<GURL>& redirect_chain, | 76 SiteInstance* source_site_instance, |
| 76 const Referrer& referrer, | 77 const std::vector<GURL>& redirect_chain, |
| 77 ui::PageTransition page_transition, | 78 const Referrer& referrer, |
| 78 const GlobalRequestID& transferred_global_request_id, | 79 ui::PageTransition page_transition, |
| 79 bool should_replace_current_entry) override; | 80 const GlobalRequestID& transferred_global_request_id, |
| 81 bool should_replace_current_entry, |
| 82 const scoped_refptr<ResourceRequestBody>& post_body) override; |
| 80 void OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, bool proceed) override; | 83 void OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, bool proceed) override; |
| 81 void OnBeginNavigation(FrameTreeNode* frame_tree_node, | 84 void OnBeginNavigation(FrameTreeNode* frame_tree_node, |
| 82 const CommonNavigationParams& common_params, | 85 const CommonNavigationParams& common_params, |
| 83 const BeginNavigationParams& begin_params, | 86 const BeginNavigationParams& begin_params, |
| 84 scoped_refptr<ResourceRequestBody> body) override; | 87 scoped_refptr<ResourceRequestBody> body) override; |
| 85 void FailedNavigation(FrameTreeNode* frame_tree_node, | 88 void FailedNavigation(FrameTreeNode* frame_tree_node, |
| 86 bool has_stale_copy_in_cache, | 89 bool has_stale_copy_in_cache, |
| 87 int error_code) override; | 90 int error_code) override; |
| 88 void LogResourceRequestTime(base::TimeTicks timestamp, | 91 void LogResourceRequestTime(base::TimeTicks timestamp, |
| 89 const GURL& url) override; | 92 const GURL& url) override; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 100 ~NavigatorImpl() override; | 103 ~NavigatorImpl() override; |
| 101 | 104 |
| 102 // Navigates to the given entry, which might be the pending entry (if | 105 // Navigates to the given entry, which might be the pending entry (if |
| 103 // |is_pending_entry| is true). Private because all callers should use either | 106 // |is_pending_entry| is true). Private because all callers should use either |
| 104 // NavigateToPendingEntry or NavigateToNewChildFrame. | 107 // NavigateToPendingEntry or NavigateToNewChildFrame. |
| 105 bool NavigateToEntry(FrameTreeNode* frame_tree_node, | 108 bool NavigateToEntry(FrameTreeNode* frame_tree_node, |
| 106 const FrameNavigationEntry& frame_entry, | 109 const FrameNavigationEntry& frame_entry, |
| 107 const NavigationEntryImpl& entry, | 110 const NavigationEntryImpl& entry, |
| 108 NavigationController::ReloadType reload_type, | 111 NavigationController::ReloadType reload_type, |
| 109 bool is_same_document_history_load, | 112 bool is_same_document_history_load, |
| 110 bool is_pending_entry); | 113 bool is_pending_entry, |
| 114 const scoped_refptr<ResourceRequestBody>& post_body); |
| 111 | 115 |
| 112 bool ShouldAssignSiteForURL(const GURL& url); | 116 bool ShouldAssignSiteForURL(const GURL& url); |
| 113 | 117 |
| 114 // PlzNavigate: if needed, sends a BeforeUnload IPC to the renderer to ask it | 118 // PlzNavigate: if needed, sends a BeforeUnload IPC to the renderer to ask it |
| 115 // to execute the beforeUnload event. Otherwise, the navigation request will | 119 // to execute the beforeUnload event. Otherwise, the navigation request will |
| 116 // be started. | 120 // be started. |
| 117 void RequestNavigation(FrameTreeNode* frame_tree_node, | 121 void RequestNavigation(FrameTreeNode* frame_tree_node, |
| 118 const GURL& dest_url, | 122 const GURL& dest_url, |
| 119 const Referrer& dest_referrer, | 123 const Referrer& dest_referrer, |
| 120 const FrameNavigationEntry& frame_entry, | 124 const FrameNavigationEntry& frame_entry, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 151 NavigatorDelegate* delegate_; | 155 NavigatorDelegate* delegate_; |
| 152 | 156 |
| 153 std::unique_ptr<NavigatorImpl::NavigationMetricsData> navigation_data_; | 157 std::unique_ptr<NavigatorImpl::NavigationMetricsData> navigation_data_; |
| 154 | 158 |
| 155 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); | 159 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); |
| 156 }; | 160 }; |
| 157 | 161 |
| 158 } // namespace content | 162 } // namespace content |
| 159 | 163 |
| 160 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 164 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
| OLD | NEW |