| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_COMPONENT_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_RE
SOURCE_THROTTLE_H_ | 5 #ifndef CONTENT_COMPONENTS_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_RESOURCE
_THROTTLE_H_ |
| 6 #define CHROME_BROWSER_COMPONENT_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_RE
SOURCE_THROTTLE_H_ | 6 #define CONTENT_COMPONENTS_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_RESOURCE
_THROTTLE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "content/public/browser/resource_throttle.h" | 12 #include "content/public/browser/resource_throttle.h" |
| 13 | 13 |
| 14 class GURL; | 14 class GURL; |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 class RenderViewHost; | 17 class RenderViewHost; |
| 18 struct Referrer; | 18 struct Referrer; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace net { | 21 namespace net { |
| 22 class URLRequest; | 22 class URLRequest; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace navigation_interception { | 25 namespace content { |
| 26 | 26 |
| 27 // This class allows the provider of the Callback to selectively ignore top | 27 // This class allows the provider of the Callback to selectively ignore top |
| 28 // level navigations. | 28 // level navigations. |
| 29 class InterceptNavigationResourceThrottle : public content::ResourceThrottle { | 29 class InterceptNavigationResourceThrottle : public content::ResourceThrottle { |
| 30 public: | 30 public: |
| 31 typedef base::Callback<bool(content::RenderViewHost* /* source */, | 31 typedef base::Callback<bool(content::RenderViewHost* /* source */, |
| 32 const GURL& /*url*/, | 32 const GURL& /*url*/, |
| 33 const content::Referrer& /*referrer*/, | 33 const content::Referrer& /*referrer*/, |
| 34 bool /*has_user_gesture*/)> | 34 bool /*has_user_gesture*/)> |
| 35 CheckOnUIThreadCallback; | 35 CheckOnUIThreadCallback; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 47 bool CheckIfShouldIgnoreNavigation(const GURL& url); | 47 bool CheckIfShouldIgnoreNavigation(const GURL& url); |
| 48 void OnResultObtained(bool should_ignore_navigation); | 48 void OnResultObtained(bool should_ignore_navigation); |
| 49 | 49 |
| 50 net::URLRequest* request_; | 50 net::URLRequest* request_; |
| 51 CheckOnUIThreadCallback should_ignore_callback_; | 51 CheckOnUIThreadCallback should_ignore_callback_; |
| 52 base::WeakPtrFactory<InterceptNavigationResourceThrottle> weak_ptr_factory_; | 52 base::WeakPtrFactory<InterceptNavigationResourceThrottle> weak_ptr_factory_; |
| 53 | 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(InterceptNavigationResourceThrottle); | 54 DISALLOW_COPY_AND_ASSIGN(InterceptNavigationResourceThrottle); |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace navigation_interception | 57 } // namespace content |
| 58 | 58 |
| 59 #endif // CHROME_BROWSER_COMPONENT_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION
_RESOURCE_THROTTLE_H_ | 59 #endif // CONTENT_COMPONENTS_NAVIGATION_INTERCEPTION_INTERCEPT_NAVIGATION_RESOU
RCE_THROTTLE_H_ |
| OLD | NEW |