[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
japhet at chromium.org
japhet at chromium.org
Thu Dec 3 13:30:01 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit f377f0373a9c3edb74d3e06b437abd62eced5e08
Author: japhet at chromium.org <japhet at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 9 21:28:45 2009 +0000
2009-11-09 Nate Chapin <japhet at chromium.org>
Reviewed by Dimitri Glazkov.
Upstream remainder of WebE*.h and WebF*.h Chromium API headers.
https://bugs.webkit.org/show_bug.cgi?id=28394
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 9f3a648..d8ee176 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -2,6 +2,73 @@
Reviewed by Dimitri Glazkov.
+ Upstream remainder of WebE*.h and WebF*.h Chromium API headers.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28394
+
+ * public/WebEditingAction.h: Added.
+ (WebKit::):
+ * public/WebFileChooserCompletion.h: Added.
+ (WebKit::WebFileChooserCompletion::~WebFileChooserCompletion):
+ * public/WebFindOptions.h: Added.
+ (WebKit::WebFindOptions::WebFindOptions):
+ * public/WebFontCache.h: Added.
+ * public/WebFrame.h: Added.
+ (WebKit::WebFrame::~WebFrame):
+ * public/WebFrameClient.h: Added.
+ (WebKit::WebFrameClient::createPlugin):
+ (WebKit::WebFrameClient::createWorker):
+ (WebKit::WebFrameClient::createSharedWorker):
+ (WebKit::WebFrameClient::createMediaPlayer):
+ (WebKit::WebFrameClient::willClose):
+ (WebKit::WebFrameClient::loadURLExternally):
+ (WebKit::WebFrameClient::decidePolicyForNavigation):
+ (WebKit::WebFrameClient::canHandleRequest):
+ (WebKit::WebFrameClient::cannotHandleRequestError):
+ (WebKit::WebFrameClient::cancelledError):
+ (WebKit::WebFrameClient::unableToImplementPolicyWithError):
+ (WebKit::WebFrameClient::willSubmitForm):
+ (WebKit::WebFrameClient::willPerformClientRedirect):
+ (WebKit::WebFrameClient::didCancelClientRedirect):
+ (WebKit::WebFrameClient::didCompleteClientRedirect):
+ (WebKit::WebFrameClient::didCreateDataSource):
+ (WebKit::WebFrameClient::didStartProvisionalLoad):
+ (WebKit::WebFrameClient::didReceiveServerRedirectForProvisionalLoad):
+ (WebKit::WebFrameClient::didFailProvisionalLoad):
+ (WebKit::WebFrameClient::didReceiveDocumentData):
+ (WebKit::WebFrameClient::didCommitProvisionalLoad):
+ (WebKit::WebFrameClient::didClearWindowObject):
+ (WebKit::WebFrameClient::didCreateDocumentElement):
+ (WebKit::WebFrameClient::didReceiveTitle):
+ (WebKit::WebFrameClient::didFinishDocumentLoad):
+ (WebKit::WebFrameClient::didHandleOnloadEvents):
+ (WebKit::WebFrameClient::didFailLoad):
+ (WebKit::WebFrameClient::didFinishLoad):
+ (WebKit::WebFrameClient::didChangeLocationWithinPage):
+ (WebKit::WebFrameClient::didUpdateCurrentHistoryItem):
+ (WebKit::WebFrameClient::assignIdentifierToRequest):
+ (WebKit::WebFrameClient::willSendRequest):
+ (WebKit::WebFrameClient::didReceiveResponse):
+ (WebKit::WebFrameClient::didFinishResourceLoad):
+ (WebKit::WebFrameClient::didFailResourceLoad):
+ (WebKit::WebFrameClient::didLoadResourceFromMemoryCache):
+ (WebKit::WebFrameClient::didDisplayInsecureContent):
+ (WebKit::WebFrameClient::didRunInsecureContent):
+ (WebKit::WebFrameClient::allowScript):
+ (WebKit::WebFrameClient::didExhaustMemoryAvailableForScript):
+ (WebKit::WebFrameClient::didCreateScriptContext):
+ (WebKit::WebFrameClient::didDestroyScriptContext):
+ (WebKit::WebFrameClient::didCreateIsolatedScriptContext):
+ (WebKit::WebFrameClient::didChangeContentsSize):
+ (WebKit::WebFrameClient::didChangeScrollOffset):
+ (WebKit::WebFrameClient::reportFindInPageMatchCount):
+ (WebKit::WebFrameClient::reportFindInPageSelection):
+ (WebKit::WebFrameClient::~WebFrameClient):
+
+2009-11-09 Nate Chapin <japhet at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
Upstream WebDevTools*.h and WebDrag*.h Chromium API headers.
https://bugs.webkit.org/show_bug.cgi?id=28394
diff --git a/WebKit/chromium/public/WebEditingAction.h b/WebKit/chromium/public/WebEditingAction.h
new file mode 100644
index 0000000..4e76100
--- /dev/null
+++ b/WebKit/chromium/public/WebEditingAction.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebEditingAction_h
+#define WebEditingAction_h
+
+namespace WebKit {
+
+enum WebEditingAction {
+ WebEditingActionTyped,
+ WebEditingActionPasted,
+ WebEditingActionDropped,
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebFileChooserCompletion.h b/WebKit/chromium/public/WebFileChooserCompletion.h
new file mode 100644
index 0000000..14bace4
--- /dev/null
+++ b/WebKit/chromium/public/WebFileChooserCompletion.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebFileChooserCompletion_h
+#define WebFileChooserCompletion_h
+
+namespace WebKit {
+
+class WebString;
+template <typename T> class WebVector;
+
+// Gets called back when WebViewClient finished choosing a file.
+class WebFileChooserCompletion {
+public:
+ // Called with zero or more file names. Zero-lengthed vector means that
+ // the user cancelled or that file choosing failed. The callback instance
+ // is destroyed when this method is called.
+ virtual void didChooseFile(const WebVector<WebString>& fileNames) = 0;
+protected:
+ virtual ~WebFileChooserCompletion() {}
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebFindOptions.h b/WebKit/chromium/public/WebFindOptions.h
new file mode 100644
index 0000000..93d48d3
--- /dev/null
+++ b/WebKit/chromium/public/WebFindOptions.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebFindOptions_h
+#define WebFindOptions_h
+
+#include "WebString.h"
+
+namespace WebKit {
+
+// Options used when performing a find-in-page query.
+struct WebFindOptions {
+ // Whether to search forward or backward within the page.
+ bool forward;
+
+ // Whether search should be case-sensitive.
+ bool matchCase;
+
+ // Whether this operation is the first request or a follow-up.
+ bool findNext;
+
+ WebFindOptions()
+ : forward(true)
+ , matchCase(false)
+ , findNext(false) { }
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebFontCache.h b/WebKit/chromium/public/WebFontCache.h
new file mode 100644
index 0000000..05aadc7
--- /dev/null
+++ b/WebKit/chromium/public/WebFontCache.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebFontCache_h
+#define WebFontCache_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+
+// An interface to query and configure WebKit's font cache.
+class WebFontCache {
+public:
+ // Returns the number of items in the font data cache.
+ WEBKIT_API static size_t fontDataCount();
+
+ // Returns the number of inactive items in the font data cache.
+ WEBKIT_API static size_t inactiveFontDataCount();
+
+ // Clears the cache.
+ WEBKIT_API static void clear();
+
+private:
+ WebFontCache(); // Not intended to be instanced.
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h
new file mode 100644
index 0000000..0a3ed00
--- /dev/null
+++ b/WebKit/chromium/public/WebFrame.h
@@ -0,0 +1,464 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebFrame_h
+#define WebFrame_h
+
+#include "WebCanvas.h"
+#include "WebURL.h"
+
+struct NPObject;
+
+#if WEBKIT_USING_V8
+namespace v8 {
+class Context;
+template <class T> class Local;
+}
+#endif
+
+namespace WebKit {
+
+class WebData;
+class WebDataSource;
+class WebFormElement;
+class WebHistoryItem;
+class WebInputElement;
+class WebPasswordAutocompleteListener;
+class WebRange;
+class WebSecurityOrigin;
+class WebString;
+class WebURL;
+class WebURLRequest;
+class WebView;
+struct WebConsoleMessage;
+struct WebFindOptions;
+struct WebRect;
+struct WebScriptSource;
+struct WebSize;
+template <typename T> class WebVector;
+
+class WebFrame {
+public:
+ // The two functions below retrieve the WebFrame instances relating the
+ // currently executing JavaScript. Since JavaScript can make function
+ // calls across frames, though, we need to be more precise.
+ //
+ // For example, imagine that a JS function in frame A calls a function
+ // in frame B, which calls native code, which wants to know what the
+ // 'active' frame is.
+ //
+ // The 'entered context' is the context where execution first entered
+ // the script engine; the context that is at the bottom of the JS
+ // function stack. frameForEnteredContext() would return frame A in
+ // our example.
+ //
+ // The 'current context' is the context the JS engine is currently
+ // inside of; the context that is at the top of the JS function stack.
+ // frameForCurrentContext() would return frame B in our example.
+ WEBKIT_API static WebFrame* frameForEnteredContext();
+ WEBKIT_API static WebFrame* frameForCurrentContext();
+
+
+ // Basic properties ---------------------------------------------------
+
+ // The name of this frame.
+ virtual WebString name() const = 0;
+
+ // The url of the document loaded in this frame. This is equivalent to
+ // dataSource()->request().url().
+ virtual WebURL url() const = 0;
+
+ // The url of the favicon (if any) specified by the document loaded in
+ // this frame.
+ virtual WebURL favIconURL() const = 0;
+
+ // The url of the OpenSearch Desription Document (if any) specified by
+ // the document loaded in this frame.
+ virtual WebURL openSearchDescriptionURL() const = 0;
+
+
+ // Geometry -----------------------------------------------------------
+
+ // NOTE: These routines do not force page layout so their results may
+ // not be accurate if the page layout is out-of-date.
+
+ // The scroll offset from the top-left corner of the frame in pixels.
+ virtual WebSize scrollOffset() const = 0;
+
+ // The size of the contents area.
+ virtual WebSize contentsSize() const = 0;
+
+ // Returns the minimum preferred width of the content contained in the
+ // current document.
+ virtual int contentsPreferredWidth() const = 0;
+
+ // Returns true if the contents (minus scrollbars) has non-zero area.
+ virtual bool hasVisibleContent() const = 0;
+
+
+ // Hierarchy ----------------------------------------------------------
+
+ // Returns the containing view.
+ virtual WebView* view() const = 0;
+
+ // Returns the frame that opened this frame or 0 if there is none.
+ virtual WebFrame* opener() const = 0;
+
+ // Returns the parent frame or 0 if this is a top-most frame.
+ virtual WebFrame* parent() const = 0;
+
+ // Returns the top-most frame in the hierarchy containing this frame.
+ virtual WebFrame* top() const = 0;
+
+ // Returns the first/last child frame.
+ virtual WebFrame* firstChild() const = 0;
+ virtual WebFrame* lastChild() const = 0;
+
+ // Returns the next/previous sibling frame.
+ virtual WebFrame* nextSibling() const = 0;
+ virtual WebFrame* previousSibling() const = 0;
+
+ // Returns the next/previous frame in "frame traversal order"
+ // optionally wrapping around.
+ virtual WebFrame* traverseNext(bool wrap) const = 0;
+ virtual WebFrame* traversePrevious(bool wrap) const = 0;
+
+ // Returns the child frame identified by the given name.
+ virtual WebFrame* findChildByName(const WebString& name) const = 0;
+
+ // Returns the child frame identified by the given xpath expression.
+ virtual WebFrame* findChildByExpression(const WebString& xpath) const = 0;
+
+
+ // Content ------------------------------------------------------------
+
+ virtual void forms(WebVector<WebFormElement>&) const = 0;
+
+
+ // Scripting ----------------------------------------------------------
+
+ // Returns the security origin of the current document.
+ virtual WebSecurityOrigin securityOrigin() const = 0;
+
+ // This grants the currently loaded document access to all security
+ // origins (including file URLs). Use with care. The access is
+ // revoked when a new document is loaded into this frame.
+ virtual void grantUniversalAccess() = 0;
+
+ // Returns a NPObject corresponding to this frame's DOMWindow.
+ virtual NPObject* windowObject() const = 0;
+
+ // Binds a NPObject as a property of this frame's DOMWindow.
+ virtual void bindToWindowObject(const WebString& name, NPObject*) = 0;
+
+ // Executes script in the context of the current page.
+ virtual void executeScript(const WebScriptSource&) = 0;
+
+ // Executes script in a new context associated with the frame. The
+ // script gets its own global scope and its own prototypes for
+ // intrinsic JS objects (String, Array, and so-on). It shares the
+ // wrappers for all DOM nodes and DOM constructors. extensionGroup is
+ // an embedder-provided specifier that controls which v8 extensions are
+ // loaded into the new context - see WebKit::registerExtension for the
+ // corresponding specifier.
+ virtual void executeScriptInNewContext(const WebScriptSource* sources,
+ unsigned numSources,
+ int extensionGroup) = 0;
+
+ // Executes JavaScript in a new world associated with the web frame.
+ // The script gets its own global scope and its own prototypes for
+ // intrinsic JavaScript objects (String, Array, and so-on). It also
+ // gets its own wrappers for all DOM nodes and DOM constructors.
+ // extensionGroup is an embedder-provided specifier that controls which
+ // v8 extensions are loaded into the new context - see
+ // WebKit::registerExtension for the corresponding specifier.
+ virtual void executeScriptInIsolatedWorld(
+ int worldId, const WebScriptSource* sources, unsigned numSources,
+ int extensionGroup) = 0;
+
+ // Logs to the console associated with this frame.
+ virtual void addMessageToConsole(const WebConsoleMessage&) = 0;
+
+ // Calls window.gc() if it is defined.
+ virtual void collectGarbage() = 0;
+
+#if WEBKIT_USING_V8
+ // Returns the V8 context for this frame, or an empty handle if there
+ // is none.
+ virtual v8::Local<v8::Context> mainWorldScriptContext() const = 0;
+#endif
+
+
+ // Styling -------------------------------------------------------------
+
+ // Insert the given text as a STYLE element at the beginning of the
+ // document. |elementId| can be empty, but if specified then it is used
+ // as the id for the newly inserted element (replacing an existing one
+ // with the same id, if any).
+ virtual bool insertStyleText(const WebString& styleText,
+ const WebString& elementId) = 0;
+
+
+ // Navigation ----------------------------------------------------------
+
+ // Reload the current document.
+ virtual void reload() = 0;
+
+ // Load the given URL.
+ virtual void loadRequest(const WebURLRequest&) = 0;
+
+ // Load the given history state, corresponding to a back/forward
+ // navigation.
+ virtual void loadHistoryItem(const WebHistoryItem&) = 0;
+
+ // Loads the given data with specific mime type and optional text
+ // encoding. For HTML data, baseURL indicates the security origin of
+ // the document and is used to resolve links. If specified,
+ // unreachableURL is reported via WebDataSource::unreachableURL. If
+ // replace is false, then this data will be loaded as a normal
+ // navigation. Otherwise, the current history item will be replaced.
+ virtual void loadData(const WebData& data,
+ const WebString& mimeType,
+ const WebString& textEncoding,
+ const WebURL& baseURL,
+ const WebURL& unreachableURL = WebURL(),
+ bool replace = false) = 0;
+
+ // This method is short-hand for calling LoadData, where mime_type is
+ // "text/html" and text_encoding is "UTF-8".
+ virtual void loadHTMLString(const WebData& html,
+ const WebURL& baseURL,
+ const WebURL& unreachableURL = WebURL(),
+ bool replace = false) = 0;
+
+ // Returns true if the current frame is busy loading content.
+ virtual bool isLoading() const = 0;
+
+ // Stops any pending loads on the frame and its children.
+ virtual void stopLoading() = 0;
+
+ // Returns the data source that is currently loading. May be null.
+ virtual WebDataSource* provisionalDataSource() const = 0;
+
+ // Returns the data source that is currently loaded.
+ virtual WebDataSource* dataSource() const = 0;
+
+ // Returns the previous history item. Check WebHistoryItem::isNull()
+ // before using.
+ virtual WebHistoryItem previousHistoryItem() const = 0;
+
+ // Returns the current history item. Check WebHistoryItem::isNull()
+ // before using.
+ virtual WebHistoryItem currentHistoryItem() const = 0;
+
+ // View-source rendering mode. Set this before loading an URL to cause
+ // it to be rendered in view-source mode.
+ virtual void enableViewSourceMode(bool) = 0;
+ virtual bool isViewSourceModeEnabled() const = 0;
+
+ // Sets the referrer for the given request to be the specified URL or
+ // if that is null, then it sets the referrer to the referrer that the
+ // frame would use for subresources. NOTE: This method also filters
+ // out invalid referrers (e.g., it is invalid to send a HTTPS URL as
+ // the referrer for a HTTP request).
+ virtual void setReferrerForRequest(WebURLRequest&, const WebURL&) = 0;
+
+ // Called to associate the WebURLRequest with this frame. The request
+ // will be modified to inherit parameters that allow it to be loaded.
+ // This method ends up triggering WebFrameClient::willSendRequest.
+ virtual void dispatchWillSendRequest(WebURLRequest&) = 0;
+
+ // Called from within WebFrameClient::didReceiveDocumentData to commit
+ // data for the frame that will be used to construct the frame's
+ // document.
+ virtual void commitDocumentData(const char* data, size_t length) = 0;
+
+ // Returns the number of registered unload listeners.
+ virtual unsigned unloadListenerCount() const = 0;
+
+ // Returns true if a user gesture is currently being processed.
+ virtual bool isProcessingUserGesture() const = 0;
+
+ // Returns true if this frame is in the process of opening a new frame
+ // with a suppressed opener.
+ virtual bool willSuppressOpenerInNewFrame() const = 0;
+
+
+ // Editing -------------------------------------------------------------
+
+ // Replaces the selection with the given text.
+ virtual void replaceSelection(const WebString& text) = 0;
+
+ virtual void insertText(const WebString& text) = 0;
+
+ virtual void setMarkedText(const WebString& text, unsigned location, unsigned length) = 0;
+ virtual void unmarkText() = 0;
+ virtual bool hasMarkedText() const = 0;
+
+ virtual WebRange markedRange() const = 0;
+
+ // Supports commands like Undo, Redo, Cut, Copy, Paste, SelectAll,
+ // Unselect, etc. See EditorCommand.cpp for the full list of supported
+ // commands.
+ virtual bool executeCommand(const WebString&) = 0;
+ virtual bool executeCommand(const WebString&, const WebString& value) = 0;
+ virtual bool isCommandEnabled(const WebString&) const = 0;
+
+ // Spell-checking support.
+ virtual void enableContinuousSpellChecking(bool) = 0;
+ virtual bool isContinuousSpellCheckingEnabled() const = 0;
+
+
+ // Selection -----------------------------------------------------------
+
+ virtual bool hasSelection() const = 0;
+
+ virtual WebRange selectionRange() const = 0;
+
+ virtual WebString selectionAsText() const = 0;
+ virtual WebString selectionAsMarkup() const = 0;
+
+
+ // 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;
+
+ // 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
+ // not in printing mode.
+ virtual float getPrintPageShrink(int page) = 0;
+
+ // Prints one page, and returns the calculated page shrinking factor
+ // (usually between 1/1.25 and 1/2). Returns 0 if the page number is
+ // invalid or not in printing mode.
+ virtual float printPage(int pageToPrint, WebCanvas*) = 0;
+
+ // Reformats the WebFrame for screen display.
+ virtual void printEnd() = 0;
+
+
+ // Find-in-page --------------------------------------------------------
+
+ // Searches a frame for a given string.
+ //
+ // If a match is found, this function will select it (scrolling down to
+ // make it visible if needed) and fill in selectionRect with the
+ // location of where the match was found (in window coordinates).
+ //
+ // If no match is found, this function clears all tickmarks and
+ // highlighting.
+ //
+ // Returns true if the search string was found, false otherwise.
+ virtual bool find(int identifier,
+ const WebString& searchText,
+ const WebFindOptions& options,
+ bool wrapWithinFrame,
+ WebRect* selectionRect) = 0;
+
+ // Notifies the frame that we are no longer interested in searching.
+ // This will abort any asynchronous scoping effort already under way
+ // (see the function scopeStringMatches for details) and erase all
+ // tick-marks and highlighting from the previous search. If
+ // clearSelection is true, it will also make sure the end state for the
+ // find operation does not leave a selection. This can occur when the
+ // user clears the search string but does not close the find box.
+ virtual void stopFinding(bool clearSelection) = 0;
+
+ // Counts how many times a particular string occurs within the frame.
+ // It also retrieves the location of the string and updates a vector in
+ // the frame so that tick-marks and highlighting can be drawn. This
+ // function does its work asynchronously, by running for a certain
+ // time-slice and then scheduling itself (co-operative multitasking) to
+ // be invoked later (repeating the process until all matches have been
+ // found). This allows multiple frames to be searched at the same time
+ // and provides a way to cancel at any time (see
+ // cancelPendingScopingEffort). The parameter searchText specifies
+ // what to look for and |reset| signals whether this is a brand new
+ // request or a continuation of the last scoping effort.
+ virtual void scopeStringMatches(int identifier,
+ const WebString& searchText,
+ const WebFindOptions& options,
+ bool reset) = 0;
+
+ // Cancels any outstanding requests for scoping string matches on a frame.
+ virtual void cancelPendingScopingEffort() = 0;
+
+ // This function is called on the main frame during the scoping effort
+ // to keep a running tally of the accumulated total match-count for all
+ // frames. After updating the count it will notify the WebViewClient
+ // about the new count.
+ virtual void increaseMatchCount(int count, int identifier) = 0;
+
+ // This function is called on the main frame to reset the total number
+ // of matches found during the scoping effort.
+ virtual void resetMatchCount() = 0;
+
+ // Password autocompletion ---------------------------------------------
+
+ // Registers a listener for the specified user name input element. The
+ // listener will receive notifications for blur and when autocomplete
+ // should be triggered.
+ // The WebFrame becomes the owner of the passed listener.
+ virtual void registerPasswordListener(
+ WebInputElement,
+ WebPasswordAutocompleteListener*) = 0;
+
+ // Utility -------------------------------------------------------------
+
+ // Given a relative URL, returns an absolute URL by resolving the URL
+ // relative to the base URL of the frame's document. This uses the
+ // same algorithm that WebKit uses to resolve hyperlinks found in a
+ // HTML document.
+ virtual WebURL completeURL(const WebString&) const = 0;
+
+ // Returns the contents of this frame as a string. If the text is
+ // longer than maxChars, it will be clipped to that length. WARNING:
+ // This function may be slow depending on the number of characters
+ // retrieved and page complexity. For a typically sized page, expect
+ // it to take on the order of milliseconds.
+ //
+ // If there is room, subframe text will be recursively appended. Each
+ // frame will be separated by an empty line.
+ virtual WebString contentAsText(size_t maxChars) const = 0;
+
+ // Returns HTML text for the contents of this frame. This is generated
+ // from the DOM.
+ virtual WebString contentAsMarkup() const = 0;
+
+protected:
+ ~WebFrame() { }
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebFrameClient.h b/WebKit/chromium/public/WebFrameClient.h
new file mode 100644
index 0000000..297eb62
--- /dev/null
+++ b/WebKit/chromium/public/WebFrameClient.h
@@ -0,0 +1,290 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebFrameClient_h
+#define WebFrameClient_h
+
+#include "WebCommon.h"
+#include "WebNavigationPolicy.h"
+#include "WebNavigationType.h"
+#include "WebURLError.h"
+
+namespace WebKit {
+
+class WebDataSource;
+class WebFormElement;
+class WebFrame;
+class WebMediaPlayer;
+class WebMediaPlayerClient;
+class WebNode;
+class WebPlugin;
+class WebSecurityOrigin;
+class WebSharedWorker;
+class WebString;
+class WebURL;
+class WebURLRequest;
+class WebURLResponse;
+class WebWorker;
+class WebWorkerClient;
+struct WebPluginParams;
+struct WebRect;
+struct WebSize;
+struct WebURLError;
+
+class WebFrameClient {
+public:
+ // Factory methods -----------------------------------------------------
+
+ // May return null.
+ virtual WebPlugin* createPlugin(WebFrame*, const WebPluginParams&) { return 0; }
+
+ // May return null.
+ virtual WebWorker* createWorker(WebFrame*, WebWorkerClient*) { return 0; }
+
+ // May return null.
+ virtual WebSharedWorker* createSharedWorker(WebFrame*, const WebURL&, const WebString&, unsigned long long) { return 0; }
+
+ // May return null.
+ virtual WebMediaPlayer* createMediaPlayer(WebFrame*, WebMediaPlayerClient*) { return 0; }
+
+
+ // General notifications -----------------------------------------------
+
+ // This frame is about to be closed.
+ virtual void willClose(WebFrame*) { }
+
+
+ // Load commands -------------------------------------------------------
+
+ // The client should handle the navigation externally.
+ virtual void loadURLExternally(
+ WebFrame*, const WebURLRequest&, WebNavigationPolicy) { }
+
+
+ // Navigational queries ------------------------------------------------
+
+ // The client may choose to alter the navigation policy. Otherwise,
+ // defaultPolicy should just be returned.
+ virtual WebNavigationPolicy decidePolicyForNavigation(
+ WebFrame*, const WebURLRequest&, WebNavigationType,
+ const WebNode& originatingNode,
+ WebNavigationPolicy defaultPolicy, bool isRedirect) { return defaultPolicy; }
+
+ // Query if the specified request can be handled.
+ virtual bool canHandleRequest(
+ WebFrame*, const WebURLRequest& request) { return true; }
+
+ // Returns an error corresponding to canHandledRequest() returning false.
+ virtual WebURLError cannotHandleRequestError(
+ WebFrame*, const WebURLRequest& request) { return WebURLError(); }
+
+ // Returns an error corresponding to a user cancellation event.
+ virtual WebURLError cancelledError(
+ WebFrame*, const WebURLRequest& request) { return WebURLError(); }
+
+ // Notify that a URL cannot be handled.
+ virtual void unableToImplementPolicyWithError(
+ WebFrame*, const WebURLError&) { }
+
+
+ // Navigational notifications ------------------------------------------
+
+ // A form submission is about to occur.
+ virtual void willSubmitForm(WebFrame*, const WebFormElement&) { }
+
+ // A client-side redirect will occur. This may correspond to a <META
+ // refresh> or some script activity.
+ virtual void willPerformClientRedirect(
+ WebFrame*, const WebURL& from, const WebURL& to,
+ double interval, double fireTime) { }
+
+ // A client-side redirect was cancelled.
+ virtual void didCancelClientRedirect(WebFrame*) { }
+
+ // A client-side redirect completed.
+ virtual void didCompleteClientRedirect(WebFrame*, const WebURL& fromURL) { }
+
+ // A datasource has been created for a new navigation. The given
+ // datasource will become the provisional datasource for the frame.
+ virtual void didCreateDataSource(WebFrame*, WebDataSource*) { }
+
+ // A new provisional load has been started.
+ virtual void didStartProvisionalLoad(WebFrame*) { }
+
+ // The provisional load was redirected via a HTTP 3xx response.
+ virtual void didReceiveServerRedirectForProvisionalLoad(WebFrame*) { }
+
+ // The provisional load failed.
+ virtual void didFailProvisionalLoad(WebFrame*, const WebURLError&) { }
+
+ // Notifies the client to commit data for the given frame. The client
+ // may optionally prevent default processing by setting preventDefault
+ // to true before returning. If default processing is prevented, then
+ // it is up to the client to manually call commitDocumentData on the
+ // WebFrame. It is only valid to call commitDocumentData within a call
+ // to didReceiveDocumentData. If commitDocumentData is not called,
+ // then an empty document will be loaded.
+ virtual void didReceiveDocumentData(
+ WebFrame*, const char* data, size_t length, bool& preventDefault) { }
+
+ // The provisional datasource is now committed. The first part of the
+ // response body has been received, and the encoding of the response
+ // body is known.
+ virtual void didCommitProvisionalLoad(WebFrame*, bool isNewNavigation) { }
+
+ // The window object for the frame has been cleared of any extra
+ // properties that may have been set by script from the previously
+ // loaded document.
+ virtual void didClearWindowObject(WebFrame*) { }
+
+ // The document element has been created.
+ virtual void didCreateDocumentElement(WebFrame*) { }
+
+ // The page title is available.
+ virtual void didReceiveTitle(WebFrame*, const WebString& title) { }
+
+ // The frame's document finished loading.
+ virtual void didFinishDocumentLoad(WebFrame*) { }
+
+ // The 'load' event was dispatched.
+ virtual void didHandleOnloadEvents(WebFrame*) { }
+
+ // The frame's document or one of its subresources failed to load.
+ virtual void didFailLoad(WebFrame*, const WebURLError&) { }
+
+ // The frame's document and all of its subresources succeeded to load.
+ virtual void didFinishLoad(WebFrame*) { }
+
+ // The navigation resulted in scrolling the page to a named anchor instead
+ // of downloading a new document.
+ virtual void didChangeLocationWithinPage(WebFrame*, bool isNewNavigation) { }
+
+ // Called upon update to scroll position, document state, and other
+ // non-navigational events related to the data held by WebHistoryItem.
+ // WARNING: This method may be called very frequently.
+ virtual void didUpdateCurrentHistoryItem(WebFrame*) { }
+
+
+ // Low-level resource notifications ------------------------------------
+
+ // An identifier was assigned to the specified request. The client
+ // should remember this association if interested in subsequent events.
+ virtual void assignIdentifierToRequest(
+ WebFrame*, unsigned identifier, const WebURLRequest&) { }
+
+ // A request is about to be sent out, and the client may modify it. Request
+ // is writable, and changes to the URL, for example, will change the request
+ // made. If this request is the result of a redirect, then redirectResponse
+ // will be non-null and contain the response that triggered the redirect.
+ virtual void willSendRequest(
+ WebFrame*, unsigned identifier, WebURLRequest&,
+ const WebURLResponse& redirectResponse) { }
+
+ // Response headers have been received for the resource request given
+ // by identifier.
+ virtual void didReceiveResponse(
+ WebFrame*, unsigned identifier, const WebURLResponse&) { }
+
+ // The resource request given by identifier succeeded.
+ virtual void didFinishResourceLoad(
+ WebFrame*, unsigned identifier) { }
+
+ // The resource request given by identifier failed.
+ virtual void didFailResourceLoad(
+ WebFrame*, unsigned identifier, const WebURLError&) { }
+
+ // The specified request was satified from WebCore's memory cache.
+ virtual void didLoadResourceFromMemoryCache(
+ WebFrame*, const WebURLRequest&, const WebURLResponse&) { }
+
+ // This frame has displayed inactive content (such as an image) from an
+ // insecure source. Inactive content cannot spread to other frames.
+ virtual void didDisplayInsecureContent(WebFrame*) { }
+
+ // The indicated security origin has run active content (such as a
+ // script) from an insecure source. Note that the insecure content can
+ // spread to other frames in the same origin.
+ virtual void didRunInsecureContent(WebFrame*, const WebSecurityOrigin&) { }
+
+
+ // Script notifications ------------------------------------------------
+
+ // Controls whether scripts are allowed to execute for this frame.
+ virtual bool allowScript(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; }
+
+ // Script in the page tried to allocate too much memory.
+ virtual void didExhaustMemoryAvailableForScript(WebFrame*) { }
+
+ // Notifies that a new script context has been created for this frame.
+ // This is similar to didClearWindowObject but only called once per
+ // frame context.
+ virtual void didCreateScriptContext(WebFrame*) { }
+
+ // Notifies that this frame's script context has been destroyed.
+ virtual void didDestroyScriptContext(WebFrame*) { }
+
+ // Notifies that a garbage-collected context was created - content
+ // scripts.
+ virtual void didCreateIsolatedScriptContext(WebFrame*) { }
+
+
+ // Geometry notifications ----------------------------------------------
+
+ // The size of the content area changed.
+ virtual void didChangeContentsSize(WebFrame*, const WebSize&) { }
+
+ // The main frame scrolled.
+ virtual void didChangeScrollOffset(WebFrame*) { }
+
+
+ // Find-in-page notifications ------------------------------------------
+
+ // Notifies how many matches have been found so far, for a given
+ // identifier. |finalUpdate| specifies whether this is the last update
+ // (all frames have completed scoping).
+ virtual void reportFindInPageMatchCount(
+ int identifier, int count, bool finalUpdate) { }
+
+ // Notifies what tick-mark rect is currently selected. The given
+ // identifier lets the client know which request this message belongs
+ // to, so that it can choose to ignore the message if it has moved on
+ // to other things. The selection rect is expected to have coordinates
+ // relative to the top left corner of the web page area and represent
+ // where on the screen the selection rect is currently located.
+ virtual void reportFindInPageSelection(
+ int identifier, int activeMatchOrdinal, const WebRect& selection) { }
+
+protected:
+ ~WebFrameClient() { }
+};
+
+} // namespace WebKit
+
+#endif
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list