| 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" |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 // No code after running the callback, as it might have resulted in our | 589 // No code after running the callback, as it might have resulted in our |
| 590 // destruction. | 590 // destruction. |
| 591 } | 591 } |
| 592 | 592 |
| 593 void NavigationHandleImpl::RegisterNavigationThrottles() { | 593 void NavigationHandleImpl::RegisterNavigationThrottles() { |
| 594 // Register the navigation throttles. The ScopedVector returned by | 594 // Register the navigation throttles. The ScopedVector returned by |
| 595 // GetNavigationThrottles is not assigned to throttles_ directly because it | 595 // GetNavigationThrottles is not assigned to throttles_ directly because it |
| 596 // would overwrite any throttle previously added with | 596 // would overwrite any throttle previously added with |
| 597 // RegisterThrottleForTesting. | 597 // RegisterThrottleForTesting. |
| 598 ScopedVector<NavigationThrottle> throttles_to_register = | 598 ScopedVector<NavigationThrottle> throttles_to_register = |
| 599 GetContentClient()->browser()->CreateThrottlesForNavigation(this); | 599 GetDelegate()->CreateThrottlesForNavigation(this); |
| 600 std::unique_ptr<NavigationThrottle> devtools_throttle = | 600 std::unique_ptr<NavigationThrottle> devtools_throttle = |
| 601 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this); | 601 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this); |
| 602 if (devtools_throttle) | 602 if (devtools_throttle) |
| 603 throttles_to_register.push_back(std::move(devtools_throttle)); | 603 throttles_to_register.push_back(std::move(devtools_throttle)); |
| 604 | 604 |
| 605 std::unique_ptr<NavigationThrottle> clear_site_data_throttle = | 605 std::unique_ptr<NavigationThrottle> clear_site_data_throttle = |
| 606 ClearSiteDataThrottle::CreateThrottleForNavigation(this); | 606 ClearSiteDataThrottle::CreateThrottleForNavigation(this); |
| 607 if (clear_site_data_throttle) | 607 if (clear_site_data_throttle) |
| 608 throttles_to_register.push_back(std::move(clear_site_data_throttle)); | 608 throttles_to_register.push_back(std::move(clear_site_data_throttle)); |
| 609 | 609 |
| 610 if (throttles_to_register.size() > 0) { | 610 if (throttles_to_register.size() > 0) { |
| 611 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), | 611 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), |
| 612 throttles_to_register.end()); | 612 throttles_to_register.end()); |
| 613 throttles_to_register.weak_clear(); | 613 throttles_to_register.weak_clear(); |
| 614 } | 614 } |
| 615 } | 615 } |
| 616 | 616 |
| 617 } // namespace content | 617 } // namespace content |
| OLD | NEW |