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.
5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_
8 #include "content/common/content_export.h"
11 class NavigationHandle
;
13 // A NavigationThrottle tracks and allows interaction with a navigation on the
15 class CONTENT_EXPORT NavigationThrottle
{
17 // This is returned to the NavigationHandle to allow the navigation to
18 // proceed, or to cancel it.
19 enum ThrottleCheckResult
{
24 NavigationThrottle(NavigationHandle
* navigation_handle
);
25 virtual ~NavigationThrottle();
27 // Called when a network request is about to be made for this navigation.
28 virtual ThrottleCheckResult
WillStartRequest();
30 // Called when a server redirect is received by the navigation.
31 virtual ThrottleCheckResult
WillRedirectRequest();
33 // The NavigationHandle that is tracking the information related to this
35 NavigationHandle
* navigation_handle() const { return navigation_handle_
; }
38 NavigationHandle
* navigation_handle_
;
41 } // namespace content
43 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_THROTTLE_H_