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 19 matching lines...) Expand all Loading... |
30 return CheckIfShouldIgnoreNavigation(true); | 30 return CheckIfShouldIgnoreNavigation(true); |
31 } | 31 } |
32 | 32 |
33 content::NavigationThrottle::ThrottleCheckResult | 33 content::NavigationThrottle::ThrottleCheckResult |
34 InterceptNavigationThrottle::CheckIfShouldIgnoreNavigation(bool is_redirect) { | 34 InterceptNavigationThrottle::CheckIfShouldIgnoreNavigation(bool is_redirect) { |
35 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 35 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
36 NavigationParams navigation_params( | 36 NavigationParams navigation_params( |
37 navigation_handle()->GetURL(), navigation_handle()->GetReferrer(), | 37 navigation_handle()->GetURL(), navigation_handle()->GetReferrer(), |
38 navigation_handle()->HasUserGesture(), navigation_handle()->IsPost(), | 38 navigation_handle()->HasUserGesture(), navigation_handle()->IsPost(), |
39 navigation_handle()->GetPageTransition(), is_redirect, | 39 navigation_handle()->GetPageTransition(), is_redirect, |
40 navigation_handle()->IsExternalProtocol(), true); | 40 navigation_handle()->IsExternalProtocol(), |
| 41 navigation_handle()->IsInMainFrame()); |
41 | 42 |
42 bool should_ignore_navigation = should_ignore_callback_.Run( | 43 bool should_ignore_navigation = should_ignore_callback_.Run( |
43 navigation_handle()->GetWebContents(), navigation_params); | 44 navigation_handle()->GetWebContents(), navigation_params); |
44 return should_ignore_navigation | 45 return should_ignore_navigation |
45 ? content::NavigationThrottle::CANCEL_AND_IGNORE | 46 ? content::NavigationThrottle::CANCEL_AND_IGNORE |
46 : content::NavigationThrottle::PROCEED; | 47 : content::NavigationThrottle::PROCEED; |
47 } | 48 } |
48 | 49 |
49 } // namespace navigation_interception | 50 } // namespace navigation_interception |
OLD | NEW |