Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_NAVIGATION_THROTTLE_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_NAVIGATION_THROTTLE_H_ |
| 6 #define EXTENSIONS_BROWSER_EXTENSION_NAVIGATION_THROTTLE_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_NAVIGATION_THROTTLE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "content/public/browser/navigation_throttle.h" | 9 #include "content/public/browser/navigation_throttle.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 class NavigationHandle; | 12 class NavigationHandle; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace extensions { | 15 namespace extensions { |
| 16 | 16 |
| 17 // This class allows the extensions subsystem to have control over navigations | 17 // This class allows the extensions subsystem to have control over navigations |
| 18 // and optionally cancel/block them. This is a UI thread class. | 18 // and optionally cancel/block them. This is a UI thread class. |
| 19 class ExtensionNavigationThrottle : public content::NavigationThrottle { | 19 class ExtensionNavigationThrottle : public content::NavigationThrottle { |
| 20 public: | 20 public: |
| 21 explicit ExtensionNavigationThrottle( | 21 explicit ExtensionNavigationThrottle( |
| 22 content::NavigationHandle* navigation_handle); | 22 content::NavigationHandle* navigation_handle); |
| 23 ~ExtensionNavigationThrottle() override; | 23 ~ExtensionNavigationThrottle() override; |
| 24 | 24 |
| 25 // Shared throttle handler. | |
| 26 ThrottleCheckResult WillStartOrRedirectRequest(); | |
|
Devlin
2017/05/18 15:22:44
Should this be private?
ncarter (slow)
2017/05/22 22:55:59
Done.
| |
| 27 | |
| 25 // content::NavigationThrottle implementation: | 28 // content::NavigationThrottle implementation: |
| 26 ThrottleCheckResult WillStartRequest() override; | 29 ThrottleCheckResult WillStartRequest() override; |
| 30 ThrottleCheckResult WillRedirectRequest() override; | |
| 27 const char* GetNameForLogging() override; | 31 const char* GetNameForLogging() override; |
| 28 | 32 |
| 29 private: | 33 private: |
| 30 DISALLOW_COPY_AND_ASSIGN(ExtensionNavigationThrottle); | 34 DISALLOW_COPY_AND_ASSIGN(ExtensionNavigationThrottle); |
| 31 }; | 35 }; |
| 32 | 36 |
| 33 } // namespace extensions | 37 } // namespace extensions |
| 34 | 38 |
| 35 #endif // EXTENSIONS_BROWSER_EXTENSION_NAVIGATION_THROTTLE_H_ | 39 #endif // EXTENSIONS_BROWSER_EXTENSION_NAVIGATION_THROTTLE_H_ |
| OLD | NEW |