diff options
author | John Reck <jreck@google.com> | 2010-11-04 12:00:17 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2010-11-09 11:35:04 -0800 |
commit | e14391e94c850b8bd03680c23b38978db68687a8 (patch) | |
tree | 3fed87e6620fecaf3edc7259ae58a11662bedcb2 /WebKit/chromium/public | |
parent | 1bd705833a68f07850cf7e204b26f8d328d16951 (diff) | |
download | external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.zip external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.gz external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.bz2 |
Merge Webkit at r70949: Initial merge by git.
Change-Id: I77b8645c083b5d0da8dba73ed01d4014aab9848e
Diffstat (limited to 'WebKit/chromium/public')
20 files changed, 221 insertions, 26 deletions
diff --git a/WebKit/chromium/public/WebExternalPopupMenu.h b/WebKit/chromium/public/WebExternalPopupMenu.h new file mode 100644 index 0000000..49630cf --- /dev/null +++ b/WebKit/chromium/public/WebExternalPopupMenu.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: + * + * * 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 WebExternalPopupMenu_h +#define WebExternalPopupMenu_h + +namespace WebKit { + +struct WebRect; + +class WebExternalPopupMenu { +public: + virtual void show(const WebRect& bounds) = 0; + virtual void close() = 0; +}; + +} // namespace WebKit + +#endif // WebExternalPopupMenu_h diff --git a/WebKit/chromium/public/WebExternalPopupMenuClient.h b/WebKit/chromium/public/WebExternalPopupMenuClient.h new file mode 100644 index 0000000..e01bc2d --- /dev/null +++ b/WebKit/chromium/public/WebExternalPopupMenuClient.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 WebExternalPopupMenuClient_h +#define WebExternalPopupMenuClient_h + +namespace WebKit { + +class WebExternalPopupMenuClient { +public: + // Should be called when the currently selected item in the popup menu + // changed. Can be -1 if there is no selection. + virtual void didChangeSelection(int index) = 0; + + // Should be called when an index has been accepted. + // Note that it is not safe to access this WebExternalPopupClientMenu after + // this has been called as it might not be valid anymore. + virtual void didAcceptIndex(int index) = 0; + + // Should be called when the popup menu was discarded (closed without a + // selection. + // Note that it is not safe to access this WebExternalPopupClientMenu after + // this has been called as it might not be valid anymore. + virtual void didCancel() = 0; +}; + +} // namespace WebKit + +#endif // WebExternalPopupMenuClient_h diff --git a/WebKit/chromium/public/WebFileError.h b/WebKit/chromium/public/WebFileError.h index cfe8882..e7a17c3 100644 --- a/WebKit/chromium/public/WebFileError.h +++ b/WebKit/chromium/public/WebFileError.h @@ -34,15 +34,18 @@ namespace WebKit { // File-related error code defined in HTML5 File API. enum WebFileError { - WebFileErrorNoModificationAllowed = 7, - WebFileErrorNotFound = 8, - WebFileErrorInvalidState = 11, - WebFileErrorInvalidModification = 13, - WebFileErrorSecurity = 18, - WebFileErrorAbort = 20, - WebFileErrorQuotaExceeded = 22, - WebFileErrorNotReadable = 24, - WebFileErrorEncoding = 26, + WebFileErrorNotFound = 1, + WebFileErrorSecurity = 2, + WebFileErrorAbort = 3, + WebFileErrorNotReadable = 4, + WebFileErrorEncoding = 5, + WebFileErrorNoModificationAllowed = 6, + WebFileErrorInvalidState = 7, + WebFileErrorSyntax = 8, + WebFileErrorInvalidModification = 9, + WebFileErrorQuotaExceeded = 10, + WebFileErrorTypeMismatch = 11, + WebFileErrorPathExists = 12, }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebFrameClient.h b/WebKit/chromium/public/WebFrameClient.h index 458604e..c5cfc21 100644 --- a/WebKit/chromium/public/WebFrameClient.h +++ b/WebKit/chromium/public/WebFrameClient.h @@ -355,10 +355,8 @@ public: WebFrame*, WebFileSystem::Type, long long size, bool create, WebFileSystemCallbacks*) { } - // This method will be deleted once chromium uses the new method above. - virtual void openFileSystem( - WebFrame*, WebFileSystem::Type, long long size, - WebFileSystemCallbacks*) { } + // FIXME: This method should be deleted once chromium implements the new method above. + virtual void openFileSystem(WebFrame* frame, WebFileSystem::Type type, long long size, WebFileSystemCallbacks* callbacks) { return openFileSystem(frame, type, size, true, callbacks); } protected: ~WebFrameClient() { } diff --git a/WebKit/chromium/public/WebIDBCursor.h b/WebKit/chromium/public/WebIDBCursor.h index 2e5e98b..98f7a6b 100644 --- a/WebKit/chromium/public/WebIDBCursor.h +++ b/WebKit/chromium/public/WebIDBCursor.h @@ -35,7 +35,7 @@ namespace WebKit { -// See comment in WebIndexedDatabase for a high level overview these classes. +// See comment in WebIDBFactory for a high level overview these classes. class WebIDBCursor { public: virtual ~WebIDBCursor() { } diff --git a/WebKit/chromium/public/WebIDBDatabase.h b/WebKit/chromium/public/WebIDBDatabase.h index c67a117..19096cc 100644 --- a/WebKit/chromium/public/WebIDBDatabase.h +++ b/WebKit/chromium/public/WebIDBDatabase.h @@ -37,7 +37,7 @@ class WebIDBCallbacks; class WebIDBObjectStore; class WebIDBTransaction; -// See comment in WebIndexedDatabase for a high level overview of these classes. +// See comment in WebIDBFactory for a high level overview of these classes. class WebIDBDatabase { public: virtual ~WebIDBDatabase() { } diff --git a/WebKit/chromium/public/WebIDBDatabaseError.h b/WebKit/chromium/public/WebIDBDatabaseError.h index a237d5f..c181f78 100644 --- a/WebKit/chromium/public/WebIDBDatabaseError.h +++ b/WebKit/chromium/public/WebIDBDatabaseError.h @@ -37,7 +37,7 @@ namespace WebCore { class IDBDatabaseError; } namespace WebKit { -// See comment in WebIndexedDatabase for a high level overview these classes. +// See comment in WebIDBFactory for a high level overview these classes. class WebIDBDatabaseError { public: ~WebIDBDatabaseError() { reset(); } diff --git a/WebKit/chromium/public/WebIDBFactory.h b/WebKit/chromium/public/WebIDBFactory.h index c7fbe02..66ceadb 100755 --- a/WebKit/chromium/public/WebIDBFactory.h +++ b/WebKit/chromium/public/WebIDBFactory.h @@ -58,6 +58,8 @@ public: } // The file name that would be used for persisting a given indexed database on the file system. + WEBKIT_API static WebString databaseFileName(const WebSecurityOrigin&); + // FIXME: Remove after roll. WEBKIT_API static WebString databaseFileName(const WebString& name, const WebSecurityOrigin&); }; diff --git a/WebKit/chromium/public/WebIDBIndex.h b/WebKit/chromium/public/WebIDBIndex.h index 7c77878..0c0d79a 100644 --- a/WebKit/chromium/public/WebIDBIndex.h +++ b/WebKit/chromium/public/WebIDBIndex.h @@ -36,7 +36,7 @@ class WebIDBCallbacks; class WebIDBKey; class WebIDBKeyRange; -// See comment in WebIndexedDatabase for a high level overview of these classes. +// See comment in WebIDBFactory for a high level overview of these classes. class WebIDBIndex { public: virtual ~WebIDBIndex() { } diff --git a/WebKit/chromium/public/WebIDBKey.h b/WebKit/chromium/public/WebIDBKey.h index 60d3325..171fe78 100644 --- a/WebKit/chromium/public/WebIDBKey.h +++ b/WebKit/chromium/public/WebIDBKey.h @@ -82,7 +82,6 @@ public: #endif private: - WebPrivatePtr<WebCore::IDBKey> m_private; }; diff --git a/WebKit/chromium/public/WebIDBObjectStore.h b/WebKit/chromium/public/WebIDBObjectStore.h index f5f1473..89dae02 100755 --- a/WebKit/chromium/public/WebIDBObjectStore.h +++ b/WebKit/chromium/public/WebIDBObjectStore.h @@ -38,7 +38,7 @@ namespace WebKit { class WebIDBKeyRange; class WebIDBTransaction; -// See comment in WebIndexedDatabase for a high level overview these classes. +// See comment in WebIDBFactory for a high level overview these classes. class WebIDBObjectStore { public: virtual ~WebIDBObjectStore() { } diff --git a/WebKit/chromium/public/WebIDBTransaction.h b/WebKit/chromium/public/WebIDBTransaction.h index 6a739c3..385dd1e 100644 --- a/WebKit/chromium/public/WebIDBTransaction.h +++ b/WebKit/chromium/public/WebIDBTransaction.h @@ -35,7 +35,7 @@ namespace WebKit { class WebIDBObjectStore; class WebIDBTransactionCallbacks; -// See comment in WebIndexedDatabase for a high level overview of these classes. +// See comment in WebIDBFactory for a high level overview of these classes. class WebIDBTransaction { public: virtual ~WebIDBTransaction() { } diff --git a/WebKit/chromium/public/WebMenuItemInfo.h b/WebKit/chromium/public/WebMenuItemInfo.h index d513e66..445dfb4 100644 --- a/WebKit/chromium/public/WebMenuItemInfo.h +++ b/WebKit/chromium/public/WebMenuItemInfo.h @@ -44,6 +44,15 @@ struct WebMenuItemInfo { Group, Separator, }; + + WebMenuItemInfo() + : type(Option) + , action(0) + , enabled(false) + , checked(false) + { + } + WebString label; Type type; unsigned action; diff --git a/WebKit/chromium/public/WebSecurityOrigin.h b/WebKit/chromium/public/WebSecurityOrigin.h index efcb2e9..a241682 100644 --- a/WebKit/chromium/public/WebSecurityOrigin.h +++ b/WebKit/chromium/public/WebSecurityOrigin.h @@ -100,6 +100,7 @@ public: WebSecurityOrigin(const WTF::PassRefPtr<WebCore::SecurityOrigin>&); WebSecurityOrigin& operator=(const WTF::PassRefPtr<WebCore::SecurityOrigin>&); operator WTF::PassRefPtr<WebCore::SecurityOrigin>() const; + WebCore::SecurityOrigin* get() const; #endif private: diff --git a/WebKit/chromium/public/WebSpeechInputController.h b/WebKit/chromium/public/WebSpeechInputController.h index 5408741..6ed546f 100644 --- a/WebKit/chromium/public/WebSpeechInputController.h +++ b/WebKit/chromium/public/WebSpeechInputController.h @@ -35,7 +35,9 @@ namespace WebKit { +class WebString; struct WebRect; +class WebString; // Provides an embedder API called by WebKit. class WebSpeechInputController { @@ -43,7 +45,7 @@ public: // Starts speech recognition. Speech will get recorded until the endpointer detects silence, // runs to the limit or stopRecording is called. Progress indications and the recognized // text are returned via the listener interface. - virtual bool startRecognition(int requestId, const WebRect&) + virtual bool startRecognition(int requestId, const WebRect& elementRect, const WebString& language, const WebString& grammar) { WEBKIT_ASSERT_NOT_REACHED(); return false; diff --git a/WebKit/chromium/public/WebSpeechInputControllerMock.h b/WebKit/chromium/public/WebSpeechInputControllerMock.h index 9a26235..b4c50a0 100644 --- a/WebKit/chromium/public/WebSpeechInputControllerMock.h +++ b/WebKit/chromium/public/WebSpeechInputControllerMock.h @@ -44,6 +44,10 @@ public: WebSpeechInputListener* listener); virtual ~WebSpeechInputControllerMock() { } + virtual void setMockRecognitionResult(const WebString& result, const WebString& language) = 0; + + // FIXME: this is a fix for a two-sided patch. Delete as soon as the chromium side is patched. + // Chromium patch not uploaded yet, but will depend on http://codereview.chromium.org/3615005/show patch. virtual void setMockRecognitionResult(const WebString& result) = 0; }; diff --git a/WebKit/chromium/public/WebSpeechInputListener.h b/WebKit/chromium/public/WebSpeechInputListener.h index 6dc3d49..091f984 100644 --- a/WebKit/chromium/public/WebSpeechInputListener.h +++ b/WebKit/chromium/public/WebSpeechInputListener.h @@ -31,6 +31,8 @@ #ifndef WebSpeechInputListener_h #define WebSpeechInputListener_h +#include "WebSpeechInputResult.h" + namespace WebKit { class WebString; @@ -47,19 +49,19 @@ public: // WebSpeechInputController::stopRecording() was called. // Typically after this call the listener would update the UI to reflect that recognition is // in progress. - virtual void didCompleteRecording(int) = 0; + virtual void didCompleteRecording(int) { WEBKIT_ASSERT_NOT_REACHED(); } // Gives results from speech recognition, either partial or the final results. // This method can potentially get called multiple times if there are partial results // available as the user keeps speaking. If the speech could not be recognized properly // or if there was any other errors in the process, this method may never be called. - virtual void setRecognitionResult(int, const WebString&) = 0; + virtual void setRecognitionResult(int, const WebSpeechInputResultArray&) { WEBKIT_ASSERT_NOT_REACHED(); } // Informs that speech recognition has completed. This gets invoked irrespective of whether // recognition was succesful or not, whether setRecognitionResult() was invoked or not. The // handler typically frees up any temporary resources allocated and waits for the next speech // recognition request. - virtual void didCompleteRecognition(int) = 0; + virtual void didCompleteRecognition(int) { WEBKIT_ASSERT_NOT_REACHED(); } protected: ~WebSpeechInputListener() { } diff --git a/WebKit/chromium/public/WebSpeechInputResult.h b/WebKit/chromium/public/WebSpeechInputResult.h new file mode 100644 index 0000000..8f1a8f5 --- /dev/null +++ b/WebKit/chromium/public/WebSpeechInputResult.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: + * + * 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. + * + * 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 WebSpeechInputResult_h +#define WebSpeechInputResult_h + +#include "WebCommon.h" +#include "WebPrivatePtr.h" +#include "WebString.h" +#include "WebVector.h" + +namespace WebCore { +class SpeechInputResult; +} + +namespace WebKit { + +// This class holds one speech recognition result including the text and other related +// fields, as received from the embedder. +class WebSpeechInputResult { +public: + WebSpeechInputResult() { } + ~WebSpeechInputResult() { reset(); } + + WEBKIT_API void set(const WebString& utterance, double confidence); + WEBKIT_API void reset(); + +#if WEBKIT_IMPLEMENTATION + WebSpeechInputResult(const WTF::PassRefPtr<WebCore::SpeechInputResult>&); + operator WTF::PassRefPtr<WebCore::SpeechInputResult>() const; +#endif + +private: + WebPrivatePtr<WebCore::SpeechInputResult> m_private; +}; + +typedef WebVector<WebSpeechInputResult> WebSpeechInputResultArray; + +} // namespace WebKit + +#endif // WebSpeechInputResult_h diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h index e504bd7..ce8e512 100644 --- a/WebKit/chromium/public/WebView.h +++ b/WebKit/chromium/public/WebView.h @@ -69,13 +69,13 @@ public: UserContentInjectInAllFrames, UserContentInjectInTopFrameOnly }; - + // Controls which documents user styles are injected into. enum UserStyleInjectionTime { UserStyleInjectInExistingDocuments, UserStyleInjectInSubsequentDocuments }; - + // Initialization ------------------------------------------------------ @@ -315,6 +315,12 @@ public: virtual void performCustomContextMenuAction(unsigned action) = 0; + // Popup menu ---------------------------------------------------------- + + // Sets whether select popup menus should be rendered by the browser. + WEBKIT_API static void setUseExternalPopupMenus(bool); + + // Visited link state -------------------------------------------------- // Tells all WebView instances to update the visited link state for the diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h index 858cb2a..edd9579 100644 --- a/WebKit/chromium/public/WebViewClient.h +++ b/WebKit/chromium/public/WebViewClient.h @@ -48,6 +48,8 @@ class WebAccessibilityObject; class WebDeviceOrientationClient; class WebDragData; class WebElement; +class WebExternalPopupMenu; +class WebExternalPopupMenuClient; class WebFileChooserCompletion; class WebFrame; class WebGeolocationService; @@ -87,6 +89,8 @@ public: // responsible for rendering the contents of the popup menu. virtual WebWidget* createPopupMenu(WebPopupType) { return 0; } virtual WebWidget* createPopupMenu(const WebPopupMenuInfo&) { return 0; } + virtual WebExternalPopupMenu* createExternalPopupMenu( + const WebPopupMenuInfo&, WebExternalPopupMenuClient*) { return 0; } // Create a session storage namespace object associated with this WebView. virtual WebStorageNamespace* createSessionStorageNamespace(unsigned quota) { return 0; } |