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 "components/navigation_interception/intercept_navigation_throttle.h" | 5 #include "components/navigation_interception/intercept_navigation_throttle.h" |
6 | 6 |
7 #include "components/navigation_interception/navigation_params.h" | 7 #include "components/navigation_interception/navigation_params.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 #include "content/public/browser/navigation_handle.h" | 9 #include "content/public/browser/navigation_handle.h" |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 55 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
56 return CheckIfShouldIgnoreNavigation(false); | 56 return CheckIfShouldIgnoreNavigation(false); |
57 } | 57 } |
58 | 58 |
59 content::NavigationThrottle::ThrottleCheckResult | 59 content::NavigationThrottle::ThrottleCheckResult |
60 InterceptNavigationThrottle::WillRedirectRequest() { | 60 InterceptNavigationThrottle::WillRedirectRequest() { |
61 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 61 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
62 return CheckIfShouldIgnoreNavigation(true); | 62 return CheckIfShouldIgnoreNavigation(true); |
63 } | 63 } |
64 | 64 |
| 65 const char* InterceptNavigationThrottle::GetNameForLogging() { |
| 66 return "InterceptNavigationThrottle"; |
| 67 } |
| 68 |
65 content::NavigationThrottle::ThrottleCheckResult | 69 content::NavigationThrottle::ThrottleCheckResult |
66 InterceptNavigationThrottle::CheckIfShouldIgnoreNavigation(bool is_redirect) { | 70 InterceptNavigationThrottle::CheckIfShouldIgnoreNavigation(bool is_redirect) { |
67 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 71 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
68 NavigationParams navigation_params( | 72 NavigationParams navigation_params( |
69 navigation_handle()->GetURL(), navigation_handle()->GetReferrer(), | 73 navigation_handle()->GetURL(), navigation_handle()->GetReferrer(), |
70 navigation_handle()->HasUserGesture(), navigation_handle()->IsPost(), | 74 navigation_handle()->HasUserGesture(), navigation_handle()->IsPost(), |
71 navigation_handle()->GetPageTransition(), is_redirect, | 75 navigation_handle()->GetPageTransition(), is_redirect, |
72 navigation_handle()->IsExternalProtocol(), true, | 76 navigation_handle()->IsExternalProtocol(), true, |
73 navigation_handle()->GetBaseURLForDataURL()); | 77 navigation_handle()->GetBaseURLForDataURL()); |
74 | 78 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 CHECK(handle); | 127 CHECK(handle); |
124 if (should_ignore_navigation) { | 128 if (should_ignore_navigation) { |
125 navigation_handle()->CancelDeferredNavigation( | 129 navigation_handle()->CancelDeferredNavigation( |
126 content::NavigationThrottle::CANCEL_AND_IGNORE); | 130 content::NavigationThrottle::CANCEL_AND_IGNORE); |
127 } else { | 131 } else { |
128 handle->Resume(); | 132 handle->Resume(); |
129 } | 133 } |
130 } | 134 } |
131 | 135 |
132 } // namespace navigation_interception | 136 } // namespace navigation_interception |
OLD | NEW |