Index: content/browser/renderer_host/intercept_navigation_resource_throttle_impl.h |
diff --git a/content/browser/renderer_host/intercept_navigation_resource_throttle_impl.h b/content/browser/renderer_host/intercept_navigation_resource_throttle_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c5406d417affe31517eb64ef685a26fac430a7b5 |
--- /dev/null |
+++ b/content/browser/renderer_host/intercept_navigation_resource_throttle_impl.h |
@@ -0,0 +1,41 @@ |
+// Copyright (c) 2012 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. |
+ |
+#ifndef CONTENT_BROWSER_RENDERER_HOST_INTERCEPT_NAVIGATION_RESOURCE_THROTTLE_IMPL_H_ |
+#define CONTENT_BROWSER_RENDERER_HOST_INTERCEPT_NAVIGATION_RESOURCE_THROTTLE_IMPL_H_ |
+#pragma once |
+ |
+#include <string> |
+ |
+#include "base/memory/weak_ptr.h" |
+#include "content/public/browser/intercept_navigation_resource_throttle.h" |
+ |
+namespace net { |
+class URLRequest; |
+} // namespace net |
+ |
+// This class allows the embedder (via WebContentsDelegate) to selectively |
+// ignore top level navigations. |
+class InterceptNavigationResourceThrottleImpl |
+ : public content::InterceptNavigationResourceThrottle { |
+ public: |
+ explicit InterceptNavigationResourceThrottleImpl(net::URLRequest* request); |
+ virtual ~InterceptNavigationResourceThrottleImpl(); |
+ |
+ // content::ResourceThrottle implementation: |
+ virtual void WillStartRequest(bool* defer) OVERRIDE; |
+ virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE; |
+ |
+ private: |
+ bool ShouldDeferRequestForURL(const GURL& url); |
+ void OnResultObtained(bool should_ignore_navigation); |
+ |
+ net::URLRequest* request_; |
+ base::WeakPtrFactory<InterceptNavigationResourceThrottleImpl> |
+ weak_ptr_factory_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(InterceptNavigationResourceThrottleImpl); |
+}; |
+ |
+#endif // CONTENT_BROWSER_RENDERER_HOST_INTERCEPT_NAVIGATION_RESOURCE_THROTTLE_IMPL_H_ |