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/macros.h" |
9 #include "third_party/WebKit/public/web/WebFrame.h" | 9 #include "third_party/WebKit/public/web/WebFrame.h" |
10 #include "third_party/WebKit/public/web/WebPermissionClient.h" | 10 #include "third_party/WebKit/public/web/WebPermissionClient.h" |
11 | 11 |
12 namespace WebTestRunner { | 12 namespace WebTestRunner { |
13 class WebTestDelegate; | |
14 } | |
13 | 15 |
14 class WebTestDelegate; | 16 namespace content { |
15 | 17 |
16 class WebPermissions : public blink::WebPermissionClient { | 18 class WebPermissions : public blink::WebPermissionClient { |
jochen (gone - plz use gerrit)
2014/04/28 09:22:43
the class is so small, what about just converting
| |
17 public: | 19 public: |
18 WebPermissions(); | 20 WebPermissions(); |
19 virtual ~WebPermissions(); | 21 virtual ~WebPermissions(); |
20 | 22 |
21 // Override WebPermissionClient methods. | 23 // Override WebPermissionClient methods. |
22 virtual bool allowImage(bool enabledPerSettings, const blink::WebURL& imageU RL); | 24 virtual bool allowImage(bool enabledPerSettings, const blink::WebURL& imageU RL); |
23 virtual bool allowScriptFromSource(bool enabledPerSettings, const blink::Web URL& scriptURL); | 25 virtual bool allowScriptFromSource(bool enabledPerSettings, const blink::Web URL& scriptURL); |
24 virtual bool allowStorage(bool local); | 26 virtual bool allowStorage(bool local); |
25 virtual bool allowPlugins(bool enabledPerSettings); | 27 virtual bool allowPlugins(bool enabledPerSettings); |
26 virtual bool allowDisplayingInsecureContent(bool enabledPerSettings, const b link::WebSecurityOrigin&, const blink::WebURL&); | 28 virtual bool allowDisplayingInsecureContent(bool enabledPerSettings, const b link::WebSecurityOrigin&, const blink::WebURL&); |
27 virtual bool allowRunningInsecureContent(bool enabledPerSettings, const blin k::WebSecurityOrigin&, const blink::WebURL&); | 29 virtual bool allowRunningInsecureContent(bool enabledPerSettings, const blin k::WebSecurityOrigin&, const blink::WebURL&); |
28 | 30 |
29 // Hooks to set the different policies. | 31 // Hooks to set the different policies. |
30 void setImagesAllowed(bool); | 32 void setImagesAllowed(bool); |
31 void setScriptsAllowed(bool); | 33 void setScriptsAllowed(bool); |
32 void setStorageAllowed(bool); | 34 void setStorageAllowed(bool); |
33 void setPluginsAllowed(bool); | 35 void setPluginsAllowed(bool); |
34 void setDisplayingInsecureContentAllowed(bool); | 36 void setDisplayingInsecureContentAllowed(bool); |
35 void setRunningInsecureContentAllowed(bool); | 37 void setRunningInsecureContentAllowed(bool); |
36 | 38 |
37 // Resets the policy to allow everything, except for running insecure conten t. | 39 // Resets the policy to allow everything, except for running insecure conten t. |
38 void reset(); | 40 void reset(); |
39 | 41 |
40 void setDelegate(WebTestDelegate*); | 42 void setDelegate(WebTestRunner::WebTestDelegate*); |
41 void setDumpCallbacks(bool); | 43 void setDumpCallbacks(bool); |
42 | 44 |
43 private: | 45 private: |
44 WebTestDelegate* m_delegate; | 46 WebTestRunner::WebTestDelegate* m_delegate; |
45 bool m_dumpCallbacks; | 47 bool m_dumpCallbacks; |
46 | 48 |
47 bool m_imagesAllowed; | 49 bool m_imagesAllowed; |
48 bool m_scriptsAllowed; | 50 bool m_scriptsAllowed; |
49 bool m_storageAllowed; | 51 bool m_storageAllowed; |
50 bool m_pluginsAllowed; | 52 bool m_pluginsAllowed; |
51 bool m_displayingInsecureContentAllowed; | 53 bool m_displayingInsecureContentAllowed; |
52 bool m_runningInsecureContentAllowed; | 54 bool m_runningInsecureContentAllowed; |
53 | 55 |
54 DISALLOW_COPY_AND_ASSIGN(WebPermissions); | 56 DISALLOW_COPY_AND_ASSIGN(WebPermissions); |
55 }; | 57 }; |
56 | 58 |
57 } | 59 } // namespace content |
58 | 60 |
59 #endif | 61 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBPERMISSIONS_H_ |
OLD | NEW |