| 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 };
|
| +
|
| +class WebRestrictionProvider {
|
| + public:
|
| + class Observer {
|
| + public:
|
| + virtual void ProviderUpdated();
|
| + };
|
| +
|
| + virtual ~WebRestrictionProvider(){};
|
| +
|
| + 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_
|
|
|