summaryrefslogtreecommitdiffstats
path: root/WebKit/wx/WebKitSupport
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
commit635860845790a19bf50bbc51ba8fb66a96dde068 (patch)
treeef6ad9ff73a5b57f65249d4232a202fa77e6a140 /WebKit/wx/WebKitSupport
parent8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (diff)
downloadexternal_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.zip
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.gz
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.bz2
auto import from //depot/cupcake/@136594
Diffstat (limited to 'WebKit/wx/WebKitSupport')
-rw-r--r--WebKit/wx/WebKitSupport/ChromeClientWx.cpp7
-rw-r--r--WebKit/wx/WebKitSupport/ChromeClientWx.h3
-rw-r--r--WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp8
-rw-r--r--WebKit/wx/WebKitSupport/EditCommandWx.h54
-rw-r--r--WebKit/wx/WebKitSupport/EditorClientWx.cpp70
-rw-r--r--WebKit/wx/WebKitSupport/EditorClientWx.h7
-rw-r--r--WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp23
-rw-r--r--WebKit/wx/WebKitSupport/FrameLoaderClientWx.h10
8 files changed, 154 insertions, 28 deletions
diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
index 3d119a5..29fef0e 100644
--- a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
@@ -122,7 +122,7 @@ Page* ChromeClientWx::createWindow(Frame*, const FrameLoadRequest& request, cons
WebViewPrivate* impl = newFrame->webview->m_impl;
if (impl)
- myPage = impl->frame->page();
+ myPage = impl->page;
}
return myPage;
@@ -314,6 +314,11 @@ PlatformWidget ChromeClientWx::platformWindow() const
return 0;
}
+void ChromeClientWx::contentsSizeChanged(Frame*, const IntSize&) const
+{
+ notImplemented();
+}
+
void ChromeClientWx::scrollBackingStore(int dx, int dy,
const IntRect& scrollViewRect,
const IntRect& clipRect)
diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.h b/WebKit/wx/WebKitSupport/ChromeClientWx.h
index d90788f..74e0023 100644
--- a/WebKit/wx/WebKitSupport/ChromeClientWx.h
+++ b/WebKit/wx/WebKitSupport/ChromeClientWx.h
@@ -102,6 +102,7 @@ public:
virtual IntPoint screenToWindow(const IntPoint&) const;
virtual IntRect windowToScreen(const IntRect&) const;
virtual PlatformWidget platformWindow() const;
+ virtual void contentsSizeChanged(Frame*, const IntSize&) const;
virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
@@ -113,6 +114,8 @@ public:
virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
+ virtual void formStateDidChange(const Node*) { }
+
private:
wxWebView* m_webView;
};
diff --git a/WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp b/WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp
index 8f88f1a..e3d8e5a 100644
--- a/WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp
@@ -28,6 +28,7 @@
#include "config.h"
#include "ContextMenuClientWx.h"
#include "NotImplemented.h"
+#include "ContextMenu.h"
#include <stdio.h>
namespace WebCore {
@@ -38,13 +39,12 @@ ContextMenuClientWx::~ContextMenuClientWx()
void ContextMenuClientWx::contextMenuDestroyed()
{
- notImplemented();
+ delete this;
}
-PlatformMenuDescription ContextMenuClientWx::getCustomMenuFromDefaultItems(ContextMenu*)
+PlatformMenuDescription ContextMenuClientWx::getCustomMenuFromDefaultItems(ContextMenu* menu)
{
- notImplemented();
- return 0;
+ return menu->releasePlatformDescription();
}
void ContextMenuClientWx::contextMenuItemSelected(ContextMenuItem*,
diff --git a/WebKit/wx/WebKitSupport/EditCommandWx.h b/WebKit/wx/WebKitSupport/EditCommandWx.h
new file mode 100644
index 0000000..e5deedd
--- /dev/null
+++ b/WebKit/wx/WebKitSupport/EditCommandWx.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2008 Kevin Ollivier. 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 WXEDITCOMMAND_H
+#define WXEDITCOMMAND_H
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+ class EditCommand;
+}
+
+class EditCommandWx
+{
+public:
+ EditCommandWx(WTF::PassRefPtr<WebCore::EditCommand> command)
+ {
+ m_editCommand = command;
+ }
+
+ ~EditCommandWx() {}
+ WTF::PassRefPtr<WebCore::EditCommand> editCommand() { return m_editCommand; }
+
+private:
+ WTF::RefPtr<WebCore::EditCommand> m_editCommand;
+};
+
+#endif
diff --git a/WebKit/wx/WebKitSupport/EditorClientWx.cpp b/WebKit/wx/WebKitSupport/EditorClientWx.cpp
index ade0f41..6c443ed 100644
--- a/WebKit/wx/WebKitSupport/EditorClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/EditorClientWx.cpp
@@ -39,7 +39,11 @@
#include "PlatformKeyboardEvent.h"
#include "PlatformString.h"
#include "SelectionController.h"
+
+#include "WebFrame.h"
+#include "WebFramePrivate.h"
#include "WebView.h"
+#include "WebViewPrivate.h"
#include <stdio.h>
@@ -78,6 +82,12 @@ bool EditorClientWx::smartInsertDeleteEnabled()
return false;
}
+bool EditorClientWx::isSelectTrailingWhitespaceEnabled()
+{
+ notImplemented();
+ return false;
+}
+
bool EditorClientWx::isContinuousSpellCheckingEnabled()
{
notImplemented();
@@ -195,14 +205,28 @@ void EditorClientWx::didSetSelectionTypesForPasteboard()
notImplemented();
}
-void EditorClientWx::registerCommandForUndo(PassRefPtr<EditCommand>)
+void EditorClientWx::registerCommandForUndo(PassRefPtr<EditCommand> command)
{
- notImplemented();
+ Frame* frame = m_page->focusController()->focusedOrMainFrame();
+
+ if (frame) {
+ wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->platformWidget());
+ if (webKitWin) {
+ webKitWin->GetMainFrame()->m_impl->undoStack.append(EditCommandWx(command));
+ }
+ }
}
-void EditorClientWx::registerCommandForRedo(PassRefPtr<EditCommand>)
+void EditorClientWx::registerCommandForRedo(PassRefPtr<EditCommand> command)
{
- notImplemented();
+ Frame* frame = m_page->focusController()->focusedOrMainFrame();
+
+ if (frame) {
+ wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->platformWidget());
+ if (webKitWin) {
+ webKitWin->GetMainFrame()->m_impl->redoStack.insert(0, EditCommandWx(command));
+ }
+ }
}
void EditorClientWx::clearUndoRedoOperations()
@@ -212,24 +236,54 @@ void EditorClientWx::clearUndoRedoOperations()
bool EditorClientWx::canUndo() const
{
- notImplemented();
+ Frame* frame = m_page->focusController()->focusedOrMainFrame();
+
+ if (frame) {
+ wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->platformWidget());
+ if (webKitWin && webKitWin->GetMainFrame()) {
+ return webKitWin->GetMainFrame()->m_impl->undoStack.size() != 0;
+ }
+ }
return false;
}
bool EditorClientWx::canRedo() const
{
- notImplemented();
+ Frame* frame = m_page->focusController()->focusedOrMainFrame();
+
+ if (frame) {
+ wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->platformWidget());
+ if (webKitWin && webKitWin->GetMainFrame()) {
+ return webKitWin->GetMainFrame()->m_impl->redoStack.size() != 0;
+ }
+ }
return false;
}
void EditorClientWx::undo()
{
- notImplemented();
+ Frame* frame = m_page->focusController()->focusedOrMainFrame();
+
+ if (frame) {
+ wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->platformWidget());
+ if (webKitWin && webKitWin->GetMainFrame()) {
+ webKitWin->GetMainFrame()->m_impl->undoStack.last().editCommand()->unapply();
+ webKitWin->GetMainFrame()->m_impl->undoStack.removeLast();
+ }
+ }
}
void EditorClientWx::redo()
{
- notImplemented();
+ Frame* frame = m_page->focusController()->focusedOrMainFrame();
+
+ if (frame) {
+ wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->platformWidget());
+ if (webKitWin && webKitWin->GetMainFrame()) {
+ webKitWin->GetMainFrame()->m_impl->redoStack.first().editCommand()->reapply();
+ webKitWin->GetMainFrame()->m_impl->redoStack.remove(0);
+ }
+ }
}
void EditorClientWx::handleInputMethodKeydown(KeyboardEvent* event)
diff --git a/WebKit/wx/WebKitSupport/EditorClientWx.h b/WebKit/wx/WebKitSupport/EditorClientWx.h
index 51b820c..0f98167 100644
--- a/WebKit/wx/WebKitSupport/EditorClientWx.h
+++ b/WebKit/wx/WebKitSupport/EditorClientWx.h
@@ -31,9 +31,15 @@
#include "EditorClient.h"
#include "Page.h"
+#include "WebView.h"
+#include "WebFrame.h"
+
namespace WebCore {
class EditorClientWx : public EditorClient {
+friend class ::wxWebView;
+friend class ::wxWebFrame;
+
public:
virtual ~EditorClientWx();
void setPage(Page*);
@@ -42,6 +48,7 @@ public:
virtual bool shouldDeleteRange(Range*);
virtual bool shouldShowDeleteInterface(HTMLElement*);
virtual bool smartInsertDeleteEnabled();
+ virtual bool isSelectTrailingWhitespaceEnabled();
virtual bool isContinuousSpellCheckingEnabled();
virtual void toggleContinuousSpellChecking();
virtual bool isGrammarCheckingEnabled();
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
index 685da65..a34576d 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
@@ -227,13 +227,6 @@ void FrameLoaderClientWx::detachedFromParent3()
notImplemented();
}
-
-void FrameLoaderClientWx::loadedFromCachedPage()
-{
- notImplemented();
-}
-
-
void FrameLoaderClientWx::dispatchDidHandleOnloadEvents()
{
if (m_webView) {
@@ -330,6 +323,10 @@ void FrameLoaderClientWx::dispatchDidFirstLayout()
notImplemented();
}
+void FrameLoaderClientWx::dispatchDidFirstVisuallyNonEmptyLayout()
+{
+ notImplemented();
+}
void FrameLoaderClientWx::dispatchShow()
{
@@ -529,7 +526,7 @@ void FrameLoaderClientWx::partClearedInBegin()
notImplemented();
}
-void FrameLoaderClientWx::updateGlobalHistory(const WebCore::KURL&)
+void FrameLoaderClientWx::updateGlobalHistory()
{
notImplemented();
}
@@ -626,6 +623,12 @@ void FrameLoaderClientWx::dispatchWillSendRequest(DocumentLoader*, unsigned long
notImplemented();
}
+bool FrameLoaderClientWx::shouldUseCredentialStorage(DocumentLoader*, unsigned long)
+{
+ notImplemented();
+ return false;
+}
+
void FrameLoaderClientWx::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&)
{
notImplemented();
@@ -834,12 +837,12 @@ void FrameLoaderClientWx::registerForIconNotification(bool listen)
notImplemented();
}
-void FrameLoaderClientWx::savePlatformDataToCachedPage(CachedPage*)
+void FrameLoaderClientWx::savePlatformDataToCachedFrame(CachedFrame*)
{
notImplemented();
}
-void FrameLoaderClientWx::transitionToCommittedFromCachedPage(CachedPage*)
+void FrameLoaderClientWx::transitionToCommittedFromCachedFrame(CachedFrame*)
{
notImplemented();
}
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
index 3b525b1..9ad4ddc 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
@@ -90,8 +90,6 @@ namespace WebCore {
virtual void detachedFromParent2();
virtual void detachedFromParent3();
- virtual void loadedFromCachedPage();
-
virtual void frameLoaderDestroyed();
virtual bool canHandleRequest(const ResourceRequest&) const;
@@ -108,6 +106,7 @@ namespace WebCore {
virtual void dispatchDidFinishDocumentLoad();
virtual void dispatchDidFinishLoad();
virtual void dispatchDidFirstLayout();
+ virtual void dispatchDidFirstVisuallyNonEmptyLayout();
virtual void dispatchShow();
virtual void cancelPolicyCheck();
@@ -145,11 +144,11 @@ namespace WebCore {
virtual String userAgent(const KURL&);
- virtual void savePlatformDataToCachedPage(WebCore::CachedPage*);
- virtual void transitionToCommittedFromCachedPage(WebCore::CachedPage*);
+ virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*);
+ virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*);
virtual void transitionToCommittedForNewPage();
- virtual void updateGlobalHistory(const KURL&);
+ virtual void updateGlobalHistory();
virtual bool shouldGoToHistoryItem(HistoryItem*) const;
virtual void saveScrollPositionAndViewStateToItem(HistoryItem*);
virtual bool canCachePage() const;
@@ -169,6 +168,7 @@ namespace WebCore {
virtual void assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&);
virtual void dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest&, const ResourceResponse&);
+ virtual bool shouldUseCredentialStorage(DocumentLoader*, unsigned long identifier);
virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&);
virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&);
virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long, const ResourceResponse&);