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 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
7 | 7 |
8 #include "content/public/browser/navigation_handle.h" | 8 #include "content/public/browser/navigation_handle.h" |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
11 | 11 |
12 #include <memory> | 12 #include <memory> |
13 #include <string> | 13 #include <string> |
14 #include <utility> | 14 #include <utility> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/callback.h" | 17 #include "base/callback.h" |
18 #include "base/macros.h" | 18 #include "base/macros.h" |
19 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
20 #include "base/memory/scoped_vector.h" | 20 #include "base/memory/scoped_vector.h" |
21 #include "content/browser/frame_host/frame_tree_node.h" | 21 #include "content/browser/frame_host/frame_tree_node.h" |
22 #include "content/browser/frame_host/render_frame_host_impl.h" | 22 #include "content/browser/frame_host/render_frame_host_impl.h" |
23 #include "content/common/content_export.h" | 23 #include "content/common/content_export.h" |
24 #include "content/public/browser/global_request_id.h" | 24 #include "content/public/browser/global_request_id.h" |
25 #include "content/public/browser/navigation_data.h" | 25 #include "content/public/browser/navigation_data.h" |
26 #include "content/public/browser/navigation_throttle.h" | 26 #include "content/public/browser/navigation_throttle.h" |
27 #include "content/public/browser/ssl_status.h" | 27 #include "content/public/browser/ssl_status.h" |
28 #include "content/public/common/request_context_type.h" | 28 #include "content/public/common/request_context_type.h" |
| 29 #include "third_party/WebKit/public/platform/WebMixedContent.h" |
29 #include "url/gurl.h" | 30 #include "url/gurl.h" |
30 | 31 |
31 struct FrameHostMsg_DidCommitProvisionalLoad_Params; | 32 struct FrameHostMsg_DidCommitProvisionalLoad_Params; |
32 | 33 |
33 namespace content { | 34 namespace content { |
34 | 35 |
35 class AppCacheNavigationHandle; | 36 class AppCacheNavigationHandle; |
36 class ChromeAppCacheService; | 37 class ChromeAppCacheService; |
37 class NavigationUIData; | 38 class NavigationUIData; |
38 class NavigatorDelegate; | 39 class NavigatorDelegate; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // NavigatorDelegate. In particular, the ContentBrowserClient should not be | 149 // NavigatorDelegate. In particular, the ContentBrowserClient should not be |
149 // called directly form the NavigationHandle code. Thus, these calls will not | 150 // called directly form the NavigationHandle code. Thus, these calls will not |
150 // expose the NavigationHandle when navigating to an InterstialPage. | 151 // expose the NavigationHandle when navigating to an InterstialPage. |
151 NavigatorDelegate* GetDelegate() const; | 152 NavigatorDelegate* GetDelegate() const; |
152 | 153 |
153 RequestContextType request_context_type() const { | 154 RequestContextType request_context_type() const { |
154 DCHECK_GE(state_, WILL_SEND_REQUEST); | 155 DCHECK_GE(state_, WILL_SEND_REQUEST); |
155 return request_context_type_; | 156 return request_context_type_; |
156 } | 157 } |
157 | 158 |
| 159 blink::WebMixedContent::ContextType mixed_content_context_type() const { |
| 160 DCHECK_GE(state_, WILL_SEND_REQUEST); |
| 161 return mixed_content_context_type_; |
| 162 } |
| 163 |
158 // Get the unique id from the NavigationEntry associated with this | 164 // Get the unique id from the NavigationEntry associated with this |
159 // NavigationHandle. Note that a synchronous, renderer-initiated navigation | 165 // NavigationHandle. Note that a synchronous, renderer-initiated navigation |
160 // will not have a NavigationEntry associated with it, and this will return 0. | 166 // will not have a NavigationEntry associated with it, and this will return 0. |
161 int pending_nav_entry_id() const { return pending_nav_entry_id_; } | 167 int pending_nav_entry_id() const { return pending_nav_entry_id_; } |
162 | 168 |
163 // Changes the pending NavigationEntry ID for this handle. This is currently | 169 // Changes the pending NavigationEntry ID for this handle. This is currently |
164 // required during transfer navigations. | 170 // required during transfer navigations. |
165 // TODO(creis): Remove this when transfer navigations do not require pending | 171 // TODO(creis): Remove this when transfer navigations do not require pending |
166 // entries. See https://crbug.com/495161. | 172 // entries. See https://crbug.com/495161. |
167 void update_entry_id_for_transfer(int nav_entry_id) { | 173 void update_entry_id_for_transfer(int nav_entry_id) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // will be called when all throttle checks have completed. This will allow | 220 // will be called when all throttle checks have completed. This will allow |
215 // the caller to cancel the navigation or let it proceed. | 221 // the caller to cancel the navigation or let it proceed. |
216 void WillStartRequest( | 222 void WillStartRequest( |
217 const std::string& method, | 223 const std::string& method, |
218 scoped_refptr<content::ResourceRequestBodyImpl> resource_request_body, | 224 scoped_refptr<content::ResourceRequestBodyImpl> resource_request_body, |
219 const Referrer& sanitized_referrer, | 225 const Referrer& sanitized_referrer, |
220 bool has_user_gesture, | 226 bool has_user_gesture, |
221 ui::PageTransition transition, | 227 ui::PageTransition transition, |
222 bool is_external_protocol, | 228 bool is_external_protocol, |
223 RequestContextType request_context_type, | 229 RequestContextType request_context_type, |
| 230 blink::WebMixedContent::ContextType mixed_content_context_type, |
224 const ThrottleChecksFinishedCallback& callback); | 231 const ThrottleChecksFinishedCallback& callback); |
225 | 232 |
226 // Called when the URLRequest will be redirected in the network stack. | 233 // Called when the URLRequest will be redirected in the network stack. |
227 // |callback| will be called when all throttles check have completed. This | 234 // |callback| will be called when all throttles check have completed. This |
228 // will allow the caller to cancel the navigation or let it proceed. | 235 // will allow the caller to cancel the navigation or let it proceed. |
229 // This will also inform the delegate that the request was redirected. | 236 // This will also inform the delegate that the request was redirected. |
230 void WillRedirectRequest( | 237 void WillRedirectRequest( |
231 const GURL& new_url, | 238 const GURL& new_url, |
232 const std::string& new_method, | 239 const std::string& new_method, |
233 const GURL& new_referrer_url, | 240 const GURL& new_referrer_url, |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 | 398 |
392 // The time this navigation started. | 399 // The time this navigation started. |
393 const base::TimeTicks navigation_start_; | 400 const base::TimeTicks navigation_start_; |
394 | 401 |
395 // The unique id of the corresponding NavigationEntry. | 402 // The unique id of the corresponding NavigationEntry. |
396 int pending_nav_entry_id_; | 403 int pending_nav_entry_id_; |
397 | 404 |
398 // The fetch request context type. | 405 // The fetch request context type. |
399 RequestContextType request_context_type_; | 406 RequestContextType request_context_type_; |
400 | 407 |
| 408 // The mixed content context type for potential mixed content checks. |
| 409 blink::WebMixedContent::ContextType mixed_content_context_type_; |
| 410 |
401 // This callback will be run when all throttle checks have been performed. | 411 // This callback will be run when all throttle checks have been performed. |
402 ThrottleChecksFinishedCallback complete_callback_; | 412 ThrottleChecksFinishedCallback complete_callback_; |
403 | 413 |
404 // PlzNavigate | 414 // PlzNavigate |
405 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a | 415 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a |
406 // corresponding ServiceWorkerNetworkProvider is created in the renderer. | 416 // corresponding ServiceWorkerNetworkProvider is created in the renderer. |
407 std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; | 417 std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; |
408 | 418 |
409 // PlzNavigate | 419 // PlzNavigate |
410 // Manages the lifetime of a pre-created AppCacheHost until a browser side | 420 // Manages the lifetime of a pre-created AppCacheHost until a browser side |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 std::string searchable_form_encoding_; | 454 std::string searchable_form_encoding_; |
445 | 455 |
446 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; | 456 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; |
447 | 457 |
448 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | 458 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
449 }; | 459 }; |
450 | 460 |
451 } // namespace content | 461 } // namespace content |
452 | 462 |
453 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 463 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
OLD | NEW |