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

Unified Diff: content/browser/renderer_host/intercept_navigation_resource_throttle_impl.h

Issue 10310124: Implement a ResourceThrottle for URL overriding in Chrome on Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed chromeos build issue + rebase Created 8 years, 6 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: 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_

Powered by Google App Engine
This is Rietveld 408576698