1 // Copyright 2018 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 CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_THROTTLE_H_ 6 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_THROTTLE_H_ 7 8 #include "content/public/browser/navigation_throttle.h" 9 10 namespace content { 11 class NavigationHandle; 12 } // namespace content 13 14 namespace safe_browsing { 15 16 // This throttle monitors failed requests, and if a request failed due to it 17 // being blocked by Safe Browsing, it creates and displays an interstitial. 18 // This throttle is only created when Safe Browsing committed interstitials are 19 // enabled. 20 class SafeBrowsingNavigationThrottle : public content::NavigationThrottle { 21 public: 22 explicit SafeBrowsingNavigationThrottle(content::NavigationHandle* handle); ~SafeBrowsingNavigationThrottle()23 ~SafeBrowsingNavigationThrottle() override {} 24 const char* GetNameForLogging() override; 25 26 content::NavigationThrottle::ThrottleCheckResult WillFailRequest() override; 27 }; 28 29 } // namespace safe_browsing 30 31 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_THROTTLE_H_ 32