diff options
Diffstat (limited to 'WebKit/chromium/public')
54 files changed, 1705 insertions, 150 deletions
diff --git a/WebKit/chromium/public/WebApplicationCacheHost.h b/WebKit/chromium/public/WebApplicationCacheHost.h index 7c5dafe..23be4dd 100644 --- a/WebKit/chromium/public/WebApplicationCacheHost.h +++ b/WebKit/chromium/public/WebApplicationCacheHost.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2010 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 @@ -42,7 +42,7 @@ class WebURLResponse; struct WebURLError; // This interface is used by webkit to call out to the embedder. Webkit uses -// the WebKitClient::createApplicationCacheHost method to create instances, +// the WebFrameClient::createApplicationCacheHost method to create instances, // and calls delete when the instance is no longer needed. class WebApplicationCacheHost { public: diff --git a/WebKit/chromium/public/WebCString.h b/WebKit/chromium/public/WebCString.h index 434cb06..d24916b 100644 --- a/WebKit/chromium/public/WebCString.h +++ b/WebKit/chromium/public/WebCString.h @@ -34,7 +34,7 @@ #include "WebCommon.h" #if WEBKIT_IMPLEMENTATION -namespace WebCore { class CString; } +namespace WTF { class CString; } #else #include <string> #endif @@ -84,9 +84,9 @@ public: WEBKIT_API static WebCString fromUTF16(const WebUChar* data); #if WEBKIT_IMPLEMENTATION - WebCString(const WebCore::CString&); - WebCString& operator=(const WebCore::CString&); - operator WebCore::CString() const; + WebCString(const WTF::CString&); + WebCString& operator=(const WTF::CString&); + operator WTF::CString() const; #else WebCString(const std::string& s) : m_private(0) { diff --git a/WebKit/chromium/public/WebCommon.h b/WebKit/chromium/public/WebCommon.h index d347ea6..e7e38d3 100644 --- a/WebKit/chromium/public/WebCommon.h +++ b/WebKit/chromium/public/WebCommon.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2010 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 @@ -89,6 +89,21 @@ typedef wchar_t WebUChar; typedef unsigned short WebUChar; #endif +// ----------------------------------------------------------------------------- +// Assertions + +WEBKIT_API void failedAssertion(const char* file, int line, const char* function, const char* assertion); + } // namespace WebKit +// Ideally, only use inside the public directory but outside of WEBKIT_IMPLEMENTATION blocks. (Otherwise use WTF's ASSERT.) +#if defined(NDEBUG) +#define WEBKIT_ASSERT(assertion) ((void)0) +#else +#define WEBKIT_ASSERT(assertion) do { \ + if (!(assertion)) \ + failedAssertion(__FILE__, __LINE__, __FUNCTION__, #assertion); \ +} while (0) +#endif + #endif diff --git a/WebKit/chromium/public/WebCommonWorkerClient.h b/WebKit/chromium/public/WebCommonWorkerClient.h index 771ffff..f4df16d 100644 --- a/WebKit/chromium/public/WebCommonWorkerClient.h +++ b/WebKit/chromium/public/WebCommonWorkerClient.h @@ -49,14 +49,18 @@ public: const WebString& errorString, int lineNumber, const WebString& sourceURL) = 0; - virtual void postConsoleMessageToWorkerObject( - int destinationIdentifier, - int sourceIdentifier, - int messageType, - int messageLevel, - const WebString& message, - int lineNumber, - const WebString& sourceURL) = 0; + // FIXME: the below is for compatibility only and should be + // removed once Chromium is updated to remove message + // destination parameter <http://webkit.org/b/37155>. + virtual void postConsoleMessageToWorkerObject(int, int sourceIdentifier, int messageType, int messageLevel, + const WebString& message, int lineNumber, const WebString& sourceURL) = 0; + + virtual void postConsoleMessageToWorkerObject(int sourceIdentifier, int messageType, int messageLevel, + const WebString& message, int lineNumber, const WebString& sourceURL) + { + postConsoleMessageToWorkerObject(0, sourceIdentifier, messageType, messageLevel, + message, lineNumber, sourceURL); + } virtual void workerContextClosed() = 0; virtual void workerContextDestroyed() = 0; diff --git a/WebKit/chromium/public/WebContextMenuData.h b/WebKit/chromium/public/WebContextMenuData.h index 384240d..25036d4 100644 --- a/WebKit/chromium/public/WebContextMenuData.h +++ b/WebKit/chromium/public/WebContextMenuData.h @@ -83,6 +83,8 @@ struct WebContextMenuData { MediaLoop = 0x8, MediaCanSave = 0x10, MediaHasAudio = 0x20, + MediaHasVideo = 0x40, + MediaControls = 0x80, }; // Extra attributes describing media elements. diff --git a/WebKit/chromium/public/WebCookieJar.h b/WebKit/chromium/public/WebCookieJar.h index df70341..6daba6b 100644 --- a/WebKit/chromium/public/WebCookieJar.h +++ b/WebKit/chromium/public/WebCookieJar.h @@ -31,8 +31,9 @@ #ifndef WebCookieJar_h #define WebCookieJar_h +#include "WebString.h" + namespace WebKit { -class WebString; class WebURL; struct WebCookie; template <typename T> class WebVector; diff --git a/WebKit/chromium/public/WebDevToolsFrontendClient.h b/WebKit/chromium/public/WebDevToolsFrontendClient.h index 6200709..754ecf9 100644 --- a/WebKit/chromium/public/WebDevToolsFrontendClient.h +++ b/WebKit/chromium/public/WebDevToolsFrontendClient.h @@ -46,8 +46,8 @@ public: virtual void activateWindow() {}; virtual void closeWindow() {}; - virtual void dockWindow() {}; - virtual void undockWindow() {}; + virtual void requestDockWindow() {}; + virtual void requestUndockWindow() {}; protected: virtual ~WebDevToolsFrontendClient() {} diff --git a/WebKit/chromium/public/WebDocument.h b/WebKit/chromium/public/WebDocument.h index 8964d3a..1f09653 100644 --- a/WebKit/chromium/public/WebDocument.h +++ b/WebKit/chromium/public/WebDocument.h @@ -42,6 +42,7 @@ namespace WebKit { class WebElement; class WebFrame; class WebNodeCollection; +class WebNodeList; class WebString; class WebURL; @@ -61,15 +62,17 @@ public: // Returns the frame the document belongs to or 0 if the document is frameless. WEBKIT_API WebFrame* frame() const; WEBKIT_API bool isHTMLDocument() const; + WEBKIT_API bool isPluginDocument() const; WEBKIT_API WebURL baseURL() const; + WEBKIT_API WebURL firstPartyForCookies() const; WEBKIT_API WebElement documentElement() const; WEBKIT_API WebElement body() const; WEBKIT_API WebElement head(); WEBKIT_API WebString title() const; WEBKIT_API WebNodeCollection all(); WEBKIT_API WebURL completeURL(const WebString&) const; - WEBKIT_API WebElement getElementById(const WebString& id) const; - WEBKIT_API WebString applicationID() const; + WEBKIT_API WebElement getElementById(const WebString&) const; + WEBKIT_API WebNode focusedNode() const; #if WEBKIT_IMPLEMENTATION WebDocument(const WTF::PassRefPtr<WebCore::Document>&); diff --git a/WebKit/chromium/public/WebElement.h b/WebKit/chromium/public/WebElement.h index 20f6c9a..1be40bc 100644 --- a/WebKit/chromium/public/WebElement.h +++ b/WebKit/chromium/public/WebElement.h @@ -35,7 +35,6 @@ #if WEBKIT_IMPLEMENTATION namespace WebCore { class Element; } -namespace WTF { template <typename T> class PassRefPtr; } #endif namespace WebKit { @@ -48,6 +47,7 @@ namespace WebKit { WebElement& operator=(const WebElement& e) { WebNode::assign(e); return *this; } void assign(const WebElement& e) { WebNode::assign(e); } + WEBKIT_API bool isFormControlElement() const; WEBKIT_API WebString tagName() const; WEBKIT_API bool hasTagName(const WebString&) const; WEBKIT_API bool hasAttribute(const WebString&) const; diff --git a/WebKit/chromium/public/WebFormControlElement.h b/WebKit/chromium/public/WebFormControlElement.h new file mode 100644 index 0000000..ee0783d --- /dev/null +++ b/WebKit/chromium/public/WebFormControlElement.h @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2010 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 WebFormControlElement_h +#define WebFormControlElement_h + +#include "WebElement.h" +#include "WebString.h" + +#if WEBKIT_IMPLEMENTATION +namespace WebCore { class HTMLFormControlElement; } +#endif + +namespace WebKit { + +// Provides readonly access to some properties of a DOM form control element node. +class WebFormControlElement : public WebElement { +public: + WebFormControlElement() : WebElement() { } + WebFormControlElement(const WebFormControlElement& e) : WebElement(e) { } + + WebFormControlElement& operator=(const WebFormControlElement& e) + { + WebElement::assign(e); + return *this; + } + WEBKIT_API void assign(const WebFormControlElement& e) { WebElement::assign(e); } + + WEBKIT_API bool isEnabled() const; + WEBKIT_API WebString formControlName() const; + WEBKIT_API WebString formControlType() const; + + // Returns the name that should be used for the specified |element| when + // storing autofill data. This is either the field name or its id, an empty + // string if it has no name and no id. + WEBKIT_API WebString nameForAutofill() const; + +#if WEBKIT_IMPLEMENTATION + WebFormControlElement(const WTF::PassRefPtr<WebCore::HTMLFormControlElement>&); + WebFormControlElement& operator=(const WTF::PassRefPtr<WebCore::HTMLFormControlElement>&); + operator WTF::PassRefPtr<WebCore::HTMLFormControlElement>() const; +#endif +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebFormElement.h b/WebKit/chromium/public/WebFormElement.h index b07bff9..8cb4e47 100644 --- a/WebKit/chromium/public/WebFormElement.h +++ b/WebKit/chromium/public/WebFormElement.h @@ -32,15 +32,17 @@ #define WebFormElement_h #include "WebElement.h" -#include "WebInputElement.h" #include "WebVector.h" #if WEBKIT_IMPLEMENTATION namespace WebCore { class HTMLFormElement; } -namespace WTF { template <typename T> class PassRefPtr; } #endif namespace WebKit { + + class WebInputElement; + class WebFormControlElement; + // A container for passing around a reference to a form element. Provides // some information about the form. class WebFormElement : public WebElement { @@ -57,12 +59,6 @@ namespace WebKit { } WEBKIT_API void assign(const WebFormElement& e) { WebElement::assign(e); } -#if WEBKIT_IMPLEMENTATION - WebFormElement(const WTF::PassRefPtr<WebCore::HTMLFormElement>&); - WebFormElement& operator=(const WTF::PassRefPtr<WebCore::HTMLFormElement>&); - operator WTF::PassRefPtr<WebCore::HTMLFormElement>() const; -#endif - WEBKIT_API bool autoComplete() const; WEBKIT_API WebString action() const; WEBKIT_API WebString name() const; @@ -70,7 +66,15 @@ namespace WebKit { WEBKIT_API void submit(); // FIXME: Deprecate and replace with WebVector<WebElement>. WEBKIT_API void getNamedElements(const WebString&, WebVector<WebNode>&); + // DEPRECATED: Replaced by getFormControlElements. WEBKIT_API void getInputElements(WebVector<WebInputElement>&) const; + WEBKIT_API void getFormControlElements(WebVector<WebFormControlElement>&) const; + +#if WEBKIT_IMPLEMENTATION + WebFormElement(const WTF::PassRefPtr<WebCore::HTMLFormElement>&); + WebFormElement& operator=(const WTF::PassRefPtr<WebCore::HTMLFormElement>&); + operator WTF::PassRefPtr<WebCore::HTMLFormElement>() const; +#endif }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h index f193b9e..f112446 100644 --- a/WebKit/chromium/public/WebFrame.h +++ b/WebKit/chromium/public/WebFrame.h @@ -39,6 +39,8 @@ struct NPObject; #if WEBKIT_USING_V8 namespace v8 { class Context; +class Value; +template <class T> class Handle; template <class T> class Local; } #endif @@ -123,6 +125,9 @@ public: // NOTE: These routines do not force page layout so their results may // not be accurate if the page layout is out-of-date. + // If set to false, do not draw scrollbars on this frame's view. + virtual void setCanHaveScrollbars(bool) = 0; + // The scroll offset from the top-left corner of the frame in pixels. virtual WebSize scrollOffset() const = 0; @@ -222,6 +227,11 @@ public: virtual void collectGarbage() = 0; #if WEBKIT_USING_V8 + // Executes script in the context of the current page and returns the value + // that the script evaluated to. + virtual v8::Handle<v8::Value> executeScriptAndReturnValue( + const WebScriptSource&) = 0; + // Returns the V8 context for this frame, or an empty handle if there // is none. virtual v8::Local<v8::Context> mainWorldScriptContext() const = 0; @@ -367,10 +377,14 @@ public: // Printing ------------------------------------------------------------ - // Reformats the WebFrame for printing. pageSize is the page size in - // pixels. Returns the number of pages that can be printed at the - // given page size. - virtual int printBegin(const WebSize& pageSize) = 0; + // Reformats the WebFrame for printing. pageSize is the page size in + // points (a point in 1/72 of an inch). printerDPI is the user selected, + // DPI for the printer. Returns the number of pages that + // can be printed at the given page size. The out param useBrowserOverlays + // specifies whether the browser process should use its overlays (header, + // footer, margins etc) or whether the renderer controls this. + virtual int printBegin(const WebSize& pageSize, int printerDPI = 72, + bool* useBrowserOverlays = 0) = 0; // Returns the page shrinking factor calculated by webkit (usually // between 1/1.25 and 1/2). Returns 0 if the page number is invalid or @@ -492,6 +506,12 @@ public: float pageWidthInPixels, float pageHeightInPixels) const = 0; + // Returns the bounds rect for current selection. If selection is performed + // on transformed text, the rect will still bound the selection but will + // not be transformed itself. If no selection is present, the rect will be + // empty ((0,0), (0,0)). + virtual WebRect selectionBoundsRect() const = 0; + protected: ~WebFrame() { } }; diff --git a/WebKit/chromium/public/WebFrameClient.h b/WebKit/chromium/public/WebFrameClient.h index ae2541a..315cf87 100644 --- a/WebKit/chromium/public/WebFrameClient.h +++ b/WebKit/chromium/public/WebFrameClient.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2010 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 @@ -38,6 +38,8 @@ namespace WebKit { +class WebApplicationCacheHost; +class WebApplicationCacheHostClient; class WebCookieJar; class WebDataSource; class WebFormElement; @@ -75,10 +77,14 @@ public: // May return null. virtual WebMediaPlayer* createMediaPlayer(WebFrame*, WebMediaPlayerClient*) { return 0; } + // May return null. + virtual WebApplicationCacheHost* createApplicationCacheHost(WebFrame*, WebApplicationCacheHostClient*) { return 0; } + // Services ------------------------------------------------------------ - // A frame specific cookie jar. May return null. + // A frame specific cookie jar. May return null, in which case + // WebKitClient::cookieJar() will be called to access cookies. virtual WebCookieJar* cookieJar() { return 0; } @@ -90,6 +96,9 @@ public: // Controls whether plugins are allowed for this frame. virtual bool allowPlugins(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; } + // Notifies the client that the frame would have instantiated a plug-in if plug-ins were enabled. + virtual void didNotAllowPlugins(WebFrame*) { } + // Controls whether images are allowed for this frame. virtual bool allowImages(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; } @@ -195,9 +204,16 @@ public: // The frame's document and all of its subresources succeeded to load. virtual void didFinishLoad(WebFrame*) { } + // The navigation resulted in no change to the documents within the page. + // For example, the navigation may have just resulted in scrolling to a + // named anchor or a PopState event may have been dispatched. + virtual void didNavigateWithinPage(WebFrame*, bool isNewNavigation) { } + // The navigation resulted in scrolling the page to a named anchor instead // of downloading a new document. + // FIXME: The isNewNavigation parameter is DEPRECATED. virtual void didChangeLocationWithinPage(WebFrame*, bool isNewNavigation) { } + virtual void didChangeLocationWithinPage(WebFrame*) { } // Called upon update to scroll position, document state, and other // non-navigational events related to the data held by WebHistoryItem. @@ -252,6 +268,12 @@ public: // Controls whether scripts are allowed to execute for this frame. virtual bool allowScript(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; } + // Controls whether access to Web Databases is allowed for this frame. + virtual bool allowDatabase(WebFrame*, const WebString& name, const WebString& displayName, unsigned long estimatedSize) { return true; } + + // Notifies the client that the frame would have executed script if script were enabled. + virtual void didNotAllowScript(WebFrame*) { } + // Script in the page tried to allocate too much memory. virtual void didExhaustMemoryAvailableForScript(WebFrame*) { } diff --git a/WebKit/chromium/public/WebGLES2Context.h b/WebKit/chromium/public/WebGLES2Context.h new file mode 100644 index 0000000..bd63060 --- /dev/null +++ b/WebKit/chromium/public/WebGLES2Context.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2010 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 WebGLES2Context_h +#define WebGLES2Context_h + +#include "WebCommon.h" +#include "WebNonCopyable.h" + +namespace WebKit { + +class WebView; + +// This interface abstracts the creation and management of an +// OpenGL ES 2.0 context. + +class WebGLES2Context : public WebNonCopyable { +public: + virtual ~WebGLES2Context() {} + + virtual bool initialize(WebView*) = 0; + virtual bool makeCurrent() = 0; + virtual bool destroy() = 0; + virtual bool swapBuffers() = 0; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebGeolocationService.h b/WebKit/chromium/public/WebGeolocationService.h new file mode 100644 index 0000000..ed8c4e8 --- /dev/null +++ b/WebKit/chromium/public/WebGeolocationService.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2010, 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 WebGeolocationService_h +#define WebGeolocationService_h + +#include "WebGeolocationServiceBridge.h" + +namespace WebKit { + +class WebString; +class WebURL; + +// Provides an embedder API called by WebKit. +class WebGeolocationService { +public: + virtual void requestPermissionForFrame(int bridgeId, const WebURL& url) { } + virtual void cancelPermissionRequestForFrame(int bridgeId, const WebURL&) { } + virtual void startUpdating(int bridgeId, const WebURL& url, bool enableHighAccuracy) { } + virtual void stopUpdating(int bridgeId) { } + virtual void suspend(int bridgeId) { } + virtual void resume(int bridgeId) { } + + // Attaches the WebGeolocationServiceBridge to the embedder and returns its + // id, which should be used on subsequent calls for the methods above. + virtual int attachBridge(WebGeolocationServiceBridge*) { return 0; } + + // Detaches the WebGeolocationServiceBridge from the embedder. + virtual void detachBridge(int bridgeId) { } +}; + +} // namespace WebKit + +#endif // WebGeolocationService_h diff --git a/WebKit/chromium/public/GeolocationServiceBridgeChromium.h b/WebKit/chromium/public/WebGeolocationServiceBridge.h index adca956..9f0ffd4 100644 --- a/WebKit/chromium/public/GeolocationServiceBridgeChromium.h +++ b/WebKit/chromium/public/WebGeolocationServiceBridge.h @@ -28,8 +28,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef GeolocationServiceBridgeChromium_h -#define GeolocationServiceBridgeChromium_h +#ifndef WebGeolocationServiceBridge_h +#define WebGeolocationServiceBridge_h namespace WebCore { class GeolocationServiceBridge; @@ -49,25 +49,6 @@ public: virtual void setLastError(int errorCode, const WebString& message) = 0; }; -// Provides an embedder API called by WebKit. -class WebGeolocationServiceInterface { -public: - virtual void requestPermissionForFrame(int bridgeId, const WebURL& url) = 0; - virtual void startUpdating(int bridgeId, bool hasHighAccuracy) = 0; - virtual void stopUpdating(int bridgeId) = 0; - virtual void suspend(int bridgeId) = 0; - virtual void resume(int bridgeId) = 0; - - // Attaches the GeolocationBridge to the embedder and returns its id, which - // should be used on subsequent calls for the methods above. - virtual int attachBridge(WebKit::WebGeolocationServiceBridge* geolocationServiceBridge) = 0; - - // Dettaches the GeolocationService from the embedder. - virtual void dettachBridge(int bridgeId) = 0; -}; - -WebCore::GeolocationServiceBridge* createGeolocationServiceBridgeImpl(WebCore::GeolocationServiceChromium*); - } // namespace WebKit -#endif // GeolocationServiceBridgeChromium_h +#endif // WebGeolocationServiceBridge_h diff --git a/WebKit/chromium/public/WebGraphicsContext3D.h b/WebKit/chromium/public/WebGraphicsContext3D.h new file mode 100644 index 0000000..3418ef9 --- /dev/null +++ b/WebKit/chromium/public/WebGraphicsContext3D.h @@ -0,0 +1,302 @@ +/* + * Copyright (C) 2010 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 WebGraphicsContext3D_h +#define WebGraphicsContext3D_h + +#include "WebCommon.h" +#include "WebNonCopyable.h" +#include "WebString.h" + +namespace WebKit { + +// Typedef for server-side objects like OpenGL textures and program objects. +typedef unsigned int WebGLId; + +// This interface abstracts the operations performed by the +// GraphicsContext3D in order to implement WebGL. Nearly all of the +// methods exposed on this interface map directly to entry points in +// the OpenGL ES 2.0 API. + +class WebGraphicsContext3D : public WebNonCopyable { +public: + // Return value from getActiveUniform and getActiveAttrib. + struct ActiveInfo { + WebString name; + unsigned type; + int size; + }; + + // Context creation attributes. + struct Attributes { + Attributes() + : alpha(true) + , depth(true) + , stencil(true) + , antialias(true) + , premultipliedAlpha(true) + { + } + + bool alpha; + bool depth; + bool stencil; + bool antialias; + bool premultipliedAlpha; + }; + + // This destructor needs to be public so that using classes can destroy instances if initialization fails. + virtual ~WebGraphicsContext3D() {} + + // Creates a "default" implementation of WebGraphicsContext3D which calls + // OpenGL directly. + static WebGraphicsContext3D* createDefault(); + + // Initializes the graphics context; should be the first operation performed + // on newly-constructed instances. Returns true on success. + virtual bool initialize(Attributes) = 0; + + // Makes the OpenGL context current on the current thread. Returns true on + // success. + virtual bool makeContextCurrent() = 0; + + // The size of the region into which this WebGraphicsContext3D is rendering. + // Returns the last values passed to reshape(). + virtual int width() = 0; + virtual int height() = 0; + + // Helper to return the size in bytes of OpenGL data types + // like GL_FLOAT, GL_INT, etc. + virtual int sizeInBytes(int type) = 0; + + // Resizes the region into which this WebGraphicsContext3D is drawing. + virtual void reshape(int width, int height) = 0; + + // Helper for software compositing path. Reads back the frame buffer into + // the memory region pointed to by "pixels" with size "bufferSize". It is + // expected that the storage for "pixels" covers (4 * width * height) bytes. + // Returns true on success. + virtual bool readBackFramebuffer(unsigned char* pixels, size_t bufferSize) = 0; + + // Synthesizes an OpenGL error which will be returned from a + // later call to getError. This is used to emulate OpenGL ES + // 2.0 behavior on the desktop and to enforce additional error + // checking mandated by WebGL. + // + // Per the behavior of glGetError, this stores at most one + // instance of any given error, and returns them from calls to + // getError in the order they were added. + virtual void synthesizeGLError(unsigned long error) = 0; + + // The entry points below map directly to the OpenGL ES 2.0 API. + // See: http://www.khronos.org/registry/gles/ + // and: http://www.khronos.org/opengles/sdk/docs/man/ + virtual void activeTexture(unsigned long texture) = 0; + virtual void attachShader(WebGLId program, WebGLId shader) = 0; + virtual void bindAttribLocation(WebGLId program, unsigned long index, const char* name) = 0; + virtual void bindBuffer(unsigned long target, WebGLId buffer) = 0; + virtual void bindFramebuffer(unsigned long target, WebGLId framebuffer) = 0; + virtual void bindRenderbuffer(unsigned long target, WebGLId renderbuffer) = 0; + virtual void bindTexture(unsigned long target, WebGLId texture) = 0; + virtual void blendColor(double red, double green, double blue, double alpha) = 0; + virtual void blendEquation(unsigned long mode) = 0; + virtual void blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha) = 0; + virtual void blendFunc(unsigned long sfactor, unsigned long dfactor) = 0; + virtual void blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha) = 0; + + virtual void bufferData(unsigned long target, int size, const void* data, unsigned long usage) = 0; + virtual void bufferSubData(unsigned long target, long offset, int size, const void* data) = 0; + + virtual unsigned long checkFramebufferStatus(unsigned long target) = 0; + virtual void clear(unsigned long mask) = 0; + virtual void clearColor(double red, double green, double blue, double alpha) = 0; + virtual void clearDepth(double depth) = 0; + virtual void clearStencil(long s) = 0; + virtual void colorMask(bool red, bool green, bool blue, bool alpha) = 0; + virtual void compileShader(WebGLId shader) = 0; + + virtual void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border) = 0; + virtual void copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height) = 0; + virtual void cullFace(unsigned long mode) = 0; + virtual void depthFunc(unsigned long func) = 0; + virtual void depthMask(bool flag) = 0; + virtual void depthRange(double zNear, double zFar) = 0; + virtual void detachShader(WebGLId program, WebGLId shader) = 0; + virtual void disable(unsigned long cap) = 0; + virtual void disableVertexAttribArray(unsigned long index) = 0; + virtual void drawArrays(unsigned long mode, long first, long count) = 0; + virtual void drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset) = 0; + + virtual void enable(unsigned long cap) = 0; + virtual void enableVertexAttribArray(unsigned long index) = 0; + virtual void finish() = 0; + virtual void flush() = 0; + virtual void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, WebGLId renderbuffer) = 0; + virtual void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, WebGLId texture, long level) = 0; + virtual void frontFace(unsigned long mode) = 0; + virtual void generateMipmap(unsigned long target) = 0; + + virtual bool getActiveAttrib(WebGLId program, unsigned long index, ActiveInfo&) = 0; + virtual bool getActiveUniform(WebGLId program, unsigned long index, ActiveInfo&) = 0; + + virtual int getAttribLocation(WebGLId program, const char* name) = 0; + + virtual void getBooleanv(unsigned long pname, unsigned char* value) = 0; + + virtual void getBufferParameteriv(unsigned long target, unsigned long pname, int* value) = 0; + + virtual Attributes getContextAttributes() = 0; + + virtual unsigned long getError() = 0; + + virtual void getFloatv(unsigned long pname, float* value) = 0; + + virtual void getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value) = 0; + + virtual void getIntegerv(unsigned long pname, int* value) = 0; + + virtual void getProgramiv(WebGLId program, unsigned long pname, int* value) = 0; + + virtual WebString getProgramInfoLog(WebGLId program) = 0; + + virtual void getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value) = 0; + + virtual void getShaderiv(WebGLId shader, unsigned long pname, int* value) = 0; + + virtual WebString getShaderInfoLog(WebGLId shader) = 0; + + // TBD + // void glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); + + virtual WebString getShaderSource(WebGLId shader) = 0; + virtual WebString getString(unsigned long name) = 0; + + virtual void getTexParameterfv(unsigned long target, unsigned long pname, float* value) = 0; + virtual void getTexParameteriv(unsigned long target, unsigned long pname, int* value) = 0; + + virtual void getUniformfv(WebGLId program, long location, float* value) = 0; + virtual void getUniformiv(WebGLId program, long location, int* value) = 0; + + virtual long getUniformLocation(WebGLId program, const char* name) = 0; + + virtual void getVertexAttribfv(unsigned long index, unsigned long pname, float* value) = 0; + virtual void getVertexAttribiv(unsigned long index, unsigned long pname, int* value) = 0; + + virtual long getVertexAttribOffset(unsigned long index, unsigned long pname) = 0; + + virtual void hint(unsigned long target, unsigned long mode) = 0; + virtual bool isBuffer(WebGLId buffer) = 0; + virtual bool isEnabled(unsigned long cap) = 0; + virtual bool isFramebuffer(WebGLId framebuffer) = 0; + virtual bool isProgram(WebGLId program) = 0; + virtual bool isRenderbuffer(WebGLId renderbuffer) = 0; + virtual bool isShader(WebGLId shader) = 0; + virtual bool isTexture(WebGLId texture) = 0; + virtual void lineWidth(double) = 0; + virtual void linkProgram(WebGLId program) = 0; + virtual void pixelStorei(unsigned long pname, long param) = 0; + virtual void polygonOffset(double factor, double units) = 0; + + virtual void readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* pixels) = 0; + + virtual void releaseShaderCompiler() = 0; + virtual void renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height) = 0; + virtual void sampleCoverage(double value, bool invert) = 0; + virtual void scissor(long x, long y, unsigned long width, unsigned long height) = 0; + virtual void shaderSource(WebGLId shader, const char* string) = 0; + virtual void stencilFunc(unsigned long func, long ref, unsigned long mask) = 0; + virtual void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask) = 0; + virtual void stencilMask(unsigned long mask) = 0; + virtual void stencilMaskSeparate(unsigned long face, unsigned long mask) = 0; + virtual void stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass) = 0; + virtual void stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass) = 0; + + virtual void texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, const void* pixels) = 0; + + virtual void texParameterf(unsigned target, unsigned pname, float param) = 0; + virtual void texParameteri(unsigned target, unsigned pname, int param) = 0; + + virtual void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, unsigned width, unsigned height, unsigned format, unsigned type, const void* pixels) = 0; + + virtual void uniform1f(long location, float x) = 0; + virtual void uniform1fv(long location, int count, float* v) = 0; + virtual void uniform1i(long location, int x) = 0; + virtual void uniform1iv(long location, int count, int* v) = 0; + virtual void uniform2f(long location, float x, float y) = 0; + virtual void uniform2fv(long location, int count, float* v) = 0; + virtual void uniform2i(long location, int x, int y) = 0; + virtual void uniform2iv(long location, int count, int* v) = 0; + virtual void uniform3f(long location, float x, float y, float z) = 0; + virtual void uniform3fv(long location, int count, float* v) = 0; + virtual void uniform3i(long location, int x, int y, int z) = 0; + virtual void uniform3iv(long location, int count, int* v) = 0; + virtual void uniform4f(long location, float x, float y, float z, float w) = 0; + virtual void uniform4fv(long location, int count, float* v) = 0; + virtual void uniform4i(long location, int x, int y, int z, int w) = 0; + virtual void uniform4iv(long location, int count, int* v) = 0; + virtual void uniformMatrix2fv(long location, int count, bool transpose, const float* value) = 0; + virtual void uniformMatrix3fv(long location, int count, bool transpose, const float* value) = 0; + virtual void uniformMatrix4fv(long location, int count, bool transpose, const float* value) = 0; + + virtual void useProgram(WebGLId program) = 0; + virtual void validateProgram(WebGLId program) = 0; + + virtual void vertexAttrib1f(unsigned long indx, float x) = 0; + virtual void vertexAttrib1fv(unsigned long indx, const float* values) = 0; + virtual void vertexAttrib2f(unsigned long indx, float x, float y) = 0; + virtual void vertexAttrib2fv(unsigned long indx, const float* values) = 0; + virtual void vertexAttrib3f(unsigned long indx, float x, float y, float z) = 0; + virtual void vertexAttrib3fv(unsigned long indx, const float* values) = 0; + virtual void vertexAttrib4f(unsigned long indx, float x, float y, float z, float w) = 0; + virtual void vertexAttrib4fv(unsigned long indx, const float* values) = 0; + virtual void vertexAttribPointer(unsigned long indx, int size, int type, bool normalized, + unsigned long stride, unsigned long offset) = 0; + + virtual void viewport(long x, long y, unsigned long width, unsigned long height) = 0; + + // Support for buffer creation and deletion. + virtual unsigned createBuffer() = 0; + virtual unsigned createFramebuffer() = 0; + virtual unsigned createProgram() = 0; + virtual unsigned createRenderbuffer() = 0; + virtual unsigned createShader(unsigned long) = 0; + virtual unsigned createTexture() = 0; + + virtual void deleteBuffer(unsigned) = 0; + virtual void deleteFramebuffer(unsigned) = 0; + virtual void deleteProgram(unsigned) = 0; + virtual void deleteRenderbuffer(unsigned) = 0; + virtual void deleteShader(unsigned) = 0; + virtual void deleteTexture(unsigned) = 0; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebHTTPBody.h b/WebKit/chromium/public/WebHTTPBody.h index fcc44ff..a7dc7c9 100644 --- a/WebKit/chromium/public/WebHTTPBody.h +++ b/WebKit/chromium/public/WebHTTPBody.h @@ -81,9 +81,9 @@ public: // Append to the list of elements. WEBKIT_API void appendData(const WebData&); - WEBKIT_API void appendFile(const WebString&); // FIXME: to be removed. + WEBKIT_API void appendFile(const WebString&); // Passing -1 to fileLength means to the end of the file. - WEBKIT_API void appendFile(const WebString&, long long fileStart, long long fileLength, const WebFileInfo&); + WEBKIT_API void appendFileRange(const WebString&, long long fileStart, long long fileLength, const WebFileInfo&); // Identifies a particular form submission instance. A value of 0 is // used to indicate an unspecified identifier. diff --git a/WebKit/chromium/public/WebHistoryItem.h b/WebKit/chromium/public/WebHistoryItem.h index e248a61..015f5d7 100644 --- a/WebKit/chromium/public/WebHistoryItem.h +++ b/WebKit/chromium/public/WebHistoryItem.h @@ -32,17 +32,14 @@ #define WebHistoryItem_h #include "WebCommon.h" +#include "WebPrivatePtr.h" -#if WEBKIT_IMPLEMENTATION namespace WebCore { class HistoryItem; } -namespace WTF { template <typename T> class PassRefPtr; } -#endif namespace WebKit { - -class WebHistoryItemPrivate; class WebHTTPBody; class WebString; +class WebSerializedScriptValue; struct WebPoint; template <typename T> class WebVector; @@ -55,8 +52,8 @@ class WebHistoryItem { public: ~WebHistoryItem() { reset(); } - WebHistoryItem() : m_private(0) { } - WebHistoryItem(const WebHistoryItem& h) : m_private(0) { assign(h); } + WebHistoryItem() { } + WebHistoryItem(const WebHistoryItem& h) { assign(h); } WebHistoryItem& operator=(const WebHistoryItem& h) { assign(h); @@ -67,7 +64,7 @@ public: WEBKIT_API void reset(); WEBKIT_API void assign(const WebHistoryItem&); - bool isNull() const { return !m_private; } + bool isNull() const { return m_private.isNull(); } WEBKIT_API WebString urlString() const; WEBKIT_API void setURLString(const WebString&); @@ -108,6 +105,9 @@ public: WEBKIT_API long long documentSequenceNumber() const; WEBKIT_API void setDocumentSequenceNumber(long long); + WEBKIT_API WebSerializedScriptValue stateObject() const; + WEBKIT_API void setStateObject(const WebSerializedScriptValue&); + WEBKIT_API WebString httpContentType() const; WEBKIT_API void setHTTPContentType(const WebString&); @@ -125,9 +125,8 @@ public: #endif private: - void assign(WebHistoryItemPrivate*); void ensureMutable(); - WebHistoryItemPrivate* m_private; + WebPrivatePtr<WebCore::HistoryItem> m_private; }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebIDBCallbacks.h b/WebKit/chromium/public/WebIDBCallbacks.h new file mode 100644 index 0000000..9e85aa8 --- /dev/null +++ b/WebKit/chromium/public/WebIDBCallbacks.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2010 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 WebIDBCallbacks_h +#define WebIDBCallbacks_h + +#include "WebCommon.h" + +namespace WebKit { + +class WebIDBDatabaseError; + +// Every IndexedDB method takes in a pair of callbacks for error/success which +// implement this class. Either 0 or 1 of these methods will be called and the +// callback class may be deleted any time after the callback is called. +template <typename ResultType> +class WebIDBCallbacks { +public: + virtual ~WebIDBCallbacks() { } + + // If the method was a success, this method is called with the result. The + // result is a pointer that the callback takes ownership of. + virtual void onSuccess(ResultType*) = 0; + + // Called in the event of an error. + virtual void onError(const WebIDBDatabaseError&) = 0; +}; + +} // namespace WebKit + +#endif // WebIDBCallbacks_h diff --git a/WebKit/chromium/public/WebIDBDatabase.h b/WebKit/chromium/public/WebIDBDatabase.h new file mode 100644 index 0000000..403b4e8 --- /dev/null +++ b/WebKit/chromium/public/WebIDBDatabase.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2010 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 WebIDBDatabase_h +#define WebIDBDatabase_h + +#include "WebCommon.h" + +namespace WebKit { + +// See comment in WebIndexedDatabase for a high level overview these classes. +class WebIDBDatabase { +public: + virtual ~WebIDBDatabase() { } + + // FIXME: Implement. +}; + +} // namespace WebKit + +#endif // WebIDBDatabase_h diff --git a/WebKit/chromium/public/WebIDBDatabaseError.h b/WebKit/chromium/public/WebIDBDatabaseError.h new file mode 100644 index 0000000..f56a0d0 --- /dev/null +++ b/WebKit/chromium/public/WebIDBDatabaseError.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2010 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 WebIDBDatabaseError_h +#define WebIDBDatabaseError_h + +#include "WebCommon.h" +#include "WebPrivatePtr.h" +#include "WebString.h" + +namespace WebCore { class IDBDatabaseError; } + +namespace WebKit { + +// See comment in WebIndexedDatabase for a high level overview these classes. +class WebIDBDatabaseError { +public: + ~WebIDBDatabaseError(); + + WebIDBDatabaseError(unsigned short code, const WebString& message) { assign(code, message); } + WebIDBDatabaseError(const WebIDBDatabaseError& e) { assign(e); } + WebIDBDatabaseError& operator=(const WebIDBDatabaseError& e) + { + assign(e); + return *this; + } + + WEBKIT_API void assign(const WebIDBDatabaseError&); + + WEBKIT_API unsigned short code() const; + WEBKIT_API WebString message() const; + +#if WEBKIT_IMPLEMENTATION + WebIDBDatabaseError(const WTF::PassRefPtr<WebCore::IDBDatabaseError>&); + WebIDBDatabaseError& operator=(const WTF::PassRefPtr<WebCore::IDBDatabaseError>&); + operator WTF::PassRefPtr<WebCore::IDBDatabaseError>() const; +#endif + +private: + WEBKIT_API void assign(unsigned short code, const WebString& message); + + WebPrivatePtr<WebCore::IDBDatabaseError> m_private; +}; + +} // namespace WebKit + +#endif // WebIDBDatabaseError_h diff --git a/WebKit/chromium/public/WebImageDecoder.h b/WebKit/chromium/public/WebImageDecoder.h new file mode 100644 index 0000000..22db709 --- /dev/null +++ b/WebKit/chromium/public/WebImageDecoder.h @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2010 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 WebImageDecoder_h +#define WebImageDecoder_h + +#include "WebCommon.h" +#include "WebImage.h" +#include "WebNonCopyable.h" + +namespace WebCore { class ImageDecoder; } + +namespace WebKit { + +typedef WebCore::ImageDecoder WebImageDecoderPrivate; +class WebData; + +class WebImageDecoder : public WebNonCopyable { +public: + enum Type { + TypeBMP, + TypeICO + }; + + ~WebImageDecoder() { reset(); } + + explicit WebImageDecoder(Type type) { init(type); } + + // Sets data contents for underlying decoder. All the API methods + // require that setData() is called prior to their use. + WEBKIT_API void setData(const WebData& data, bool allDataReceived); + + // Deletes owned decoder. + WEBKIT_API void reset(); + + // Returns true if image decoding failed. + WEBKIT_API bool isFailed() const; + + // Returns true if size information is available for the decoder. + WEBKIT_API bool isSizeAvailable() const; + + // Returns the size of the image. + WEBKIT_API WebSize size() const; + + // Gives frame count for the image. For multiple frames, decoder scans the image data for the count. + WEBKIT_API size_t frameCount() const; + + // Returns if the frame at given index is completely decoded. + WEBKIT_API bool isFrameCompleteAtIndex(int index) const; + + // Creates and returns WebImage from buffer at the index. + WEBKIT_API WebImage getFrameAtIndex(int index) const; + +private: + // Creates type-specific decoder. + WEBKIT_API void init(Type type); + + WebImageDecoderPrivate* m_private; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebIndexedDatabase.h b/WebKit/chromium/public/WebIndexedDatabase.h new file mode 100644 index 0000000..bb75170 --- /dev/null +++ b/WebKit/chromium/public/WebIndexedDatabase.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2010 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 WebIndexedDatabase_h +#define WebIndexedDatabase_h + +#include "WebCommon.h" +#include "WebIDBCallbacks.h" + +namespace WebKit { + +class WebFrame; +class WebIDBDatabase; +class WebString; + +// The entry point into the IndexedDatabase API. These classes match their _____Request and +// _____Sync counterparts in the spec, but operate only in an async manner. +// http://dev.w3.org/2006/webapi/WebSimpleDB/ +class WebIndexedDatabase { +public: + WEBKIT_API static WebIndexedDatabase* create(); + + virtual ~WebIndexedDatabase() { } + + virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks<WebIDBDatabase>*, WebFrame*, int& exceptionCode) = 0; +}; + +} // namespace WebKit + +#endif // WebIndexedDatabase_h diff --git a/WebKit/chromium/public/WebInputElement.h b/WebKit/chromium/public/WebInputElement.h index 59643d1..0fec63f 100644 --- a/WebKit/chromium/public/WebInputElement.h +++ b/WebKit/chromium/public/WebInputElement.h @@ -31,29 +31,26 @@ #ifndef WebInputElement_h #define WebInputElement_h -#include "WebElement.h" +#include "WebFormControlElement.h" #if WEBKIT_IMPLEMENTATION namespace WebCore { class HTMLInputElement; } -namespace WTF { template <typename T> class PassRefPtr; } #endif namespace WebKit { // Provides readonly access to some properties of a DOM input element node. - class WebInputElement : public WebElement { + class WebInputElement : public WebFormControlElement { public: - WebInputElement() : WebElement() { } - WebInputElement(const WebInputElement& n) : WebElement(n) { } + WebInputElement() : WebFormControlElement() { } + WebInputElement(const WebInputElement& e) : WebFormControlElement(e) { } - WebInputElement& operator=(const WebInputElement& n) { WebElement::assign(n); return *this; } - WEBKIT_API void assign(const WebInputElement& n) { WebElement::assign(n); } - -#if WEBKIT_IMPLEMENTATION - WebInputElement(const WTF::PassRefPtr<WebCore::HTMLInputElement>&); - WebInputElement& operator=(const WTF::PassRefPtr<WebCore::HTMLInputElement>&); - operator WTF::PassRefPtr<WebCore::HTMLInputElement>() const; -#endif + WebInputElement& operator=(const WebInputElement& e) + { + WebFormControlElement::assign(e); + return *this; + } + WEBKIT_API void assign(const WebInputElement& e) { WebFormControlElement::assign(e); } enum InputType { Text = 0, @@ -85,7 +82,7 @@ namespace WebKit { WEBKIT_API bool autoComplete() const; WEBKIT_API bool isEnabledFormControl() const; WEBKIT_API InputType inputType() const; - WEBKIT_API WebString formControlType() const; + WEBKIT_API int maxLength() const; WEBKIT_API bool isActivatedSubmit() const; WEBKIT_API void setActivatedSubmit(bool); WEBKIT_API void setValue(const WebString& value); @@ -93,11 +90,18 @@ namespace WebKit { WEBKIT_API void setAutofilled(bool); WEBKIT_API void dispatchFormControlChangeEvent(); WEBKIT_API void setSelectionRange(int, int); + // DEPRECATED: The following two methods have been moved to WebFormControlElement. WEBKIT_API WebString name() const; // Returns the name that should be used for the specified |element| when - // storing autofill data. This is either the field name or its id, an empty - // string if it has no name and no id. + // storing AutoFill data. This is either the field name or its id, an + // empty string if it has no name and no id. WEBKIT_API WebString nameForAutofill() const; + +#if WEBKIT_IMPLEMENTATION + WebInputElement(const WTF::PassRefPtr<WebCore::HTMLInputElement>&); + WebInputElement& operator=(const WTF::PassRefPtr<WebCore::HTMLInputElement>&); + operator WTF::PassRefPtr<WebCore::HTMLInputElement>() const; +#endif }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebInputEvent.h b/WebKit/chromium/public/WebInputEvent.h index 983aa2a..2ac7475 100644 --- a/WebKit/chromium/public/WebInputEvent.h +++ b/WebKit/chromium/public/WebInputEvent.h @@ -32,6 +32,7 @@ #define WebInputEvent_h #include "WebCommon.h" +#include "WebTouchPoint.h" #include <string.h> @@ -96,7 +97,13 @@ public: RawKeyDown, KeyDown, KeyUp, - Char + Char, + + // WebTouchEvent + TouchStart, + TouchMove, + TouchEnd, + TouchCancel, }; enum Modifiers { @@ -121,6 +128,16 @@ public: int modifiers; double timeStampSeconds; // Seconds since epoch. + // Returns true if the WebInputEvent |type| is a mouse event. + static bool isMouseEventType(int type) + { + return type == MouseDown + || type == MouseUp + || type == MouseMove + || type == MouseEnter + || type == MouseLeave; + } + // Returns true if the WebInputEvent |type| is a keyboard event. static bool isKeyboardEventType(int type) { @@ -129,6 +146,15 @@ public: || type == KeyUp || type == Char; } + + // Returns true if the WebInputEvent |type| is a touch event. + static bool isTouchEventType(int type) + { + return type == TouchStart + || type == TouchMove + || type == TouchEnd + || type == TouchCancel; + } }; // WebKeyboardEvent ----------------------------------------------------------- @@ -255,6 +281,22 @@ public: } }; +// WebTouchEvent -------------------------------------------------------------- + +class WebTouchEvent : public WebInputEvent { +public: + static const int touchPointsLengthCap = 4; + + int touchPointsLength; + WebTouchPoint touchPoints[touchPointsLengthCap]; + + WebTouchEvent(unsigned sizeParam = sizeof(WebTouchEvent)) + : WebInputEvent(sizeParam) + , touchPointsLength(0) + { + } +}; + } // namespace WebKit #endif diff --git a/WebKit/chromium/public/WebKitClient.h b/WebKit/chromium/public/WebKitClient.h index c5a04b2..38b131d 100644 --- a/WebKit/chromium/public/WebKitClient.h +++ b/WebKit/chromium/public/WebKitClient.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2010 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 @@ -36,7 +36,6 @@ #include "WebLocalizedString.h" #include "WebString.h" #include "WebURL.h" -#include "WebVector.h" #include <time.h> @@ -50,6 +49,9 @@ class WebApplicationCacheHost; class WebApplicationCacheHostClient; class WebClipboard; class WebCookieJar; +class WebGLES2Context; +class WebGraphicsContext3D; +class WebIndexedDatabase; class WebMessagePortChannel; class WebMimeRegistry; class WebPluginListBuilder; @@ -59,8 +61,6 @@ class WebSocketStreamHandle; class WebStorageNamespace; class WebThemeEngine; class WebURLLoader; -struct WebCookie; -template <typename T> class WebVector; class WebKitClient { public: @@ -80,12 +80,6 @@ public: virtual WebCookieJar* cookieJar() { return 0; } - // Application Cache -------------------------------------------- - - // May return null if the process type doesn't involve appcaching. - virtual WebApplicationCacheHost* createApplicationCacheHost(WebApplicationCacheHostClient*) { return 0; } - - // DOM Storage -------------------------------------------------- // Return a LocalStorage namespace that corresponds to the following path. @@ -109,7 +103,7 @@ public: virtual bool deleteFile(const WebString& path) { return false; } virtual bool deleteEmptyDirectory(const WebString& path) { return false; } virtual bool getFileSize(const WebString& path, long long& result) { return false; } - virtual bool getFileModificationTime(const WebString& path, time_t& result) { return false; } + virtual bool getFileModificationTime(const WebString& path, double& result) { return false; } virtual WebString directoryName(const WebString& path) { return WebString(); } virtual WebString pathByAppendingComponent(const WebString& path, const WebString& component) { return WebString(); } virtual bool makeAllDirectories(const WebString& path) { return false; } @@ -130,7 +124,7 @@ public: virtual bool isLinkVisited(unsigned long long linkHash) { return false; } - // Database ------------------------------------------------------------ + // HTML5 Database ------------------------------------------------------ #ifdef WIN32 typedef HANDLE FileHandle; @@ -153,6 +147,11 @@ public: virtual long long databaseGetFileSize(const WebString& vfsFileName) { return 0; } + // Indexed Database ---------------------------------------------------- + + virtual WebIndexedDatabase* indexedDatabase() { return 0; } + + // Keygen -------------------------------------------------------------- // Handle the <keygen> tag for generating client certificates @@ -181,13 +180,6 @@ public: // Network ------------------------------------------------------------- - // These cookie methods are DEPRECATED in favor of cookieJar accessor. - virtual void setCookies(const WebURL&, const WebURL& firstPartyForCookies, const WebString& cookies) { } - virtual WebString cookies(const WebURL&, const WebURL& firstPartyForCookies) { return WebString(); } - virtual bool rawCookies(const WebURL&, const WebURL& firstPartyForCookies, WebVector<WebCookie>*) { return false; } - virtual void deleteCookie(const WebURL&, const WebString& cookieName) { } - virtual bool cookiesEnabled(const WebURL&, const WebURL& firstPartyForCookies) { return true; } - // A suggestion to prefetch IP information for the given hostname. virtual void prefetchHostName(const WebString&) { } @@ -273,6 +265,18 @@ public: // Callable from a background WebKit thread. virtual void callOnMainThread(void (*func)()) { } + // WebGL -------------------------------------------------------------- + + // May return null if WebGL is not supported. + // Returns newly allocated WebGraphicsContext3D instance. + virtual WebGraphicsContext3D* createGraphicsContext3D() { return 0; } + + // GLES2 -------------------------------------------------------------- + + // Returns newly allocated WebGLES2Context instance. + // May return null if it fails to create the context. + virtual WebGLES2Context* createGLES2Context() { return 0; } + protected: ~WebKitClient() { } }; diff --git a/WebKit/chromium/public/WebLabelElement.h b/WebKit/chromium/public/WebLabelElement.h new file mode 100644 index 0000000..3e97c39 --- /dev/null +++ b/WebKit/chromium/public/WebLabelElement.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2010 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 WebLabelElement_h +#define WebLabelElement_h + +#include "WebElement.h" + +#if WEBKIT_IMPLEMENTATION +namespace WebCore { class HTMLLabelElement; } +namespace WTF { template <typename T> class PassRefPtr; } +#endif + +namespace WebKit { + +// Provides readonly access to some properties of a DOM label element node. +class WebLabelElement : public WebElement { +public: + WebLabelElement() : WebElement() { } + WebLabelElement(const WebLabelElement& e) : WebElement(e) { } + + WebLabelElement& operator=(const WebLabelElement& e) + { + WebElement::assign(e); + return *this; + } + + WEBKIT_API void assign(const WebLabelElement& e) { WebElement::assign(e); } + + WEBKIT_API WebElement correspondingControl(); + +#if WEBKIT_IMPLEMENTATION + WebLabelElement(const WTF::PassRefPtr<WebCore::HTMLLabelElement>&); + WebLabelElement& operator=(const WTF::PassRefPtr<WebCore::HTMLLabelElement>&); + operator WTF::PassRefPtr<WebCore::HTMLLabelElement>() const; +#endif +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebMediaPlayerAction.h b/WebKit/chromium/public/WebMediaPlayerAction.h index 3aede25..192704f 100644 --- a/WebKit/chromium/public/WebMediaPlayerAction.h +++ b/WebKit/chromium/public/WebMediaPlayerAction.h @@ -38,7 +38,8 @@ struct WebMediaPlayerAction { Unknown, Play, Mute, - Loop + Loop, + Controls }; Type type; diff --git a/WebKit/chromium/public/WebNode.h b/WebKit/chromium/public/WebNode.h index 4d2a0e9..5a87da0 100644 --- a/WebKit/chromium/public/WebNode.h +++ b/WebKit/chromium/public/WebNode.h @@ -32,12 +32,10 @@ #define WebNode_h #include "WebCommon.h" +#include "WebPrivatePtr.h" #include "WebString.h" namespace WebCore { class Node; } -#if WEBKIT_IMPLEMENTATION -namespace WTF { template <typename T> class PassRefPtr; } -#endif namespace WebKit { class WebDocument; @@ -51,8 +49,8 @@ class WebNode { public: virtual ~WebNode() { reset(); } - WebNode() : m_private(0) { } - WebNode(const WebNode& n) : m_private(0) { assign(n); } + WebNode() { } + WebNode(const WebNode& n) { assign(n); } WebNode& operator=(const WebNode& n) { assign(n); @@ -62,13 +60,9 @@ public: WEBKIT_API void reset(); WEBKIT_API void assign(const WebNode&); - bool isNull() const { return !m_private; } + WEBKIT_API bool equals(const WebNode&) const; -#if WEBKIT_IMPLEMENTATION - WebNode(const WTF::PassRefPtr<WebCore::Node>&); - WebNode& operator=(const WTF::PassRefPtr<WebCore::Node>&); - operator WTF::PassRefPtr<WebCore::Node>() const; -#endif + bool isNull() const { return m_private.isNull(); } enum NodeType { ElementNode = 1, @@ -104,7 +98,10 @@ public: WEBKIT_API bool isElementNode() const; WEBKIT_API void addEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture); WEBKIT_API void removeEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture); + WEBKIT_API void simulateClick(); + WEBKIT_API WebNodeList getElementsByTagName(const WebString&) const; + // Deprecated. Use to() instead. template<typename T> T toElement() { T res; @@ -112,6 +109,7 @@ public: return res; } + // Deprecated. Use toConst() instead. template<typename T> const T toConstElement() const { T res; @@ -119,22 +117,52 @@ public: return res; } + template<typename T> T to() + { + T res; + res.WebNode::assign(*this); + return res; + } + + template<typename T> const T toConst() const + { + T res; + res.WebNode::assign(*this); + return res; + } + +#if WEBKIT_IMPLEMENTATION + WebNode(const WTF::PassRefPtr<WebCore::Node>&); + WebNode& operator=(const WTF::PassRefPtr<WebCore::Node>&); + operator WTF::PassRefPtr<WebCore::Node>() const; +#endif + protected: - typedef WebCore::Node WebNodePrivate; - void assign(WebNodePrivate*); - WebNodePrivate* m_private; - +#if WEBKIT_IMPLEMENTATION template<typename T> T* unwrap() { - return static_cast<T*>(m_private); + return static_cast<T*>(m_private.get()); } template<typename T> const T* constUnwrap() const { - return static_cast<const T*>(m_private); + return static_cast<const T*>(m_private.get()); } +#endif + + WebPrivatePtr<WebCore::Node> m_private; }; +inline bool operator==(const WebNode& a, const WebNode& b) +{ + return a.equals(b); +} + +inline bool operator!=(const WebNode& a, const WebNode& b) +{ + return !(a == b); +} + } // namespace WebKit #endif diff --git a/WebKit/chromium/public/WebNotification.h b/WebKit/chromium/public/WebNotification.h index 1a41252..9d64e2a 100644 --- a/WebKit/chromium/public/WebNotification.h +++ b/WebKit/chromium/public/WebNotification.h @@ -71,8 +71,7 @@ public: // If HTML, the URL which contains the contents of the notification. WEBKIT_API WebURL url() const; - // If not HTML, the parameters for the icon-title-text notification. - WEBKIT_API WebString icon() const; + WEBKIT_API WebURL iconURL() const; WEBKIT_API WebString title() const; WEBKIT_API WebString body() const; diff --git a/WebKit/chromium/public/WebNotificationPresenter.h b/WebKit/chromium/public/WebNotificationPresenter.h index a3764aa..9fb7e6e 100644 --- a/WebKit/chromium/public/WebNotificationPresenter.h +++ b/WebKit/chromium/public/WebNotificationPresenter.h @@ -31,13 +31,14 @@ #ifndef WebNotificationPresenter_h #define WebNotificationPresenter_h +#include "WebNotificationPermissionCallback.h" +#include "WebSecurityOrigin.h" #include "WebString.h" namespace WebKit { class WebDocument; class WebNotification; -class WebNotificationPermissionCallback; class WebURL; // Provides the services to show desktop notifications to the user. @@ -59,14 +60,13 @@ public: // being destroyed. Does _not_ remove the notification if being shown, but detaches it from receiving events. virtual void objectDestroyed(const WebNotification&) = 0; - // Checks the permission level for the given URL. If the URL is being displayed in a document - // (as opposed to a worker or other ScriptExecutionContext), |document| will also be provided. - virtual Permission checkPermission(const WebURL& url, WebDocument* document) = 0; + // Checks the permission level for the given origin. + virtual Permission checkPermission(const WebURL&) = 0; // Requests permission for a given origin. This operation is asynchronous and the callback provided // will be invoked when the permission decision is made. Callback pointer must remain // valid until called. - virtual void requestPermission(const WebString& origin, WebNotificationPermissionCallback* callback) = 0; + virtual void requestPermission(const WebSecurityOrigin&, WebNotificationPermissionCallback*) = 0; }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebPlugin.h b/WebKit/chromium/public/WebPlugin.h index 5097265..f57c621 100644 --- a/WebKit/chromium/public/WebPlugin.h +++ b/WebKit/chromium/public/WebPlugin.h @@ -80,6 +80,19 @@ public: virtual void didFailLoadingFrameRequest( const WebURL&, void* notifyData, const WebURLError&) = 0; + // Printing interface. + // Whether the plugin supports its own paginated print. The other print + // interface methods are called only if this method returns true. + virtual bool supportsPaginatedPrint() { return false; } + // Sets up printing at the given print rect and printer DPI. printableArea + // is in points (a point is 1/72 of an inch).Returns the number of pages to + // be printed at these settings. + virtual int printBegin(const WebRect& printableArea, int printerDPI) { return 0; } + // Prints the page specified by pageNumber (0-based index) into the supplied canvas. + virtual bool printPage(int pageNumber, WebCanvas* canvas) { return false; } + // Ends the print operation. + virtual void printEnd() { } + protected: ~WebPlugin() { } }; diff --git a/WebKit/chromium/public/WebPluginDocument.h b/WebKit/chromium/public/WebPluginDocument.h new file mode 100644 index 0000000..b772cf7 --- /dev/null +++ b/WebKit/chromium/public/WebPluginDocument.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2010 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 WebPluginDocument_h +#define WebPluginDocument_h + +#include "WebDocument.h" + +#if WEBKIT_IMPLEMENTATION +namespace WebCore { class PluginDocument; } +#endif + +namespace WebKit { +class WebPlugin; + +// Wraps a WebDocument for full page plugins. +class WebPluginDocument : public WebDocument { +public: + WebPluginDocument() { } + WebPluginDocument(const WebPluginDocument& e) : WebDocument(e) { } + + WebPluginDocument& operator=(const WebPluginDocument& e) + { + WebNode::assign(e); + return *this; + } + void assign(const WebPluginDocument& d) { WebNode::assign(d); } + + WEBKIT_API WebPlugin* plugin(); + +#if WEBKIT_IMPLEMENTATION + WebPluginDocument(const WTF::PassRefPtr<WebCore::PluginDocument>&); + WebPluginDocument& operator=(const WTF::PassRefPtr<WebCore::PluginDocument>&); + operator WTF::PassRefPtr<WebCore::PluginDocument>() const; +#endif +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebPoint.h b/WebKit/chromium/public/WebPoint.h index d1abe02..20c52c2 100644 --- a/WebKit/chromium/public/WebPoint.h +++ b/WebKit/chromium/public/WebPoint.h @@ -36,7 +36,7 @@ #if WEBKIT_IMPLEMENTATION #include "IntPoint.h" #else -#include <base/gfx/rect.h> +#include <gfx/point.h> #endif namespace WebKit { diff --git a/WebKit/chromium/public/WebPopupMenuInfo.h b/WebKit/chromium/public/WebPopupMenuInfo.h index 876842d..7eb132e 100644 --- a/WebKit/chromium/public/WebPopupMenuInfo.h +++ b/WebKit/chromium/public/WebPopupMenuInfo.h @@ -41,6 +41,7 @@ struct WebPopupMenuInfo { // FIXME: migrate clients to WebMenuItemInfo and remove this temporary Item typedef. typedef WebMenuItemInfo Item; int itemHeight; + int itemFontSize; int selectedIndex; WebVector<WebMenuItemInfo> items; }; diff --git a/WebKit/chromium/public/WebPopupType.h b/WebKit/chromium/public/WebPopupType.h new file mode 100644 index 0000000..8a546ba --- /dev/null +++ b/WebKit/chromium/public/WebPopupType.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2010 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 WebPopupType_h +#define WebPopupType_h + +namespace WebKit { + +enum WebPopupType { + WebPopupTypeNone, // Not a popup. + WebPopupTypeSelect, // A HTML select (combo-box) popup. + WebPopupTypeSuggestion, // An autofill/autocomplete popup. +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebPrivatePtr.h b/WebKit/chromium/public/WebPrivatePtr.h new file mode 100644 index 0000000..48ad7f2 --- /dev/null +++ b/WebKit/chromium/public/WebPrivatePtr.h @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2010 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 WebPrivatePtr_h +#define WebPrivatePtr_h + +#if WEBKIT_IMPLEMENTATION +#include <wtf/PassRefPtr.h> +#endif + +namespace WebKit { + +// This class is an implementation detail of the WebKit API. It exists +// to help simplify the implementation of WebKit interfaces that merely +// wrap a reference counted WebCore class. +template <typename T> +class WebPrivatePtr { +public: + WebPrivatePtr() : m_ptr(0) { } + ~WebPrivatePtr() { WEBKIT_ASSERT(!m_ptr); } + + bool isNull() const { return !m_ptr; } + +#if WEBKIT_IMPLEMENTATION + WebPrivatePtr(const PassRefPtr<T>& prp) + : m_ptr(prp.releaseRef()) + { + } + + void reset() + { + assign(0); + } + + WebPrivatePtr<T>& operator=(const WebPrivatePtr<T>& other) + { + T* p = other.m_ptr; + if (p) + p->ref(); + assign(p); + return *this; + } + + WebPrivatePtr<T>& operator=(const PassRefPtr<T>& prp) + { + assign(prp.releaseRef()); + return *this; + } + + T* get() const + { + return m_ptr; + } + + T* operator->() const + { + ASSERT(m_ptr); + return m_ptr; + } +#endif + +private: +#if WEBKIT_IMPLEMENTATION + void assign(T* p) + { + // p is already ref'd for us by the caller + if (m_ptr) + m_ptr->deref(); + m_ptr = p; + } +#endif + + T* m_ptr; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebRect.h b/WebKit/chromium/public/WebRect.h index ed5a7d1..30381d7 100644 --- a/WebKit/chromium/public/WebRect.h +++ b/WebKit/chromium/public/WebRect.h @@ -36,7 +36,7 @@ #if WEBKIT_IMPLEMENTATION #include "IntRect.h" #else -#include <base/gfx/rect.h> +#include <gfx/rect.h> #endif namespace WebKit { diff --git a/WebKit/chromium/public/WebRuntimeFeatures.h b/WebKit/chromium/public/WebRuntimeFeatures.h index 04f88c9..40a5952 100644 --- a/WebKit/chromium/public/WebRuntimeFeatures.h +++ b/WebKit/chromium/public/WebRuntimeFeatures.h @@ -68,6 +68,12 @@ public: WEBKIT_API static void enableIndexedDatabase(bool); WEBKIT_API static bool isIndexedDatabaseEnabled(); + WEBKIT_API static void enableWebGL(bool); + WEBKIT_API static bool isWebGLEnabled(); + + WEBKIT_API static void enablePushState(bool); + WEBKIT_API static bool isPushStateEnabled(bool); + private: WebRuntimeFeatures(); }; diff --git a/WebKit/chromium/public/WebSecurityOrigin.h b/WebKit/chromium/public/WebSecurityOrigin.h index 1285b10..76012a1 100644 --- a/WebKit/chromium/public/WebSecurityOrigin.h +++ b/WebKit/chromium/public/WebSecurityOrigin.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2010 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 @@ -42,6 +42,7 @@ namespace WebKit { class WebSecurityOriginPrivate; class WebString; +class WebURL; class WebSecurityOrigin { public: @@ -55,9 +56,9 @@ public: return *this; } - // FIXME: This should return a WebSecurityOrigin, not a pointer to one. - WEBKIT_API static WebSecurityOrigin* createFromDatabaseIdentifier(const WebString& databaseIdentifier); + WEBKIT_API static WebSecurityOrigin createFromDatabaseIdentifier(const WebString& databaseIdentifier); WEBKIT_API static WebSecurityOrigin createFromString(const WebString&); + WEBKIT_API static WebSecurityOrigin create(const WebURL&); WEBKIT_API void reset(); WEBKIT_API void assign(const WebSecurityOrigin&); @@ -71,6 +72,17 @@ public: // The empty WebSecurityOrigin is the least privileged WebSecurityOrigin. WEBKIT_API bool isEmpty() const; + // Returns true if this WebSecurityOrigin can script objects in the given + // SecurityOrigin. For example, call this function before allowing + // script from one security origin to read or write objects from + // another SecurityOrigin. + WEBKIT_API bool canAccess(const WebSecurityOrigin&) const; + + // Returns true if this WebSecurityOrigin can read content retrieved from + // the given URL. For example, call this function before allowing script + // from a given security origin to receive contents from a given URL. + WEBKIT_API bool canRequest(const WebURL&) const; + // Returns a string representation of the WebSecurityOrigin. The empty // WebSecurityOrigin is represented by "null". The representation of a // non-empty WebSecurityOrigin resembles a standard URL. diff --git a/WebKit/chromium/public/WebSecurityPolicy.h b/WebKit/chromium/public/WebSecurityPolicy.h index 8e1ee52..815f471 100644 --- a/WebKit/chromium/public/WebSecurityPolicy.h +++ b/WebKit/chromium/public/WebSecurityPolicy.h @@ -50,6 +50,10 @@ public: // any other URL scheme. WEBKIT_API static void registerURLSchemeAsNoAccess(const WebString&); + // Registers a URL scheme to not generate mixed content warnings when + // included by an HTTPS page. + WEBKIT_API static void registerURLSchemeAsSecure(const WebString&); + // Support for whitelisting access to origins beyond the same-origin policy. WEBKIT_API static void whiteListAccessFromOrigin( const WebURL& sourceOrigin, const WebString& destinationProtocol, diff --git a/WebKit/chromium/public/WebSelectElement.h b/WebKit/chromium/public/WebSelectElement.h new file mode 100644 index 0000000..7bd755b --- /dev/null +++ b/WebKit/chromium/public/WebSelectElement.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2010 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 WebSelectElement_h +#define WebSelectElement_h + +#include "WebFormControlElement.h" + +#if WEBKIT_IMPLEMENTATION +namespace WebCore { class HTMLSelectElement; } +#endif + +namespace WebKit { + +// Provides readonly access to some properties of a DOM select element node. +class WebSelectElement : public WebFormControlElement { +public: + WebSelectElement() : WebFormControlElement() { } + WebSelectElement(const WebSelectElement& e) : WebFormControlElement(e) { } + + WebSelectElement& operator=(const WebSelectElement& e) { WebFormControlElement::assign(e); return *this; } + WEBKIT_API void assign(const WebSelectElement& e) { WebFormControlElement::assign(e); } + + WEBKIT_API void setValue(const WebString&); + WEBKIT_API WebString value(); + +#if WEBKIT_IMPLEMENTATION + WebSelectElement(const WTF::PassRefPtr<WebCore::HTMLSelectElement>&); + WebSelectElement& operator=(const WTF::PassRefPtr<WebCore::HTMLSelectElement>&); + operator WTF::PassRefPtr<WebCore::HTMLSelectElement>() const; +#endif +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebSerializedScriptValue.h b/WebKit/chromium/public/WebSerializedScriptValue.h new file mode 100644 index 0000000..dbcb92a --- /dev/null +++ b/WebKit/chromium/public/WebSerializedScriptValue.h @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2010 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 WebSerializedScriptValue_h +#define WebSerializedScriptValue_h + +#include "WebCommon.h" +#include "WebPrivatePtr.h" + +namespace WebCore { class SerializedScriptValue; } + +namespace WebKit { +class WebString; + +class WebSerializedScriptValue { +public: + ~WebSerializedScriptValue() { reset(); } + + WebSerializedScriptValue() { } + WebSerializedScriptValue(const WebSerializedScriptValue& d) { assign(d); } + WebSerializedScriptValue& operator=(const WebSerializedScriptValue& d) + { + assign(d); + return *this; + } + + WEBKIT_API static WebSerializedScriptValue fromString(const WebString&); + + WEBKIT_API void reset(); + WEBKIT_API void assign(const WebSerializedScriptValue&); + + bool isNull() const { return m_private.isNull(); } + + // Returns a string representation of the WebSerializedScriptValue. + WEBKIT_API WebString toString() const; + +#if WEBKIT_IMPLEMENTATION + WebSerializedScriptValue(const WTF::PassRefPtr<WebCore::SerializedScriptValue>&); + WebSerializedScriptValue& operator=(const WTF::PassRefPtr<WebCore::SerializedScriptValue>&); + operator WTF::PassRefPtr<WebCore::SerializedScriptValue>() const; +#endif + +private: + WebPrivatePtr<WebCore::SerializedScriptValue> m_private; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebSettings.h b/WebKit/chromium/public/WebSettings.h index d3a91d3..6339ded 100644 --- a/WebKit/chromium/public/WebSettings.h +++ b/WebKit/chromium/public/WebSettings.h @@ -69,6 +69,7 @@ public: virtual void setJavaEnabled(bool) = 0; virtual void setAllowScriptsToCloseWindows(bool) = 0; virtual void setUserStyleSheetLocation(const WebURL&) = 0; + virtual void setAuthorAndUserStylesEnabled(bool) = 0; virtual void setUsesPageCache(bool) = 0; virtual void setDownloadableBinaryFontsEnabled(bool) = 0; virtual void setXSSAuditorEnabled(bool) = 0; @@ -76,13 +77,11 @@ public: virtual void setEditableLinkBehaviorNeverLive() = 0; virtual void setFontRenderingModeNormal() = 0; virtual void setShouldPaintCustomScrollbars(bool) = 0; - virtual void setDatabasesEnabled(bool) = 0; virtual void setAllowUniversalAccessFromFileURLs(bool) = 0; virtual void setAllowFileAccessFromFileURLs(bool) = 0; virtual void setTextDirectionSubmenuInclusionBehaviorNeverIncluded() = 0; virtual void setOfflineWebApplicationCacheEnabled(bool) = 0; virtual void setExperimentalWebGLEnabled(bool) = 0; - virtual void setGeolocationEnabled(bool) = 0; virtual void setShowDebugBorders(bool) = 0; protected: diff --git a/WebKit/chromium/public/WebSize.h b/WebKit/chromium/public/WebSize.h index bb88633..a7159b2 100644 --- a/WebKit/chromium/public/WebSize.h +++ b/WebKit/chromium/public/WebSize.h @@ -36,7 +36,7 @@ #if WEBKIT_IMPLEMENTATION #include "IntSize.h" #else -#include <base/gfx/rect.h> +#include <gfx/size.h> #endif namespace WebKit { diff --git a/WebKit/chromium/public/WebStorageArea.h b/WebKit/chromium/public/WebStorageArea.h index 5e2c11c..86f708c 100644 --- a/WebKit/chromium/public/WebStorageArea.h +++ b/WebKit/chromium/public/WebStorageArea.h @@ -36,6 +36,7 @@ namespace WebKit { +class WebFrame; class WebURL; // In WebCore, there's one distinct StorageArea per origin per StorageNamespace. This @@ -66,18 +67,14 @@ public: // Set the value that corresponds to a specific key. Result will either be ResultOK // or some particular error. The value is NOT set when there's an error. url is the // url that should be used if a storage event fires. - virtual void setItem(const WebString& key, const WebString& newValue, const WebURL& url, Result& result, WebString& oldValue) + virtual void setItem(const WebString& key, const WebString& newValue, const WebURL& url, Result& result, WebString& oldValue, WebFrame*) { - bool quotaException = false; - setItem(key, newValue, url, quotaException, oldValue); - result = quotaException ? ResultBlockedByQuota : ResultOK; + setItem(key, newValue, url, result, oldValue); } // FIXME: Remove soon (once Chrome has rolled past this revision). - virtual void setItem(const WebString& key, const WebString& newValue, const WebURL& url, bool& quotaException, WebString& oldValue) + virtual void setItem(const WebString& key, const WebString& newValue, const WebURL& url, Result& result, WebString& oldValue) { - Result result; - setItem(key, newValue, url, result, oldValue); - quotaException = result != ResultOK; + setItem(key, newValue, url, result, oldValue, 0); } // Remove the value associated with a particular key. url is the url that should be used diff --git a/WebKit/chromium/public/WebTouchPoint.h b/WebKit/chromium/public/WebTouchPoint.h new file mode 100644 index 0000000..ddfa26f --- /dev/null +++ b/WebKit/chromium/public/WebTouchPoint.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2010 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 WebTouchPoint_h +#define WebTouchPoint_h + +#include "WebCommon.h" +#include "WebPoint.h" + +namespace WebKit { + +class WebTouchPoint { +public: + WebTouchPoint() + : id(0) + , state(StateUndefined) { } + + enum State { + StateUndefined, + StateReleased, + StatePressed, + StateMoved, + StateStationary, + StateCancelled, + }; + + int id; + State state; + WebPoint screenPosition; + WebPoint position; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebURLResponse.h b/WebKit/chromium/public/WebURLResponse.h index 1dac069..3acacf8 100644 --- a/WebKit/chromium/public/WebURLResponse.h +++ b/WebKit/chromium/public/WebURLResponse.h @@ -123,6 +123,10 @@ public: WEBKIT_API bool wasFetchedViaSPDY() const; WEBKIT_API void setWasFetchedViaSPDY(bool); + // Flag whether this request is part of a multipart response. + WEBKIT_API bool isMultipartPayload() const; + WEBKIT_API void setIsMultipartPayload(bool); + protected: void assign(WebURLResponsePrivate*); diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h index 99125d4..5a043f2 100644 --- a/WebKit/chromium/public/WebView.h +++ b/WebKit/chromium/public/WebView.h @@ -283,6 +283,7 @@ public: // User scripts -------------------------------------------------------- virtual void addUserScript(const WebString& sourceCode, bool runAtStart) = 0; + virtual void addUserStyleSheet(const WebString& sourceCode) = 0; virtual void removeAllUserContent() = 0; // Modal dialog support ------------------------------------------------ diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h index a2de115..c2a96dc 100644 --- a/WebKit/chromium/public/WebViewClient.h +++ b/WebKit/chromium/public/WebViewClient.h @@ -35,6 +35,7 @@ #include "WebEditingAction.h" #include "WebFileChooserCompletion.h" #include "WebFileChooserParams.h" +#include "WebPopupType.h" #include "WebString.h" #include "WebTextAffinity.h" #include "WebTextDirection.h" @@ -46,7 +47,8 @@ class WebAccessibilityObject; class WebDragData; class WebFileChooserCompletion; class WebFrame; -class WebGeolocationServiceInterface; +class WebGeolocationService; +class WebImage; class WebNode; class WebNotificationPresenter; class WebRange; @@ -73,8 +75,12 @@ public: // Create a new WebPopupMenu. In the second form, the client is // responsible for rendering the contents of the popup menu. - virtual WebWidget* createPopupMenu(bool activatable) { return 0; } + virtual WebWidget* createPopupMenu(WebPopupType) { return 0; } virtual WebWidget* createPopupMenu(const WebPopupMenuInfo&) { return 0; } + // Deprecated methods. + virtual WebWidget* createPopupMenu() { return 0; } + virtual WebWidget* createPopupMenu(bool activatable) { return 0; } + // Create a session storage namespace object associated with this WebView. virtual WebStorageNamespace* createSessionStorageNamespace() { return 0; } @@ -219,7 +225,7 @@ public: // Called when a drag-n-drop operation should begin. virtual void startDragging( - const WebPoint& from, const WebDragData&, WebDragOperationsMask) { } + const WebDragData&, WebDragOperationsMask, const WebImage&, const WebPoint&) { } // Called to determine if drag-n-drop operations may initiate a page // navigation. @@ -278,10 +284,17 @@ public: virtual void removeAutofillSuggestions(const WebString& name, const WebString& value) { } + // Informs the browser that the user has selected an AutoFill suggestion + // for a WebNode. |name| and |label| form a key into the set of AutoFill + // profiles. + virtual void didAcceptAutoFillSuggestion(const WebNode&, + const WebString& name, + const WebString& label) { } + // Geolocation --------------------------------------------------------- // Access the embedder API for geolocation services. - virtual WebKit::WebGeolocationServiceInterface* getGeolocationService() { return 0; } + virtual WebKit::WebGeolocationService* geolocationService() { return 0; } protected: ~WebViewClient() { } diff --git a/WebKit/chromium/public/gtk/WebFontInfo.h b/WebKit/chromium/public/gtk/WebFontInfo.h index ad37680..fae792d 100644 --- a/WebKit/chromium/public/gtk/WebFontInfo.h +++ b/WebKit/chromium/public/gtk/WebFontInfo.h @@ -32,6 +32,7 @@ #define WebFontInfo_h #include "../WebCString.h" +#include "../linux/WebFontRenderStyle.h" #include <string.h> #include <unistd.h> @@ -48,6 +49,19 @@ public: // Returns: the font family or an empty string if the request could not be // satisfied. WEBKIT_API static WebCString familyForChars(const WebUChar* characters, size_t numCharacters); + + // Fill out the given WebFontRenderStyle with the user's preferences for + // rendering the given font at the given size. + // family: i.e. "Times New Roman" + // sizeAndStyle: + // 3322222222221111111111 + // 10987654321098765432109876543210 + // +--------------------------------+ + // |..............Size............IB| + // +--------------------------------+ + // I: italic flag + // B: bold flag + WEBKIT_API static void renderStyleForStrike(const char* family, int sizeAndStyle, WebFontRenderStyle* result); }; } // namespace WebKit diff --git a/WebKit/chromium/public/linux/WebFontRenderStyle.h b/WebKit/chromium/public/linux/WebFontRenderStyle.h new file mode 100644 index 0000000..a3b180f --- /dev/null +++ b/WebKit/chromium/public/linux/WebFontRenderStyle.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2010 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 WebFontRenderStyle_h +#define WebFontRenderStyle_h + +#include "../WebCommon.h" + +namespace WebCore { struct FontRenderStyle; } + +namespace WebKit { + +struct WebFontRenderStyle { + // Each of the use* members below can take one of three values: + // 0: off + // 1: on + // 2: no preference expressed + char useBitmaps; // use embedded bitmap strike if possible + char useAutoHint; // use 'auto' hinting (FreeType specific) + char useHinting; // hint glyphs to the pixel grid + char hintStyle; // level of hinting, 0..3 + char useAntiAlias; // antialias glyph shapes + char useSubpixel; // use subpixel antialias + +#ifdef WEBKIT_IMPLEMENTATION + // Translates the members of this struct to a FontRenderStyle + void toFontRenderStyle(WebCore::FontRenderStyle*); +#endif + + void setDefaults(); +}; + +} // namespace WebKit + +#endif // WebFontRenderStyle_h diff --git a/WebKit/chromium/public/linux/WebSandboxSupport.h b/WebKit/chromium/public/linux/WebSandboxSupport.h index 5edceb2..6990abe 100644 --- a/WebKit/chromium/public/linux/WebSandboxSupport.h +++ b/WebKit/chromium/public/linux/WebSandboxSupport.h @@ -36,6 +36,8 @@ namespace WebKit { +struct WebFontRenderStyle; + // Put methods here that are required due to sandbox restrictions. class WebSandboxSupport { public: @@ -49,6 +51,7 @@ public: // Returns a string with the font family on an empty string if the // request cannot be satisfied. virtual WebString getFontFamilyForCharacters(const WebUChar* characters, size_t numCharacters) = 0; + virtual void getRenderStyleForStrike(const char* family, int sizeAndStyle, WebFontRenderStyle* style) = 0; }; } // namespace WebKit |