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_GIN_WRAPPER_H_ | |
6 #define COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_GIN_WRAPPER_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "content/public/renderer/render_frame_observer.h" | |
10 #include "gin/wrappable.h" | |
11 | |
12 namespace content { | |
13 class RenderFrame; | |
14 } | |
15 | |
16 namespace web_restrictions { | |
17 | |
18 class WebRestrictionsGinWrapper | |
19 : public gin::Wrappable<WebRestrictionsGinWrapper>, | |
20 public content::RenderFrameObserver { | |
21 public: | |
22 static gin::WrapperInfo kWrapperInfo; | |
23 | |
24 static void Install(content::RenderFrame* render_frame); | |
25 | |
26 private: | |
27 explicit WebRestrictionsGinWrapper(content::RenderFrame* render_frame); | |
28 ~WebRestrictionsGinWrapper() override; | |
29 | |
30 // Override OnDestruct to prevent the wrapper going away when the | |
31 // RenderFrame does | |
32 void OnDestruct() override; | |
33 | |
34 // Request permission to allow visiting the currently blocked site. | |
35 bool RequestPermission(); | |
36 | |
37 // gin::WrappableBase | |
38 gin::ObjectTemplateBuilder GetObjectTemplateBuilder( | |
39 v8::Isolate* isolate) override; | |
40 | |
41 DISALLOW_COPY_AND_ASSIGN(WebRestrictionsGinWrapper); | |
42 }; | |
43 | |
44 } // namespace web_restrictions. | |
45 | |
46 #endif // COMPONENTS_WEB_RESTRICTION_WEB_RESTRICTION_GIN_WRAPPER_H_ | |
OLD | NEW |