| 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..ae5883b5e85828827cd63eba9fe5c87c2a72c167
|
| --- /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 and allows interaction with a navigation on the
|
| +// UI thread.
|
| +class CONTENT_EXPORT NavigationThrottle {
|
| + public:
|
| + // This is returned to the NavigationHandle to allow the navigation to
|
| + // proceed, or to cancel it.
|
| + enum ThrottleCheckResult {
|
| + PROCEED,
|
| + CANCEL_AND_IGNORE,
|
| + };
|
| +
|
| + 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_
|
|
|