#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBPERMISSIONS_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBPERMISSIONS_H_
#include "base/basictypes.h"
#include "third_party/WebKit/public/web/WebPermissionClient.h"
namespace WebTestRunner {
class WebTestDelegate;
class WebPermissions : public blink::WebPermissionClient {
public:
WebPermissions();
virtual ~WebPermissions();
virtual bool allowImage(blink::WebLocalFrame*, bool enabledPerSettings, const blink::WebURL& imageURL);
virtual bool allowScriptFromSource(blink::WebLocalFrame*, bool enabledPerSettings, const blink::WebURL& scriptURL);
virtual bool allowStorage(blink::WebLocalFrame*, bool local);
virtual bool allowPlugins(blink::WebLocalFrame*, bool enabledPerSettings);
virtual bool allowDisplayingInsecureContent(blink::WebLocalFrame*, bool enabledPerSettings, const blink::WebSecurityOrigin&, const blink::WebURL&);
virtual bool allowRunningInsecureContent(blink::WebLocalFrame*, bool enabledPerSettings, const blink::WebSecurityOrigin&, const blink::WebURL&);
virtual bool allowImage(bool enabledPerSettings, const blink::WebURL& imageURL);
virtual bool allowScriptFromSource(bool enabledPerSettings, const blink::WebURL& scriptURL);
virtual bool allowStorage(bool local);
virtual bool allowPlugins(bool enabledPerSettings);
virtual bool allowDisplayingInsecureContent(bool enabledPerSettings, const blink::WebSecurityOrigin&, const blink::WebURL&);
virtual bool allowRunningInsecureContent(bool enabledPerSettings, const blink::WebSecurityOrigin&, const blink::WebURL&);
void setImagesAllowed(bool);
void setScriptsAllowed(bool);
void setStorageAllowed(bool);
void setPluginsAllowed(bool);
void setDisplayingInsecureContentAllowed(bool);
void setRunningInsecureContentAllowed(bool);
void reset();
void setDelegate(WebTestDelegate*);
void setDumpCallbacks(bool);
private:
WebTestDelegate* m_delegate;
bool m_dumpCallbacks;
bool m_imagesAllowed;
bool m_scriptsAllowed;
bool m_storageAllowed;
bool m_pluginsAllowed;
bool m_displayingInsecureContentAllowed;
bool m_runningInsecureContentAllowed;
DISALLOW_COPY_AND_ASSIGN(WebPermissions);
};
}
#endif