OLD | NEW |
| (Empty) |
1 // Copyright 2015 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_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ | |
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ | |
7 | |
8 #include "content/common/content_export.h" | |
9 | |
10 namespace content { | |
11 class NavigationHandle; | |
12 | |
13 // A NavigationThrottle tracks and allows interaction with a navigation on the | |
14 // UI thread. | |
15 class CONTENT_EXPORT NavigationThrottle { | |
16 public: | |
17 // This is returned to the NavigationHandle to allow the navigation to | |
18 // proceed, or to cancel it. | |
19 enum ThrottleCheckResult { | |
20 PROCEED, | |
21 CANCEL_AND_IGNORE, | |
22 }; | |
23 | |
24 NavigationThrottle(NavigationHandle* navigation_handle); | |
25 virtual ~NavigationThrottle(); | |
26 | |
27 // Called when a network request is about to be made for this navigation. | |
28 virtual ThrottleCheckResult WillStartRequest(); | |
29 | |
30 // Called when a server redirect is received by the navigation. | |
31 virtual ThrottleCheckResult WillRedirectRequest(); | |
32 | |
33 // The NavigationHandle that is tracking the information related to this | |
34 // navigation. | |
35 NavigationHandle* navigation_handle() const { return navigation_handle_; } | |
36 | |
37 private: | |
38 NavigationHandle* navigation_handle_; | |
39 }; | |
40 | |
41 } // namespace content | |
42 | |
43 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_ | |
OLD | NEW |