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_WEB_PERMISSIONS_H_ |
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBPERMISSIONS_H_ | 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_PERMISSIONS_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "third_party/WebKit/public/web/WebFrame.h" | |
10 #include "third_party/WebKit/public/web/WebPermissionClient.h" | 9 #include "third_party/WebKit/public/web/WebPermissionClient.h" |
11 | 10 |
12 namespace content { | 11 namespace content { |
13 | 12 |
14 class WebTestDelegate; | 13 class WebTestDelegate; |
15 | 14 |
16 class WebPermissions : public blink::WebPermissionClient { | 15 class WebPermissions : public blink::WebPermissionClient { |
17 public: | 16 public: |
18 WebPermissions(); | 17 WebPermissions(); |
19 virtual ~WebPermissions(); | 18 virtual ~WebPermissions(); |
20 | 19 |
21 // Override WebPermissionClient methods. | 20 // blink::WebPermissionClient: |
22 virtual bool allowImage(bool enabledPerSettings, const blink::WebURL& imageU
RL); | 21 virtual bool allowImage(bool enabledPerSettings, |
23 virtual bool allowMedia(const blink::WebURL& mediaURL); | 22 const blink::WebURL& imageURL); |
24 virtual bool allowScriptFromSource(bool enabledPerSettings, const blink::Web
URL& scriptURL); | 23 virtual bool allowMedia(const blink::WebURL& mediaURL); |
25 virtual bool allowStorage(bool local); | 24 virtual bool allowScriptFromSource(bool enabledPerSettings, |
26 virtual bool allowPlugins(bool enabledPerSettings); | 25 const blink::WebURL& scriptURL); |
27 virtual bool allowDisplayingInsecureContent(bool enabledPerSettings, const b
link::WebSecurityOrigin&, const blink::WebURL&); | 26 virtual bool allowStorage(bool local); |
28 virtual bool allowRunningInsecureContent(bool enabledPerSettings, const blin
k::WebSecurityOrigin&, const blink::WebURL&); | 27 virtual bool allowPlugins(bool enabledPerSettings); |
| 28 virtual bool allowDisplayingInsecureContent(bool enabledPerSettings, |
| 29 const blink::WebSecurityOrigin&, |
| 30 const blink::WebURL&); |
| 31 virtual bool allowRunningInsecureContent(bool enabledPerSettings, |
| 32 const blink::WebSecurityOrigin&, |
| 33 const blink::WebURL&); |
29 | 34 |
30 // Hooks to set the different policies. | 35 // Hooks to set the different policies. |
31 void setImagesAllowed(bool); | 36 void SetImagesAllowed(bool); |
32 void setMediaAllowed(bool); | 37 void SetMediaAllowed(bool); |
33 void setScriptsAllowed(bool); | 38 void SetScriptsAllowed(bool); |
34 void setStorageAllowed(bool); | 39 void SetStorageAllowed(bool); |
35 void setPluginsAllowed(bool); | 40 void SetPluginsAllowed(bool); |
36 void setDisplayingInsecureContentAllowed(bool); | 41 void SetDisplayingInsecureContentAllowed(bool); |
37 void setRunningInsecureContentAllowed(bool); | 42 void SetRunningInsecureContentAllowed(bool); |
38 | 43 |
39 // Resets the policy to allow everything, except for running insecure conten
t. | 44 void SetDelegate(WebTestDelegate*); |
40 void reset(); | 45 void SetDumpCallbacks(bool); |
41 | 46 |
42 void setDelegate(WebTestDelegate*); | 47 // Resets the policy to allow everything, except for running insecure content. |
43 void setDumpCallbacks(bool); | 48 void Reset(); |
44 | 49 |
45 private: | 50 private: |
46 WebTestDelegate* m_delegate; | 51 WebTestDelegate* delegate_; |
47 bool m_dumpCallbacks; | 52 bool dump_callbacks_; |
48 | 53 |
49 bool m_imagesAllowed; | 54 bool images_allowed_; |
50 bool m_mediaAllowed; | 55 bool media_allowed_; |
51 bool m_scriptsAllowed; | 56 bool scripts_allowed_; |
52 bool m_storageAllowed; | 57 bool storage_allowed_; |
53 bool m_pluginsAllowed; | 58 bool plugins_allowed_; |
54 bool m_displayingInsecureContentAllowed; | 59 bool displaying_insecure_content_allowed_; |
55 bool m_runningInsecureContentAllowed; | 60 bool running_insecure_content_allowed_; |
56 | 61 |
57 DISALLOW_COPY_AND_ASSIGN(WebPermissions); | 62 DISALLOW_COPY_AND_ASSIGN(WebPermissions); |
58 }; | 63 }; |
59 | 64 |
60 } // namespace content | 65 } // namespace content |
61 | 66 |
62 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBPERMISSIONS_H_ | 67 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_PERMISSIONS_H_ |
OLD | NEW |