| Index: components/supervised_user_error_page/supervised_user_gin_wrapper.h
|
| diff --git a/components/supervised_user_error_page/supervised_user_gin_wrapper.h b/components/supervised_user_error_page/supervised_user_gin_wrapper.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..66bee9e9e79e9d8de94d528bcca8217aa3423760
|
| --- /dev/null
|
| +++ b/components/supervised_user_error_page/supervised_user_gin_wrapper.h
|
| @@ -0,0 +1,61 @@
|
| +// 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_GIN_WRAPPER_H_
|
| +#define COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_GIN_WRAPPER_H_
|
| +
|
| +#include "base/macros.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "components/web_restrictions/interfaces/web_restrictions.mojom.h"
|
| +#include "content/public/renderer/render_frame_observer.h"
|
| +#include "gin/wrappable.h"
|
| +#include "url/gurl.h"
|
| +
|
| +namespace content {
|
| +class RenderFrame;
|
| +}
|
| +
|
| +namespace supervised_user_error_page {
|
| +
|
| +class SupervisedUserGinWrapper
|
| + : public gin::Wrappable<SupervisedUserGinWrapper>,
|
| + public content::RenderFrameObserver {
|
| + public:
|
| + static gin::WrapperInfo kWrapperInfo;
|
| +
|
| + static void Install(content::RenderFrame* render_frame,
|
| + const std::string& url,
|
| + const web_restrictions::mojom::WebRestrictionsPtr&
|
| + web_restrictions_service);
|
| +
|
| + private:
|
| + SupervisedUserGinWrapper(content::RenderFrame* render_frame,
|
| + const std::string& url,
|
| + const web_restrictions::mojom::WebRestrictionsPtr&
|
| + web_restrictions_service);
|
| + ~SupervisedUserGinWrapper() override;
|
| +
|
| + // Override OnDestruct to prevent the wrapper going away when the
|
| + // RenderFrame does
|
| + void OnDestruct() override;
|
| +
|
| + // Request permission to allow visiting the currently blocked site.
|
| + bool RequestPermission();
|
| +
|
| + void OnAccessRequestAdded(bool success);
|
| +
|
| + // gin::WrappableBase
|
| + gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
|
| + v8::Isolate* isolate) override;
|
| +
|
| + const std::string url_;
|
| + const web_restrictions::mojom::WebRestrictionsPtr& web_restrictions_service_;
|
| + base::WeakPtrFactory<SupervisedUserGinWrapper> weak_ptr_factory_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(SupervisedUserGinWrapper);
|
| +};
|
| +
|
| +} // namespace web_restrictions.
|
| +
|
| +#endif // COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_GIN_WRAPPER_H_
|
|
|