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

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: rebase 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..745d55dc8acb89d2e87a11923a61500a9a83fc27
--- /dev/null
+++ b/components/web_restriction/web_restriction_provider.h
@@ -0,0 +1,48 @@
+// 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, UNKNOWN };
Bernhard Bauer 2016/01/22 17:32:32 Put the values on individual lines.
knn 2016/01/25 11:54:24 Done.
+
+class WebRestrictionProvider {
+ public:
+ class Observer {
Bernhard Bauer 2016/01/22 17:32:32 You could consider using a callback instead of a s
knn 2016/01/25 11:54:24 Done.
+ public:
+ virtual void ProviderUpdated();
+ };
+
+ virtual ~WebRestrictionProvider(){};
Bernhard Bauer 2016/01/22 17:32:32 No semicolon after a method body.
knn 2016/01/25 11:54:24 Done.
+
+ virtual UrlAccess ShouldProceed(bool is_main_frame,
+ const GURL& url) const = 0;
+
+ virtual void ShouldProceed(
+ bool is_main_frame,
+ const GURL& url,
+ const base::Callback<void(bool)>& callback) const = 0;
+
+ virtual bool SupportsRequest() const = 0;
+
+ virtual bool SupportsCustomErrorPage() const = 0;
+
+ virtual std::string GetErrorHtml() const = 0;
+
+ virtual void RequestPermission(const GURL& url) = 0;
+
+ virtual void AddObserver(Observer* observer) = 0;
+
+ virtual void RemoveObserver(Observer* observer) = 0;
+};
+
+} // namespace web_restriction
+
+#endif // COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698