OLD | NEW |
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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef WebPermissionClient_h | 31 #ifndef WebPermissionClient_h |
32 #define WebPermissionClient_h | 32 #define WebPermissionClient_h |
33 | 33 |
| 34 #include "public/platform/WebPermissionCallbacks.h" |
| 35 |
34 namespace blink { | 36 namespace blink { |
35 | 37 |
36 class WebDocument; | 38 class WebDocument; |
37 class WebPermissionCallbacks; | |
38 class WebSecurityOrigin; | 39 class WebSecurityOrigin; |
39 class WebString; | 40 class WebString; |
40 class WebURL; | 41 class WebURL; |
41 | 42 |
42 class WebPermissionClient { | 43 class WebPermissionClient { |
43 public: | 44 public: |
44 // Controls whether access to Web Databases is allowed for this frame. | 45 // Controls whether access to Web Databases is allowed for this frame. |
45 virtual bool allowDatabase(const WebString& name, const WebString& displayNa
me, unsigned long estimatedSize) { return true; } | 46 virtual bool allowDatabase(const WebString& name, const WebString& displayNa
me, unsigned long estimatedSize) { return true; } |
46 | 47 |
47 // Controls whether access to File System is allowed for this frame. | 48 // Controls whether access to File System is allowed for this frame. |
48 virtual bool allowFileSystem() { return true; } | |
49 | |
50 // Controls whether access to File System is allowed for this frame. | |
51 virtual bool requestFileSystemAccessSync() { return true; } | 49 virtual bool requestFileSystemAccessSync() { return true; } |
52 | 50 |
53 virtual void requestFileSystemAccessAsync(const WebPermissionCallbacks& call
backs) { } | 51 // Controls whether access to File System is allowed for this frame. |
| 52 virtual void requestFileSystemAccessAsync(const WebPermissionCallbacks& call
backs) { WebPermissionCallbacks permissionCallbacks(callbacks); permissionCallba
cks.doAllow(); } |
54 | 53 |
55 // Controls whether images are allowed for this frame. | 54 // Controls whether images are allowed for this frame. |
56 virtual bool allowImage(bool enabledPerSettings, const WebURL& imageURL) { r
eturn enabledPerSettings; } | 55 virtual bool allowImage(bool enabledPerSettings, const WebURL& imageURL) { r
eturn enabledPerSettings; } |
57 | 56 |
58 // Controls whether access to Indexed DB are allowed for this frame. | 57 // Controls whether access to Indexed DB are allowed for this frame. |
59 virtual bool allowIndexedDB(const WebString& name, const WebSecurityOrigin&)
{ return true; } | 58 virtual bool allowIndexedDB(const WebString& name, const WebSecurityOrigin&)
{ return true; } |
60 | 59 |
61 // Controls whether plugins are allowed for this frame. | 60 // Controls whether plugins are allowed for this frame. |
62 virtual bool allowPlugins(bool enabledPerSettings) { return enabledPerSettin
gs; } | 61 virtual bool allowPlugins(bool enabledPerSettings) { return enabledPerSettin
gs; } |
63 | 62 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // Notifies the client that the frame would have executed script if script w
ere enabled. | 111 // Notifies the client that the frame would have executed script if script w
ere enabled. |
113 virtual void didNotAllowScript() { } | 112 virtual void didNotAllowScript() { } |
114 | 113 |
115 protected: | 114 protected: |
116 ~WebPermissionClient() { } | 115 ~WebPermissionClient() { } |
117 }; | 116 }; |
118 | 117 |
119 } // namespace blink | 118 } // namespace blink |
120 | 119 |
121 #endif | 120 #endif |
OLD | NEW |