blob: c89014bf3f52b79fb1f9be9a8aea1425e0aca7c8 [file] [log] [blame]
naskob9164c42016-06-07 01:21:351// Copyright 2016 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 EXTENSIONS_BROWSER_EXTENSION_NAVIGATION_THROTTLE_H_
6#define EXTENSIONS_BROWSER_EXTENSION_NAVIGATION_THROTTLE_H_
7
8#include "base/macros.h"
9#include "content/public/browser/navigation_throttle.h"
10
11namespace content {
12class NavigationHandle;
13}
14
15namespace extensions {
16
naskob9164c42016-06-07 01:21:3517// This class allows the extensions subsystem to have control over navigations
18// and optionally cancel/block them. This is a UI thread class.
19class ExtensionNavigationThrottle : public content::NavigationThrottle {
20 public:
21 explicit ExtensionNavigationThrottle(
22 content::NavigationHandle* navigation_handle);
23 ~ExtensionNavigationThrottle() override;
24
25 // content::NavigationThrottle implementation:
26 ThrottleCheckResult WillStartRequest() override;
nick7a719cd2017-05-23 20:51:2627 ThrottleCheckResult WillRedirectRequest() override;
naskod8185572017-04-24 17:17:1728 const char* GetNameForLogging() override;
naskob9164c42016-06-07 01:21:3529
30 private:
nick7a719cd2017-05-23 20:51:2631 // Shared throttle handler.
32 ThrottleCheckResult WillStartOrRedirectRequest();
33
naskob9164c42016-06-07 01:21:3534 DISALLOW_COPY_AND_ASSIGN(ExtensionNavigationThrottle);
35};
36
37} // namespace extensions
38
39#endif // EXTENSIONS_BROWSER_EXTENSION_NAVIGATION_THROTTLE_H_