| 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/common/frame_messages.h" | 16 #include "content/common/frame_messages.h" |
| 17 #include "content/common/resource_request_body_impl.h" | 17 #include "content/common/resource_request_body_impl.h" |
| 18 #include "content/public/browser/content_browser_client.h" | 18 #include "content/public/browser/content_browser_client.h" |
| 19 #include "content/public/browser/navigation_ui_data.h" |
| 19 #include "content/public/common/browser_side_navigation_policy.h" | 20 #include "content/public/common/browser_side_navigation_policy.h" |
| 20 #include "content/public/common/content_client.h" | 21 #include "content/public/common/content_client.h" |
| 21 #include "net/url_request/redirect_info.h" | 22 #include "net/url_request/redirect_info.h" |
| 22 #include "url/gurl.h" | 23 #include "url/gurl.h" |
| 23 #include "url/url_constants.h" | 24 #include "url/url_constants.h" |
| 24 | 25 |
| 25 namespace content { | 26 namespace content { |
| 26 | 27 |
| 27 namespace { | 28 namespace { |
| 28 | 29 |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 sanitized_referrer_ = sanitized_referrer; | 368 sanitized_referrer_ = sanitized_referrer; |
| 368 has_user_gesture_ = has_user_gesture; | 369 has_user_gesture_ = has_user_gesture; |
| 369 transition_ = transition; | 370 transition_ = transition; |
| 370 is_external_protocol_ = is_external_protocol; | 371 is_external_protocol_ = is_external_protocol; |
| 371 request_context_type_ = request_context_type; | 372 request_context_type_ = request_context_type; |
| 372 state_ = WILL_SEND_REQUEST; | 373 state_ = WILL_SEND_REQUEST; |
| 373 complete_callback_ = callback; | 374 complete_callback_ = callback; |
| 374 | 375 |
| 375 RegisterNavigationThrottles(); | 376 RegisterNavigationThrottles(); |
| 376 | 377 |
| 378 navigation_ui_data_ = |
| 379 GetContentClient()->browser()->GetNavigationUIData(this); |
| 380 |
| 377 // Notify each throttle of the request. | 381 // Notify each throttle of the request. |
| 378 NavigationThrottle::ThrottleCheckResult result = CheckWillStartRequest(); | 382 NavigationThrottle::ThrottleCheckResult result = CheckWillStartRequest(); |
| 379 | 383 |
| 380 // If the navigation is not deferred, run the callback. | 384 // If the navigation is not deferred, run the callback. |
| 381 if (result != NavigationThrottle::DEFER) | 385 if (result != NavigationThrottle::DEFER) |
| 382 RunCompleteCallback(result); | 386 RunCompleteCallback(result); |
| 383 } | 387 } |
| 384 | 388 |
| 385 void NavigationHandleImpl::WillRedirectRequest( | 389 void NavigationHandleImpl::WillRedirectRequest( |
| 386 const GURL& new_url, | 390 const GURL& new_url, |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 throttles_to_register.push_back(std::move(clear_site_data_throttle)); | 596 throttles_to_register.push_back(std::move(clear_site_data_throttle)); |
| 593 | 597 |
| 594 if (throttles_to_register.size() > 0) { | 598 if (throttles_to_register.size() > 0) { |
| 595 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), | 599 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), |
| 596 throttles_to_register.end()); | 600 throttles_to_register.end()); |
| 597 throttles_to_register.weak_clear(); | 601 throttles_to_register.weak_clear(); |
| 598 } | 602 } |
| 599 } | 603 } |
| 600 | 604 |
| 601 } // namespace content | 605 } // namespace content |
| OLD | NEW |