Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Unified Diff: components/web_restriction/web_restriction_provider.h

Issue 1423713015: [WIP] WebRestrictions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: continue review in split cl Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/web_restriction/web_restriction_provider.h
diff --git a/components/web_restriction/web_restriction_provider.h b/components/web_restriction/web_restriction_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..fdaee3ebfa5c67043c18636224717ddcf586ce0d
--- /dev/null
+++ b/components/web_restriction/web_restriction_provider.h
@@ -0,0 +1,40 @@
+// 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 COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_PROVIDER_H_
+#define COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_PROVIDER_H_
+
+#include "base/callback_forward.h"
+#include "base/macros.h"
+#include "url/gurl.h"
+
+namespace web_restriction {
+
+enum UrlAccess {
+ ALLOW,
+ DISALLOW,
+ PENDING
+};
+
+class WebRestrictionProvider {
+ public:
+ virtual ~WebRestrictionProvider() {}
+
+ virtual UrlAccess ShouldProceed(
+ bool is_main_frame,
+ const GURL& url,
+ const base::Callback<void(bool)>& callback) = 0;
+
+ virtual bool SupportsRequest() const = 0;
+
+ virtual bool GetErrorHtml(const GURL& url, std::string* error_html) const = 0;
+
+ virtual void RequestPermission(
+ const GURL& url,
+ const base::Callback<void(bool)>& callback) = 0;
+};
+
+} // namespace web_restriction
+
+#endif // COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698