Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Unified Diff: components/navigation_interception/intercept_navigation_throttle.cc

Issue 1350913008: Revert of Add a NavigationThrottle to the public content/ interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation-api
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/navigation_interception/intercept_navigation_throttle.cc
diff --git a/components/navigation_interception/intercept_navigation_throttle.cc b/components/navigation_interception/intercept_navigation_throttle.cc
deleted file mode 100644
index cc256a1273e0a0889e1df2cbabd3f999c3350bbb..0000000000000000000000000000000000000000
--- a/components/navigation_interception/intercept_navigation_throttle.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/navigation_interception/intercept_navigation_throttle.h"
-
-#include "components/navigation_interception/navigation_params.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/navigation_handle.h"
-
-namespace navigation_interception {
-
-InterceptNavigationThrottle::InterceptNavigationThrottle(
- content::NavigationHandle* navigation_handle,
- CheckCallback should_ignore_callback)
- : content::NavigationThrottle(navigation_handle),
- should_ignore_callback_(should_ignore_callback) {}
-
-InterceptNavigationThrottle::~InterceptNavigationThrottle() {}
-
-content::NavigationThrottle::ThrottleCheckResult
-InterceptNavigationThrottle::WillStartRequest() {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- return CheckIfShouldIgnoreNavigation(false);
-}
-
-content::NavigationThrottle::ThrottleCheckResult
-InterceptNavigationThrottle::WillRedirectRequest() {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- return CheckIfShouldIgnoreNavigation(true);
-}
-
-content::NavigationThrottle::ThrottleCheckResult
-InterceptNavigationThrottle::CheckIfShouldIgnoreNavigation(bool is_redirect) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- NavigationParams navigation_params(
- navigation_handle()->GetURL(), navigation_handle()->GetReferrer(),
- navigation_handle()->HasUserGesture(), navigation_handle()->IsPost(),
- navigation_handle()->GetPageTransition(), is_redirect,
- navigation_handle()->IsExternalProtocol(), true);
-
- bool should_ignore_navigation = should_ignore_callback_.Run(
- navigation_handle()->GetWebContents(), navigation_params);
- return should_ignore_navigation
- ? content::NavigationThrottle::CANCEL_AND_IGNORE
- : content::NavigationThrottle::PROCEED;
-}
-
-} // namespace navigation_interception

Powered by Google App Engine
This is Rietveld 408576698