| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 14 matching lines...) Expand all Loading... |
| 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 WebKit_h | 31 #ifndef WebKit_h |
| 32 #define WebKit_h | 32 #define WebKit_h |
| 33 | 33 |
| 34 #include "WebCommon.h" | 34 #include "WebCommon.h" |
| 35 #include "WebURL.h" | |
| 36 | 35 |
| 37 namespace WebKit { | 36 namespace WebKit { |
| 38 class WebKitClient; | 37 class WebKitClient; |
| 39 class WebString; | |
| 40 | 38 |
| 41 // Must be called on the thread that will be the main WebKit thread before | 39 // Must be called on the thread that will be the main WebKit thread before |
| 42 // using any other WebKit APIs. The provided WebKitClient must be non-null | 40 // using any other WebKit APIs. The provided WebKitClient must be non-null |
| 43 // and must remain valid until the current thread calls shutdown. | 41 // and must remain valid until the current thread calls shutdown. |
| 44 WEBKIT_API void initialize(WebKitClient*); | 42 WEBKIT_API void initialize(WebKitClient*); |
| 45 | 43 |
| 46 // Once shutdown, the WebKitClient passed to initialize will no longer be | 44 // Once shutdown, the WebKitClient passed to initialize will no longer be |
| 47 // accessed. No other WebKit objects should be in use when this function | 45 // accessed. No other WebKit objects should be in use when this function |
| 48 // is called. Any background threads created by WebKit are promised to be | 46 // is called. Any background threads created by WebKit are promised to be |
| 49 // terminated by the time this function returns. | 47 // terminated by the time this function returns. |
| 50 WEBKIT_API void shutdown(); | 48 WEBKIT_API void shutdown(); |
| 51 | 49 |
| 52 // Returns the WebKitClient instance passed to initialize. | 50 // Returns the WebKitClient instance passed to initialize. |
| 53 WEBKIT_API WebKitClient* webKitClient(); | 51 WEBKIT_API WebKitClient* webKitClient(); |
| 54 | 52 |
| 55 // Alters the rendering of content to conform to a fixed set of rules. | 53 // Alters the rendering of content to conform to a fixed set of rules. |
| 56 WEBKIT_API void setLayoutTestMode(bool); | 54 WEBKIT_API void setLayoutTestMode(bool); |
| 57 WEBKIT_API bool layoutTestMode(); | 55 WEBKIT_API bool layoutTestMode(); |
| 58 | 56 |
| 59 // Registers a URL scheme to be treated as a local scheme (i.e., with the | |
| 60 // same security rules as those applied to "file" URLs). This means that | |
| 61 // normal pages cannot link to or access URLs of this scheme. | |
| 62 WEBKIT_API void registerURLSchemeAsLocal(const WebString&); | |
| 63 | |
| 64 // Registers a URL scheme to be treated as a noAccess scheme. This means | |
| 65 // that pages loaded with this URL scheme cannot access pages loaded with | |
| 66 // any other URL scheme. | |
| 67 WEBKIT_API void registerURLSchemeAsNoAccess(const WebString&); | |
| 68 | |
| 69 // Enables HTML5 media support. | 57 // Enables HTML5 media support. |
| 70 WEBKIT_API void enableMediaPlayer(); | 58 WEBKIT_API void enableMediaPlayer(); |
| 71 | 59 |
| 72 // Purge the plugin list cache. If |reloadPages| is true, any pages | 60 // Purge the plugin list cache. If |reloadPages| is true, any pages |
| 73 // containing plugins will be reloaded after refreshing the plugin list. | 61 // containing plugins will be reloaded after refreshing the plugin list. |
| 74 WEBKIT_API void resetPluginCache(bool reloadPages); | 62 WEBKIT_API void resetPluginCache(bool reloadPages); |
| 75 | 63 |
| 76 // Enables HTML5 database support. | 64 // Enables HTML5 database support. |
| 77 WEBKIT_API void enableDatabases(); | 65 WEBKIT_API void enableDatabases(); |
| 78 WEBKIT_API bool databasesEnabled(); | 66 WEBKIT_API bool databasesEnabled(); |
| 79 | 67 |
| 80 // Support for whitelisting access to origins beyond the same-origin policy. | |
| 81 WEBKIT_API void whiteListAccessFromOrigin( | |
| 82 const WebURL& sourceOrigin, const WebString& destinationProtocol, | |
| 83 const WebString& destinationHost, bool allowDestinationSubdomains); | |
| 84 WEBKIT_API void resetOriginAccessWhiteLists(); | |
| 85 | |
| 86 // Enables HTML5 Web Sockets support. | 68 // Enables HTML5 Web Sockets support. |
| 87 WEBKIT_API void enableWebSockets(); | 69 WEBKIT_API void enableWebSockets(); |
| 88 WEBKIT_API bool webSocketsEnabled(); | 70 WEBKIT_API bool webSocketsEnabled(); |
| 89 | 71 |
| 90 } // namespace WebKit | 72 } // namespace WebKit |
| 91 | 73 |
| 92 #endif | 74 #endif |
| OLD | NEW |