diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-10 20:30:41 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-10 20:30:41 +0000 |
commit | afdcf5c1551bf741662c60d42cae425b3c017ef7 (patch) | |
tree | f53b5ce5dba4765b4f11a921ee94122aab443d3a /webkit/api/public/WebKitClient.h | |
parent | 743daf194f9bb1ebba83b16b13e1f16b3fce861e (diff) | |
download | chromium_src-afdcf5c1551bf741662c60d42cae425b3c017ef7.zip chromium_src-afdcf5c1551bf741662c60d42cae425b3c017ef7.tar.gz chromium_src-afdcf5c1551bf741662c60d42cae425b3c017ef7.tar.bz2 |
Move WebKit API to src/webkit/api.
R=dglazkov
Review URL: http://codereview.chromium.org/113186
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15739 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/api/public/WebKitClient.h')
-rw-r--r-- | webkit/api/public/WebKitClient.h | 141 |
1 files changed, 141 insertions, 0 deletions
diff --git a/webkit/api/public/WebKitClient.h b/webkit/api/public/WebKitClient.h new file mode 100644 index 0000000..112e5ff --- /dev/null +++ b/webkit/api/public/WebKitClient.h @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2009 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebKitClient_h +#define WebKitClient_h + +#include "WebCommon.h" + +namespace WebKit { + class WebClipboard; + class WebData; + class WebMimeRegistry; + class WebPluginListBuilder; + class WebSandboxSupport; + class WebString; + class WebThemeEngine; + class WebURL; + struct WebPluginInfo; + template <typename T> class WebVector; + class WebWorker; + class WebWorkerClient; + + class WebKitClient { + public: + // Must return non-null. + virtual WebClipboard* clipboard() = 0; + + // Must return non-null. + virtual WebMimeRegistry* mimeRegistry() = 0; + + // May return null on some platforms. + virtual WebSandboxSupport* sandboxSupport() = 0; + + // May return null on some platforms. + virtual WebThemeEngine* themeEngine() = 0; + + + // History ------------------------------------------------------------- + + // Returns the hash for the given canonicalized URL for use in visited + // link coloring. + virtual unsigned long long visitedLinkHash( + const char* canonicalURL, size_t length) = 0; + + // Returns whether the given link hash is in the user's history. The + // hash must have been generated by calling VisitedLinkHash(). + virtual bool isLinkVisited(unsigned long long linkHash) = 0; + + + // Network ------------------------------------------------------------- + + virtual void setCookies( + const WebURL& url, const WebURL& policyURL, const WebString& cookies) = 0; + virtual WebString cookies(const WebURL& url, const WebURL& policyURL) = 0; + + // A suggestion to prefetch IP information for the given hostname. + virtual void prefetchHostName(const WebString&) = 0; + + + // Plugins ------------------------------------------------------------- + + // If refresh is true, then cached information should not be used to + // satisfy this call. + virtual void getPluginList(bool refresh, WebPluginListBuilder*) = 0; + + + // Profiling ----------------------------------------------------------- + + virtual void decrementStatsCounter(const char* name) = 0; + virtual void incrementStatsCounter(const char* name) = 0; + + // An event is identified by the pair (name, id). The extra parameter + // specifies additional data to log with the event. + virtual void traceEventBegin(const char* name, void* id, const char* extra) = 0; + virtual void traceEventEnd(const char* name, void* id, const char* extra) = 0; + + + // Resources ----------------------------------------------------------- + + // Returns a blob of data corresponding to the named resource. + virtual WebData loadResource(const char* name) = 0; + + + // Sudden Termination -------------------------------------------------- + + // Disable/Enable sudden termination. + virtual void suddenTerminationChanged(bool enabled) = 0; + + + // System -------------------------------------------------------------- + + // Returns a value such as "en-US". + virtual WebString defaultLocale() = 0; + + // Wall clock time in seconds since the epoch. + virtual double currentTime() = 0; + + // Delayed work is driven by a shared timer. + virtual void setSharedTimerFiredFunction(void (*func)()) = 0; + virtual void setSharedTimerFireTime(double fireTime) = 0; + virtual void stopSharedTimer() = 0; + + // Callable from a background WebKit thread. + virtual void callOnMainThread(void (*func)()) = 0; + + + // WebWorkers ---------------------------------------------------------- + + virtual WebWorker* createWorker(WebWorkerClient*) = 0; + }; + +} // namespace WebKit + +#endif |