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

Unified Diff: chrome/browser/component/navigation_interception/intercept_navigation_delegate.h

Issue 11293017: Move navigation interception component to content/components (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add findbugs suppression for compatibility code. Created 8 years, 1 month 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: chrome/browser/component/navigation_interception/intercept_navigation_delegate.h
diff --git a/chrome/browser/component/navigation_interception/intercept_navigation_delegate.h b/chrome/browser/component/navigation_interception/intercept_navigation_delegate.h
index cc1f0d3ebe89d8d8770e16561a78174ac71ceb4e..bf382b370e82b7d5c14376de44658db227f4ee19 100644
--- a/chrome/browser/component/navigation_interception/intercept_navigation_delegate.h
+++ b/chrome/browser/component/navigation_interception/intercept_navigation_delegate.h
@@ -5,61 +5,15 @@
#ifndef CHROME_BROWSER_COMPONENT_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_DELEGATE_H_
#define CHROME_BROWSER_COMPONENT_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_DELEGATE_H_
-#include "base/android/jni_helper.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/supports_user_data.h"
+#include "content/components/navigation_interception/intercept_navigation_delegate.h"
-class GURL;
-
-namespace content {
-class ResourceThrottle;
-class WebContents;
-}
-
-namespace net {
-class URLRequest;
-}
+// TODO(jknotten): Remove this header once external dependencies are using the
+// header at the above new location.
namespace navigation_interception {
-// Native side of the InterceptNavigationDelegate Java interface.
-// This is used to create a InterceptNavigationResourceThrottle that calls the
-// Java interface method to determine whether a navigation should be ignored or
-// not.
-// To us this class:
-// 1) the Java-side interface implementation must be associated (via the
-// Associate method) with a WebContents for which URLRequests are to be
-// intercepted,
-// 2) the ResourceThrottle obtained via CreateThrottleFor must be associated
-// with the URLRequests in the ResourceDispatcherHostDelegate
-// implementation.
-class InterceptNavigationDelegate : public base::SupportsUserData::Data {
- public:
- InterceptNavigationDelegate(JNIEnv* env, jobject jdelegate);
- virtual ~InterceptNavigationDelegate();
-
- // Associates the InterceptNavigationDelegate with a WebContents using the
- // SupportsUserData mechanism.
- // As implied by the use of scoped_ptr, the WebContents will assume ownership
- // of |delegate|.
- static void Associate(content::WebContents* web_contents,
- scoped_ptr<InterceptNavigationDelegate> delegate);
- // Gets the InterceptNavigationDelegate associated with the WebContents,
- // can be null.
- static InterceptNavigationDelegate* Get(content::WebContents* web_contents);
-
- // Creates a InterceptNavigationResourceThrottle that will direct all
- // callbacks to the InterceptNavigationDelegate.
- static content::ResourceThrottle* CreateThrottleFor(
- net::URLRequest* request);
-
- virtual bool ShouldIgnoreNavigation(const GURL& url,
- bool has_user_gesture);
- private:
- JavaObjectWeakGlobalRef weak_jdelegate_;
-};
-
-bool RegisterInterceptNavigationDelegate(JNIEnv* env);
+using content::InterceptNavigationDelegate;
+using content::RegisterInterceptNavigationDelegate;
} // namespace navigation_interception

Powered by Google App Engine
This is Rietveld 408576698