OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INTERCEPT_NAVIGATION_RESOURCE_THROTTLE_IMP
L_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INTERCEPT_NAVIGATION_RESOURCE_THROTTLE_IMP
L_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <string> |
| 10 |
| 11 #include "base/memory/weak_ptr.h" |
| 12 #include "content/public/browser/intercept_navigation_resource_throttle.h" |
| 13 |
| 14 namespace net { |
| 15 class URLRequest; |
| 16 } // namespace net |
| 17 |
| 18 // This class allows the embedder (via WebContentsDelegate) to selectively |
| 19 // ignore top level navigations. |
| 20 class InterceptNavigationResourceThrottleImpl |
| 21 : public content::InterceptNavigationResourceThrottle { |
| 22 public: |
| 23 explicit InterceptNavigationResourceThrottleImpl(net::URLRequest* request); |
| 24 virtual ~InterceptNavigationResourceThrottleImpl(); |
| 25 |
| 26 // content::ResourceThrottle implementation: |
| 27 virtual void WillStartRequest(bool* defer) OVERRIDE; |
| 28 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE; |
| 29 |
| 30 private: |
| 31 bool ShouldDeferRequestForURL(const GURL& url); |
| 32 void OnResultObtained(bool should_ignore_navigation); |
| 33 |
| 34 net::URLRequest* request_; |
| 35 base::WeakPtrFactory<InterceptNavigationResourceThrottleImpl> |
| 36 weak_ptr_factory_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(InterceptNavigationResourceThrottleImpl); |
| 39 }; |
| 40 |
| 41 #endif // CONTENT_BROWSER_RENDERER_HOST_INTERCEPT_NAVIGATION_RESOURCE_THROTTLE_
IMPL_H_ |
OLD | NEW |