OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBPERMISSIONS_H_ | 5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBPERMISSIONS_H_ |
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBPERMISSIONS_H_ | 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBPERMISSIONS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "third_party/WebKit/public/web/WebPermissionClient.h" | 9 #include "third_party/WebKit/public/web/WebPermissionClient.h" |
10 | 10 |
11 namespace WebTestRunner { | 11 namespace WebTestRunner { |
12 | 12 |
13 class WebTestDelegate; | 13 class WebTestDelegate; |
14 | 14 |
15 class WebPermissions : public blink::WebPermissionClient { | 15 class WebPermissions : public blink::WebPermissionClient { |
16 public: | 16 public: |
17 WebPermissions(); | 17 WebPermissions(); |
18 virtual ~WebPermissions(); | 18 virtual ~WebPermissions(); |
19 | 19 |
20 // Override WebPermissionClient methods. | 20 // Override WebPermissionClient methods. |
| 21 // TODO(jam): remove all these methods after Blink rolls. |
21 virtual bool allowImage(blink::WebFrame*, bool enabledPerSettings, const bli
nk::WebURL& imageURL); | 22 virtual bool allowImage(blink::WebFrame*, bool enabledPerSettings, const bli
nk::WebURL& imageURL); |
22 virtual bool allowScriptFromSource(blink::WebFrame*, bool enabledPerSettings
, const blink::WebURL& scriptURL); | 23 virtual bool allowScriptFromSource(blink::WebFrame*, bool enabledPerSettings
, const blink::WebURL& scriptURL); |
23 virtual bool allowStorage(blink::WebFrame*, bool local); | 24 virtual bool allowStorage(blink::WebFrame*, bool local); |
24 virtual bool allowPlugins(blink::WebFrame*, bool enabledPerSettings); | 25 virtual bool allowPlugins(blink::WebFrame*, bool enabledPerSettings); |
25 virtual bool allowDisplayingInsecureContent(blink::WebFrame*, bool enabledPe
rSettings, const blink::WebSecurityOrigin&, const blink::WebURL&); | 26 virtual bool allowDisplayingInsecureContent(blink::WebFrame*, bool enabledPe
rSettings, const blink::WebSecurityOrigin&, const blink::WebURL&); |
26 virtual bool allowRunningInsecureContent(blink::WebFrame*, bool enabledPerSe
ttings, const blink::WebSecurityOrigin&, const blink::WebURL&); | 27 virtual bool allowRunningInsecureContent(blink::WebFrame*, bool enabledPerSe
ttings, const blink::WebSecurityOrigin&, const blink::WebURL&); |
27 | 28 |
| 29 virtual bool allowImage(bool enabledPerSettings, const blink::WebURL& imageU
RL); |
| 30 virtual bool allowScriptFromSource(bool enabledPerSettings, const blink::Web
URL& scriptURL); |
| 31 virtual bool allowStorage(bool local); |
| 32 virtual bool allowPlugins(bool enabledPerSettings); |
| 33 virtual bool allowDisplayingInsecureContent(bool enabledPerSettings, const b
link::WebSecurityOrigin&, const blink::WebURL&); |
| 34 virtual bool allowRunningInsecureContent(bool enabledPerSettings, const blin
k::WebSecurityOrigin&, const blink::WebURL&); |
| 35 |
28 // Hooks to set the different policies. | 36 // Hooks to set the different policies. |
29 void setImagesAllowed(bool); | 37 void setImagesAllowed(bool); |
30 void setScriptsAllowed(bool); | 38 void setScriptsAllowed(bool); |
31 void setStorageAllowed(bool); | 39 void setStorageAllowed(bool); |
32 void setPluginsAllowed(bool); | 40 void setPluginsAllowed(bool); |
33 void setDisplayingInsecureContentAllowed(bool); | 41 void setDisplayingInsecureContentAllowed(bool); |
34 void setRunningInsecureContentAllowed(bool); | 42 void setRunningInsecureContentAllowed(bool); |
35 | 43 |
36 // Resets the policy to allow everything, except for running insecure conten
t. | 44 // Resets the policy to allow everything, except for running insecure conten
t. |
37 void reset(); | 45 void reset(); |
(...skipping 11 matching lines...) Expand all Loading... |
49 bool m_pluginsAllowed; | 57 bool m_pluginsAllowed; |
50 bool m_displayingInsecureContentAllowed; | 58 bool m_displayingInsecureContentAllowed; |
51 bool m_runningInsecureContentAllowed; | 59 bool m_runningInsecureContentAllowed; |
52 | 60 |
53 DISALLOW_COPY_AND_ASSIGN(WebPermissions); | 61 DISALLOW_COPY_AND_ASSIGN(WebPermissions); |
54 }; | 62 }; |
55 | 63 |
56 } | 64 } |
57 | 65 |
58 #endif | 66 #endif |
OLD | NEW |