Chromium Code Reviews| 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 "content/browser/browsing_data/clear_site_data_throttle.h" | |
| 9 #include "content/browser/frame_host/frame_tree_node.h" | 10 #include "content/browser/frame_host/frame_tree_node.h" |
| 10 #include "content/browser/frame_host/navigator.h" | 11 #include "content/browser/frame_host/navigator.h" |
| 11 #include "content/browser/frame_host/navigator_delegate.h" | 12 #include "content/browser/frame_host/navigator_delegate.h" |
| 12 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 13 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 13 #include "content/browser/service_worker/service_worker_navigation_handle.h" | 14 #include "content/browser/service_worker/service_worker_navigation_handle.h" |
| 14 #include "content/common/frame_messages.h" | 15 #include "content/common/frame_messages.h" |
| 15 #include "content/public/browser/content_browser_client.h" | 16 #include "content/public/browser/content_browser_client.h" |
| 16 #include "content/public/common/browser_side_navigation_policy.h" | 17 #include "content/public/common/browser_side_navigation_policy.h" |
| 17 #include "content/public/common/content_client.h" | 18 #include "content/public/common/content_client.h" |
| 18 #include "net/url_request/redirect_info.h" | 19 #include "net/url_request/redirect_info.h" |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 297 // Update the navigation parameters. | 298 // Update the navigation parameters. |
| 298 method_ = method; | 299 method_ = method; |
| 299 sanitized_referrer_ = sanitized_referrer; | 300 sanitized_referrer_ = sanitized_referrer; |
| 300 has_user_gesture_ = has_user_gesture; | 301 has_user_gesture_ = has_user_gesture; |
| 301 transition_ = transition; | 302 transition_ = transition; |
| 302 is_external_protocol_ = is_external_protocol; | 303 is_external_protocol_ = is_external_protocol; |
| 303 | 304 |
| 304 state_ = WILL_SEND_REQUEST; | 305 state_ = WILL_SEND_REQUEST; |
| 305 complete_callback_ = callback; | 306 complete_callback_ = callback; |
| 306 | 307 |
| 307 // Register the navigation throttles. The ScopedVector returned by | 308 // Register the platform's navigation throttles. |
| 309 std::unique_ptr<content::NavigationThrottle> clear_site_data_throttle = | |
| 310 content::ClearSiteDataThrottle::CreateThrottleFor(this); | |
| 311 throttles_.push_back(std::move(clear_site_data_throttle)); | |
|
Mike West
2016/06/02 07:00:08
Can you tie the creation of this throttle to the `
msramek
2016/06/14 20:12:08
Done.
| |
| 312 | |
| 313 // Register the embedder's navigation throttles. The ScopedVector returned by | |
| 308 // GetNavigationThrottles is not assigned to throttles_ directly because it | 314 // GetNavigationThrottles is not assigned to throttles_ directly because it |
| 309 // would overwrite any throttle previously added with | 315 // would overwrite any throttle previously added with |
| 310 // RegisterThrottleForTesting. | 316 // RegisterThrottleForTesting. |
| 311 ScopedVector<NavigationThrottle> throttles_to_register = | 317 ScopedVector<NavigationThrottle> throttles_to_register = |
| 312 GetContentClient()->browser()->CreateThrottlesForNavigation(this); | 318 GetContentClient()->browser()->CreateThrottlesForNavigation(this); |
| 313 if (throttles_to_register.size() > 0) { | 319 if (throttles_to_register.size() > 0) { |
| 314 throttles_.insert(throttles_.end(), throttles_to_register.begin(), | 320 throttles_.insert(throttles_.end(), throttles_to_register.begin(), |
| 315 throttles_to_register.end()); | 321 throttles_to_register.end()); |
| 316 throttles_to_register.weak_clear(); | 322 throttles_to_register.weak_clear(); |
| 317 } | 323 } |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 505 complete_callback_.Reset(); | 511 complete_callback_.Reset(); |
| 506 | 512 |
| 507 if (!callback.is_null()) | 513 if (!callback.is_null()) |
| 508 callback.Run(result); | 514 callback.Run(result); |
| 509 | 515 |
| 510 // No code after running the callback, as it might have resulted in our | 516 // No code after running the callback, as it might have resulted in our |
| 511 // destruction. | 517 // destruction. |
| 512 } | 518 } |
| 513 | 519 |
| 514 } // namespace content | 520 } // namespace content |
| OLD | NEW |