| 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 #include "content/browser/frame_host/navigation_handle_impl.h" | 5 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/browser/browsing_data/clear_site_data_throttle.h" | 10 #include "content/browser/browsing_data/clear_site_data_throttle.h" |
| 11 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 11 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| 12 #include "content/browser/frame_host/frame_tree_node.h" | 12 #include "content/browser/frame_host/frame_tree_node.h" |
| 13 #include "content/browser/frame_host/navigator.h" | 13 #include "content/browser/frame_host/navigator.h" |
| 14 #include "content/browser/frame_host/navigator_delegate.h" | 14 #include "content/browser/frame_host/navigator_delegate.h" |
| 15 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 15 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 16 #include "content/browser/service_worker/service_worker_navigation_handle.h" | 16 #include "content/browser/service_worker/service_worker_navigation_handle.h" |
| 17 #include "content/common/frame_messages.h" | 17 #include "content/common/frame_messages.h" |
| 18 #include "content/common/resource_request_body_impl.h" | 18 #include "content/common/resource_request_body_impl.h" |
| 19 #include "content/public/browser/content_browser_client.h" | 19 #include "content/public/browser/content_browser_client.h" |
| 20 #include "content/public/browser/navigation_ui_data.h" |
| 20 #include "content/public/common/browser_side_navigation_policy.h" | 21 #include "content/public/common/browser_side_navigation_policy.h" |
| 21 #include "content/public/common/content_client.h" | 22 #include "content/public/common/content_client.h" |
| 22 #include "content/public/common/url_constants.h" | 23 #include "content/public/common/url_constants.h" |
| 23 #include "net/url_request/redirect_info.h" | 24 #include "net/url_request/redirect_info.h" |
| 24 #include "url/gurl.h" | 25 #include "url/gurl.h" |
| 25 #include "url/url_constants.h" | 26 #include "url/url_constants.h" |
| 26 | 27 |
| 27 namespace content { | 28 namespace content { |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 sanitized_referrer_ = sanitized_referrer; | 377 sanitized_referrer_ = sanitized_referrer; |
| 377 has_user_gesture_ = has_user_gesture; | 378 has_user_gesture_ = has_user_gesture; |
| 378 transition_ = transition; | 379 transition_ = transition; |
| 379 is_external_protocol_ = is_external_protocol; | 380 is_external_protocol_ = is_external_protocol; |
| 380 request_context_type_ = request_context_type; | 381 request_context_type_ = request_context_type; |
| 381 state_ = WILL_SEND_REQUEST; | 382 state_ = WILL_SEND_REQUEST; |
| 382 complete_callback_ = callback; | 383 complete_callback_ = callback; |
| 383 | 384 |
| 384 RegisterNavigationThrottles(); | 385 RegisterNavigationThrottles(); |
| 385 | 386 |
| 387 navigation_ui_data_ = |
| 388 GetContentClient()->browser()->GetNavigationUIData(this); |
| 389 |
| 386 // Notify each throttle of the request. | 390 // Notify each throttle of the request. |
| 387 NavigationThrottle::ThrottleCheckResult result = CheckWillStartRequest(); | 391 NavigationThrottle::ThrottleCheckResult result = CheckWillStartRequest(); |
| 388 | 392 |
| 389 // If the navigation is not deferred, run the callback. | 393 // If the navigation is not deferred, run the callback. |
| 390 if (result != NavigationThrottle::DEFER) | 394 if (result != NavigationThrottle::DEFER) |
| 391 RunCompleteCallback(result); | 395 RunCompleteCallback(result); |
| 392 } | 396 } |
| 393 | 397 |
| 394 void NavigationHandleImpl::WillRedirectRequest( | 398 void NavigationHandleImpl::WillRedirectRequest( |
| 395 const GURL& new_url, | 399 const GURL& new_url, |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 throttles_to_register.push_back(std::move(clear_site_data_throttle)); | 612 throttles_to_register.push_back(std::move(clear_site_data_throttle)); |
| 609 | 613 |
| 610 if (throttles_to_register.size() > 0) { | 614 if (throttles_to_register.size() > 0) { |
| 611 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), | 615 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), |
| 612 throttles_to_register.end()); | 616 throttles_to_register.end()); |
| 613 throttles_to_register.weak_clear(); | 617 throttles_to_register.weak_clear(); |
| 614 } | 618 } |
| 615 } | 619 } |
| 616 | 620 |
| 617 } // namespace content | 621 } // namespace content |
| OLD | NEW |