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 class ResourceRequestBodyImpl; |
28 struct LoadCommittedDetails; | 28 struct LoadCommittedDetails; |
29 | 29 |
30 // This class is an implementation of Navigator, responsible for managing | 30 // This class is an implementation of Navigator, responsible for managing |
31 // navigations in regular browser tabs. | 31 // navigations in regular browser tabs. |
32 class CONTENT_EXPORT NavigatorImpl : public Navigator { | 32 class CONTENT_EXPORT NavigatorImpl : public Navigator { |
33 public: | 33 public: |
34 NavigatorImpl(NavigationControllerImpl* navigation_controller, | 34 NavigatorImpl(NavigationControllerImpl* navigation_controller, |
35 NavigatorDelegate* delegate); | 35 NavigatorDelegate* delegate); |
36 | 36 |
37 static void CheckWebUIRendererDoesNotDisplayNormalURL( | 37 static void CheckWebUIRendererDoesNotDisplayNormalURL( |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 void RequestTransferURL( | 73 void RequestTransferURL( |
74 RenderFrameHostImpl* render_frame_host, | 74 RenderFrameHostImpl* render_frame_host, |
75 const GURL& url, | 75 const GURL& url, |
76 SiteInstance* source_site_instance, | 76 SiteInstance* source_site_instance, |
77 const std::vector<GURL>& redirect_chain, | 77 const std::vector<GURL>& redirect_chain, |
78 const Referrer& referrer, | 78 const Referrer& referrer, |
79 ui::PageTransition page_transition, | 79 ui::PageTransition page_transition, |
80 const GlobalRequestID& transferred_global_request_id, | 80 const GlobalRequestID& transferred_global_request_id, |
81 bool should_replace_current_entry, | 81 bool should_replace_current_entry, |
82 const std::string& method, | 82 const std::string& method, |
83 scoped_refptr<ResourceRequestBody> post_body) override; | 83 scoped_refptr<ResourceRequestBodyImpl> post_body) override; |
84 void OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, bool proceed) override; | 84 void OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, bool proceed) override; |
85 void OnBeginNavigation(FrameTreeNode* frame_tree_node, | 85 void OnBeginNavigation(FrameTreeNode* frame_tree_node, |
86 const CommonNavigationParams& common_params, | 86 const CommonNavigationParams& common_params, |
87 const BeginNavigationParams& begin_params) override; | 87 const BeginNavigationParams& begin_params) override; |
88 void FailedNavigation(FrameTreeNode* frame_tree_node, | 88 void FailedNavigation(FrameTreeNode* frame_tree_node, |
89 bool has_stale_copy_in_cache, | 89 bool has_stale_copy_in_cache, |
90 int error_code) override; | 90 int error_code) override; |
91 void LogResourceRequestTime(base::TimeTicks timestamp, | 91 void LogResourceRequestTime(base::TimeTicks timestamp, |
92 const GURL& url) override; | 92 const GURL& url) override; |
93 void LogBeforeUnloadTime( | 93 void LogBeforeUnloadTime( |
(...skipping 10 matching lines...) Expand all Loading... |
104 | 104 |
105 // 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 |
106 // |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 |
107 // NavigateToPendingEntry or NavigateToNewChildFrame. | 107 // NavigateToPendingEntry or NavigateToNewChildFrame. |
108 bool NavigateToEntry(FrameTreeNode* frame_tree_node, | 108 bool NavigateToEntry(FrameTreeNode* frame_tree_node, |
109 const FrameNavigationEntry& frame_entry, | 109 const FrameNavigationEntry& frame_entry, |
110 const NavigationEntryImpl& entry, | 110 const NavigationEntryImpl& entry, |
111 NavigationController::ReloadType reload_type, | 111 NavigationController::ReloadType reload_type, |
112 bool is_same_document_history_load, | 112 bool is_same_document_history_load, |
113 bool is_pending_entry, | 113 bool is_pending_entry, |
114 const scoped_refptr<ResourceRequestBody>& post_body); | 114 const scoped_refptr<ResourceRequestBodyImpl>& post_body); |
115 | 115 |
116 bool ShouldAssignSiteForURL(const GURL& url); | 116 bool ShouldAssignSiteForURL(const GURL& url); |
117 | 117 |
118 // 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 |
119 // to execute the beforeUnload event. Otherwise, the navigation request will | 119 // to execute the beforeUnload event. Otherwise, the navigation request will |
120 // be started. | 120 // be started. |
121 void RequestNavigation(FrameTreeNode* frame_tree_node, | 121 void RequestNavigation(FrameTreeNode* frame_tree_node, |
122 const GURL& dest_url, | 122 const GURL& dest_url, |
123 const Referrer& dest_referrer, | 123 const Referrer& dest_referrer, |
124 const FrameNavigationEntry& frame_entry, | 124 const FrameNavigationEntry& frame_entry, |
(...skipping 30 matching lines...) Expand all Loading... |
155 NavigatorDelegate* delegate_; | 155 NavigatorDelegate* delegate_; |
156 | 156 |
157 std::unique_ptr<NavigatorImpl::NavigationMetricsData> navigation_data_; | 157 std::unique_ptr<NavigatorImpl::NavigationMetricsData> navigation_data_; |
158 | 158 |
159 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); | 159 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); |
160 }; | 160 }; |
161 | 161 |
162 } // namespace content | 162 } // namespace content |
163 | 163 |
164 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 164 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
OLD | NEW |