Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: Source/testing/runner/WebPermissions.h

Issue 27694002: Ability to block <audio> and <video> media. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rename "video" to "media". Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 27 matching lines...) Expand all
38 38
39 class WebTestDelegate; 39 class WebTestDelegate;
40 40
41 class WebPermissions : public WebKit::WebPermissionClient, public WebKit::WebNon Copyable { 41 class WebPermissions : public WebKit::WebPermissionClient, public WebKit::WebNon Copyable {
42 public: 42 public:
43 WebPermissions(); 43 WebPermissions();
44 virtual ~WebPermissions(); 44 virtual ~WebPermissions();
45 45
46 // Override WebPermissionClient methods. 46 // Override WebPermissionClient methods.
47 virtual bool allowImage(WebKit::WebFrame*, bool enabledPerSettings, const We bKit::WebURL& imageURL); 47 virtual bool allowImage(WebKit::WebFrame*, bool enabledPerSettings, const We bKit::WebURL& imageURL);
48 virtual bool allowMedia(WebKit::WebFrame*, bool enabledPerSettings, const We bKit::WebURL& mediaURL);
48 virtual bool allowScriptFromSource(WebKit::WebFrame*, bool enabledPerSetting s, const WebKit::WebURL& scriptURL); 49 virtual bool allowScriptFromSource(WebKit::WebFrame*, bool enabledPerSetting s, const WebKit::WebURL& scriptURL);
49 virtual bool allowStorage(WebKit::WebFrame*, bool local); 50 virtual bool allowStorage(WebKit::WebFrame*, bool local);
50 virtual bool allowPlugins(WebKit::WebFrame*, bool enabledPerSettings); 51 virtual bool allowPlugins(WebKit::WebFrame*, bool enabledPerSettings);
51 virtual bool allowDisplayingInsecureContent(WebKit::WebFrame*, bool enabledP erSettings, const WebKit::WebSecurityOrigin&, const WebKit::WebURL&); 52 virtual bool allowDisplayingInsecureContent(WebKit::WebFrame*, bool enabledP erSettings, const WebKit::WebSecurityOrigin&, const WebKit::WebURL&);
52 virtual bool allowRunningInsecureContent(WebKit::WebFrame*, bool enabledPerS ettings, const WebKit::WebSecurityOrigin&, const WebKit::WebURL&); 53 virtual bool allowRunningInsecureContent(WebKit::WebFrame*, bool enabledPerS ettings, const WebKit::WebSecurityOrigin&, const WebKit::WebURL&);
53 54
54 // Hooks to set the different policies. 55 // Hooks to set the different policies.
55 void setImagesAllowed(bool); 56 void setImagesAllowed(bool);
57 void setMediaAllowed(bool);
56 void setScriptsAllowed(bool); 58 void setScriptsAllowed(bool);
57 void setStorageAllowed(bool); 59 void setStorageAllowed(bool);
58 void setPluginsAllowed(bool); 60 void setPluginsAllowed(bool);
59 void setDisplayingInsecureContentAllowed(bool); 61 void setDisplayingInsecureContentAllowed(bool);
60 void setRunningInsecureContentAllowed(bool); 62 void setRunningInsecureContentAllowed(bool);
61 63
62 // Resets the policy to allow everything, except for running insecure conten t. 64 // Resets the policy to allow everything, except for running insecure conten t.
63 void reset(); 65 void reset();
64 66
65 void setDelegate(WebTestDelegate*); 67 void setDelegate(WebTestDelegate*);
66 void setDumpCallbacks(bool); 68 void setDumpCallbacks(bool);
67 69
68 private: 70 private:
69 WebTestDelegate* m_delegate; 71 WebTestDelegate* m_delegate;
70 bool m_dumpCallbacks; 72 bool m_dumpCallbacks;
71 73
72 bool m_imagesAllowed; 74 bool m_imagesAllowed;
75 bool m_mediaAllowed;
73 bool m_scriptsAllowed; 76 bool m_scriptsAllowed;
74 bool m_storageAllowed; 77 bool m_storageAllowed;
75 bool m_pluginsAllowed; 78 bool m_pluginsAllowed;
76 bool m_displayingInsecureContentAllowed; 79 bool m_displayingInsecureContentAllowed;
77 bool m_runningInsecureContentAllowed; 80 bool m_runningInsecureContentAllowed;
78 }; 81 };
79 82
80 } 83 }
81 84
82 #endif 85 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698