Index: content/public/browser/navigation_throttle.h |
diff --git a/content/public/browser/navigation_throttle.h b/content/public/browser/navigation_throttle.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..813cf3991721077534cd49a2e0f5c26b93a0b33e |
--- /dev/null |
+++ b/content/public/browser/navigation_throttle.h |
@@ -0,0 +1,43 @@ |
+// Copyright 2015 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_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ |
+#define CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ |
+ |
+#include "content/common/content_export.h" |
+ |
+namespace content { |
+class NavigationHandle; |
+ |
+// A NavigationThrottle tracks is used to interact with a navigation on the UI |
carlosk
2015/08/28 16:40:25
/is used to interact/and allows interaction/
clamy
2015/09/03 15:30:52
Done.
|
+// thread. |
+class CONTENT_EXPORT NavigationThrottle { |
+ public: |
+ // This is returned to the navigation handler to allow the navigation to |
+ // proceed, or to cancel it. |
+ enum ThrottleCheckResult { |
+ PROCEED, |
+ CANCEL_AND_IGNORE, |
nasko
2015/08/31 23:25:15
Why not just "Cancel" instead of "Cancel and Ignor
clamy
2015/09/03 15:30:52
This matches the actions in ResourceController. On
|
+ }; |
+ |
+ NavigationThrottle(NavigationHandle* navigation_handle); |
+ virtual ~NavigationThrottle(); |
+ |
+ // Called when a network request is about to be made for this navigation. |
+ virtual ThrottleCheckResult WillStartRequest(); |
+ |
+ // Called when a server redirect is received by the navigation. |
+ virtual ThrottleCheckResult WillRedirectRequest(); |
+ |
+ // The NavigationHandle that is tracking the information related to this |
+ // navigation. |
+ NavigationHandle* navigation_handle() const { return navigation_handle_; } |
+ |
+ private: |
+ NavigationHandle* navigation_handle_; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ |