OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WebPermissions_h |
| 6 #define WebPermissions_h |
| 7 |
| 8 #include "third_party/WebKit/public/platform/WebNonCopyable.h" |
| 9 #include "third_party/WebKit/public/web/WebPermissionClient.h" |
| 10 |
| 11 namespace WebTestRunner { |
| 12 |
| 13 class WebTestDelegate; |
| 14 |
| 15 class WebPermissions : public blink::WebPermissionClient, public blink::WebNonCo
pyable { |
| 16 public: |
| 17 WebPermissions(); |
| 18 virtual ~WebPermissions(); |
| 19 |
| 20 // Override WebPermissionClient methods. |
| 21 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 allowStorage(blink::WebFrame*, bool local); |
| 24 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 allowRunningInsecureContent(blink::WebFrame*, bool enabledPerSe
ttings, const blink::WebSecurityOrigin&, const blink::WebURL&); |
| 27 |
| 28 // Hooks to set the different policies. |
| 29 void setImagesAllowed(bool); |
| 30 void setScriptsAllowed(bool); |
| 31 void setStorageAllowed(bool); |
| 32 void setPluginsAllowed(bool); |
| 33 void setDisplayingInsecureContentAllowed(bool); |
| 34 void setRunningInsecureContentAllowed(bool); |
| 35 |
| 36 // Resets the policy to allow everything, except for running insecure conten
t. |
| 37 void reset(); |
| 38 |
| 39 void setDelegate(WebTestDelegate*); |
| 40 void setDumpCallbacks(bool); |
| 41 |
| 42 private: |
| 43 WebTestDelegate* m_delegate; |
| 44 bool m_dumpCallbacks; |
| 45 |
| 46 bool m_imagesAllowed; |
| 47 bool m_scriptsAllowed; |
| 48 bool m_storageAllowed; |
| 49 bool m_pluginsAllowed; |
| 50 bool m_displayingInsecureContentAllowed; |
| 51 bool m_runningInsecureContentAllowed; |
| 52 }; |
| 53 |
| 54 } |
| 55 |
| 56 #endif |
OLD | NEW |