OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_PROVIDER_H_ |
| 6 #define COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_PROVIDER_H_ |
| 7 |
| 8 #include "base/callback_forward.h" |
| 9 #include "base/macros.h" |
| 10 #include "url/gurl.h" |
| 11 |
| 12 namespace web_restriction { |
| 13 |
| 14 enum UrlAccess { |
| 15 ALLOW, |
| 16 DISALLOW, |
| 17 PENDING |
| 18 }; |
| 19 |
| 20 class WebRestrictionProvider { |
| 21 public: |
| 22 virtual ~WebRestrictionProvider() {} |
| 23 |
| 24 virtual UrlAccess ShouldProceed( |
| 25 bool is_main_frame, |
| 26 const GURL& url, |
| 27 const base::Callback<void(bool)>& callback) = 0; |
| 28 |
| 29 virtual bool SupportsRequest() const = 0; |
| 30 |
| 31 virtual bool GetErrorHtml(const GURL& url, std::string* error_html) const = 0; |
| 32 |
| 33 virtual void RequestPermission( |
| 34 const GURL& url, |
| 35 const base::Callback<void(bool)>& callback) = 0; |
| 36 }; |
| 37 |
| 38 } // namespace web_restriction |
| 39 |
| 40 #endif // COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_PROVIDER_H_ |
OLD | NEW |