summaryrefslogtreecommitdiffstats
path: root/WebKit/win/WebCoreSupport
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/win/WebCoreSupport')
-rw-r--r--WebKit/win/WebCoreSupport/EmbeddedWidget.cpp10
-rw-r--r--WebKit/win/WebCoreSupport/EmbeddedWidget.h10
-rw-r--r--WebKit/win/WebCoreSupport/WebChromeClient.cpp62
-rw-r--r--WebKit/win/WebCoreSupport/WebChromeClient.h20
-rw-r--r--WebKit/win/WebCoreSupport/WebContextMenuClient.cpp29
-rw-r--r--WebKit/win/WebCoreSupport/WebContextMenuClient.h1
-rw-r--r--WebKit/win/WebCoreSupport/WebDragClient.cpp62
-rw-r--r--WebKit/win/WebCoreSupport/WebEditorClient.cpp7
-rw-r--r--WebKit/win/WebCoreSupport/WebEditorClient.h1
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp192
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameLoaderClient.h7
-rw-r--r--WebKit/win/WebCoreSupport/WebInspectorClient.cpp60
-rw-r--r--WebKit/win/WebCoreSupport/WebInspectorClient.h2
-rw-r--r--WebKit/win/WebCoreSupport/WebInspectorDelegate.h588
14 files changed, 596 insertions, 455 deletions
diff --git a/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp b/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
index 952bc03..6bd8f44 100644
--- a/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
+++ b/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
@@ -37,12 +37,12 @@
using namespace WebCore;
-EmbeddedWidget* EmbeddedWidget::create(IWebEmbeddedView* view, Element* element, HWND parentWindow, const IntSize& size)
+PassRefPtr<EmbeddedWidget> EmbeddedWidget::create(IWebEmbeddedView* view, Element* element, HWND parentWindow, const IntSize& size)
{
- EmbeddedWidget* widget = new EmbeddedWidget(view, element);
+ RefPtr<EmbeddedWidget> widget = adoptRef(new EmbeddedWidget(view, element));
widget->createWindow(parentWindow, size);
- return widget;
+ return widget.release();
}
EmbeddedWidget::~EmbeddedWidget()
@@ -222,9 +222,7 @@ void EmbeddedWidget::didReceiveResponse(const ResourceResponse& response)
void EmbeddedWidget::didReceiveData(const char* data, int length)
{
- RefPtr<SharedBuffer> buffer(SharedBuffer::create(data, length));
-
- COMPtr<IStream> stream(AdoptCOM, MemoryStream::createInstance(buffer.release()));
+ COMPtr<MemoryStream> stream = MemoryStream::createInstance(SharedBuffer::create(data, length));
m_view->didReceiveData(stream.get());
}
diff --git a/WebKit/win/WebCoreSupport/EmbeddedWidget.h b/WebKit/win/WebCoreSupport/EmbeddedWidget.h
index 56cd436..5eee892 100644
--- a/WebKit/win/WebCoreSupport/EmbeddedWidget.h
+++ b/WebKit/win/WebCoreSupport/EmbeddedWidget.h
@@ -39,7 +39,7 @@ interface IWebEmbeddedView;
class EmbeddedWidget : public WebCore::Widget, public WebCore::PluginManualLoader {
public:
- static EmbeddedWidget* create(IWebEmbeddedView*, WebCore::Element* element, HWND parentWindow, const WebCore::IntSize&);
+ static PassRefPtr<EmbeddedWidget> create(IWebEmbeddedView*, WebCore::Element* element, HWND parentWindow, const WebCore::IntSize&);
~EmbeddedWidget();
private:
@@ -54,10 +54,10 @@ private:
bool createWindow(HWND parentWindow, const WebCore::IntSize& size);
- virtual void didReceiveResponse(const WebCore::ResourceResponse&);
- virtual void didReceiveData(const char*, int);
- virtual void didFinishLoading();
- virtual void didFail(const WebCore::ResourceError&);
+ virtual void didReceiveResponse(const WebCore::ResourceResponse&);
+ virtual void didReceiveData(const char*, int);
+ virtual void didFinishLoading();
+ virtual void didFail(const WebCore::ResourceError&);
virtual void invalidateRect(const WebCore::IntRect&);
virtual void setFrameRect(const WebCore::IntRect&);
diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
index 1f0c09c..1c0401f 100644
--- a/WebKit/win/WebCoreSupport/WebChromeClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
@@ -34,7 +34,9 @@
#include "WebView.h"
#pragma warning(push, 0)
#include <WebCore/BString.h>
+#include <WebCore/Console.h>
#include <WebCore/ContextMenu.h>
+#include <WebCore/Cursor.h>
#include <WebCore/FileChooser.h>
#include <WebCore/FloatRect.h>
#include <WebCore/FrameLoadRequest.h>
@@ -151,7 +153,7 @@ void WebChromeClient::takeFocus(FocusDirection direction)
Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& features)
{
if (features.dialog) {
- COMPtr<IWebUIDelegate3> delegate = uiDelegate3();
+ COMPtr<IWebUIDelegate> delegate = uiDelegate();
if (!delegate)
return 0;
COMPtr<IWebMutableURLRequest> request(AdoptCOM, WebMutableURLRequest::createInstance(frameLoadRequest.resourceRequest()));
@@ -191,14 +193,14 @@ void WebChromeClient::show()
bool WebChromeClient::canRunModal()
{
BOOL result = FALSE;
- if (COMPtr<IWebUIDelegate3> delegate = uiDelegate3())
+ if (COMPtr<IWebUIDelegate> delegate = uiDelegate())
delegate->canRunModal(m_webView, &result);
return result;
}
void WebChromeClient::runModal()
{
- if (COMPtr<IWebUIDelegate3> delegate = uiDelegate3())
+ if (COMPtr<IWebUIDelegate> delegate = uiDelegate())
delegate->runModal(m_webView);
}
@@ -261,7 +263,7 @@ bool WebChromeClient::scrollbarsVisible()
void WebChromeClient::setMenubarVisible(bool visible)
{
- COMPtr<IWebUIDelegate3> delegate = uiDelegate3();
+ COMPtr<IWebUIDelegate> delegate = uiDelegate();
if (!delegate)
return;
delegate->setMenuBarVisible(m_webView, visible);
@@ -269,7 +271,7 @@ void WebChromeClient::setMenubarVisible(bool visible)
bool WebChromeClient::menubarVisible()
{
- COMPtr<IWebUIDelegate3> delegate = uiDelegate3();
+ COMPtr<IWebUIDelegate> delegate = uiDelegate();
if (!delegate)
return true;
BOOL result = true;
@@ -286,7 +288,7 @@ void WebChromeClient::setResizable(bool resizable)
}
}
-void WebChromeClient::addMessageToConsole(const String& message, unsigned line, const String& url)
+void WebChromeClient::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned line, const String& url)
{
COMPtr<IWebUIDelegate> uiDelegate;
if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate))) {
@@ -492,7 +494,7 @@ void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& result, unsig
uiDelegate->mouseDidMoveOverElement(m_webView, element.get(), modifierFlags);
}
-void WebChromeClient::setToolTip(const String& toolTip)
+void WebChromeClient::setToolTip(const String& toolTip, TextDirection)
{
m_webView->setToolTip(toolTip);
}
@@ -500,10 +502,8 @@ void WebChromeClient::setToolTip(const String& toolTip)
void WebChromeClient::print(Frame* frame)
{
COMPtr<IWebUIDelegate> uiDelegate;
- COMPtr<IWebUIDelegate2> uiDelegate2;
if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate)))
- if (SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegate2, (void**)&uiDelegate2)))
- uiDelegate2->printFrame(m_webView, kit(frame));
+ uiDelegate->printFrame(m_webView, kit(frame));
}
#if ENABLE(DATABASE)
@@ -512,9 +512,9 @@ void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& database
COMPtr<WebSecurityOrigin> origin(AdoptCOM, WebSecurityOrigin::createInstance(frame->document()->securityOrigin()));
COMPtr<IWebUIDelegate> uiDelegate;
if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate))) {
- COMPtr<IWebUIDelegatePrivate3> uiDelegatePrivate3(Query, uiDelegate);
- if (uiDelegatePrivate3)
- uiDelegatePrivate3->exceededDatabaseQuota(m_webView, kit(frame), origin.get(), BString(databaseIdentifier));
+ COMPtr<IWebUIDelegatePrivate> uiDelegatePrivate(Query, uiDelegate);
+ if (uiDelegatePrivate)
+ uiDelegatePrivate->exceededDatabaseQuota(m_webView, kit(frame), origin.get(), BString(databaseIdentifier));
else {
// FIXME: remove this workaround once shipping Safari has the necessary delegate implemented.
TCHAR path[MAX_PATH];
@@ -567,7 +567,7 @@ bool WebChromeClient::paintCustomScrollbar(GraphicsContext* context, const Float
if (context->paintingDisabled())
return false;
- COMPtr<IWebUIDelegate4> delegate = uiDelegate4();
+ COMPtr<IWebUIDelegate> delegate = uiDelegate();
if (!delegate)
return false;
@@ -634,7 +634,7 @@ bool WebChromeClient::paintCustomScrollCorner(GraphicsContext* context, const Fl
if (context->paintingDisabled())
return false;
- COMPtr<IWebUIDelegate4> delegate = uiDelegate4();
+ COMPtr<IWebUIDelegate> delegate = uiDelegate();
if (!delegate)
return false;
@@ -703,24 +703,32 @@ void WebChromeClient::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChoose
// FIXME: Show some sort of error if too many files are selected and the buffer is too small. For now, this will fail silently.
}
-COMPtr<IWebUIDelegate> WebChromeClient::uiDelegate()
+bool WebChromeClient::setCursor(PlatformCursorHandle cursor)
{
- COMPtr<IWebUIDelegate> delegate;
- m_webView->uiDelegate(&delegate);
- return delegate;
-}
+ if (!cursor)
+ return false;
-COMPtr<IWebUIDelegate2> WebChromeClient::uiDelegate2()
-{
- return COMPtr<IWebUIDelegate2>(Query, uiDelegate());
+ if (COMPtr<IWebUIDelegate> delegate = uiDelegate()) {
+ COMPtr<IWebUIDelegatePrivate> delegatePrivate(Query, delegate);
+ if (delegatePrivate) {
+ if (SUCCEEDED(delegatePrivate->webViewSetCursor(m_webView, reinterpret_cast<OLE_HANDLE>(cursor))))
+ return true;
+ }
+ }
+
+ ::SetCursor(cursor);
+ return true;
}
-COMPtr<IWebUIDelegate3> WebChromeClient::uiDelegate3()
+void WebChromeClient::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
{
- return COMPtr<IWebUIDelegate3>(Query, uiDelegate());
+ // See the comment in WebCore/page/ChromeClient.h
+ notImplemented();
}
-COMPtr<IWebUIDelegate4> WebChromeClient::uiDelegate4()
+COMPtr<IWebUIDelegate> WebChromeClient::uiDelegate()
{
- return COMPtr<IWebUIDelegate4>(Query, uiDelegate());
+ COMPtr<IWebUIDelegate> delegate;
+ m_webView->uiDelegate(&delegate);
+ return delegate;
}
diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.h b/WebKit/win/WebCoreSupport/WebChromeClient.h
index 4aa7422..c601c8e 100644
--- a/WebKit/win/WebCoreSupport/WebChromeClient.h
+++ b/WebKit/win/WebCoreSupport/WebChromeClient.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -33,9 +33,6 @@
class WebView;
interface IWebUIDelegate;
-interface IWebUIDelegate2;
-interface IWebUIDelegate3;
-interface IWebUIDelegate4;
class WebChromeClient : public WebCore::ChromeClient {
public:
@@ -76,7 +73,7 @@ public:
virtual void setResizable(bool);
- virtual void addMessageToConsole(const WebCore::String& message, unsigned line, const WebCore::String& url);
+ virtual void addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type, WebCore::MessageLevel level, const WebCore::String& message, unsigned line, const WebCore::String& url);
virtual bool canRunBeforeUnloadConfirmPanel();
virtual bool runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame);
@@ -101,7 +98,7 @@ public:
virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags);
- virtual void setToolTip(const WebCore::String&);
+ virtual void setToolTip(const WebCore::String&, WebCore::TextDirection);
virtual void print(WebCore::Frame*);
@@ -122,15 +119,20 @@ public:
virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
+ virtual bool setCursor(WebCore::PlatformCursorHandle cursor);
+
WebView* webView() const { return m_webView; }
virtual void formStateDidChange(const WebCore::Node*) { }
+ virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
+
+ virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const {}
+
+ virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
+
private:
COMPtr<IWebUIDelegate> uiDelegate();
- COMPtr<IWebUIDelegate2> uiDelegate2();
- COMPtr<IWebUIDelegate3> uiDelegate3();
- COMPtr<IWebUIDelegate4> uiDelegate4();
WebView* m_webView;
};
diff --git a/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp b/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
index deabb5c..e42b4cf 100644
--- a/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
@@ -26,13 +26,13 @@
#include "config.h"
#include "WebContextMenuClient.h"
-#include "WebDownload.h"
#include "WebElementPropertyBag.h"
#include "WebLocalizableStrings.h"
#include "WebView.h"
#pragma warning(push, 0)
#include <WebCore/ContextMenu.h>
+#include <WebCore/Event.h>
#include <WebCore/FrameLoader.h>
#include <WebCore/FrameLoadRequest.h>
#include <WebCore/Page.h>
@@ -59,11 +59,6 @@ static bool isPreInspectElementTagSafari(IWebUIDelegate* uiDelegate)
if (!uiDelegate)
return false;
- // We assume anyone who implements IWebUIDelegate2 also knows about the Inspect Element item.
- COMPtr<IWebUIDelegate2> uiDelegate2;
- if (SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegate2, (void**)&uiDelegate2)))
- return false;
-
TCHAR modulePath[MAX_PATH];
DWORD length = ::GetModuleFileName(0, modulePath, _countof(modulePath));
if (!length)
@@ -132,19 +127,7 @@ void WebContextMenuClient::contextMenuItemSelected(ContextMenuItem* item, const
void WebContextMenuClient::downloadURL(const KURL& url)
{
- COMPtr<IWebDownloadDelegate> downloadDelegate;
- if (FAILED(m_webView->downloadDelegate(&downloadDelegate))) {
- // If the WebView doesn't successfully provide a download delegate we'll pass a null one
- // into the WebDownload - which may or may not decide to use a DefaultDownloadDelegate
- LOG_ERROR("Failed to get downloadDelegate from WebView");
- downloadDelegate = 0;
- }
-
- // Its the delegate's job to ref the WebDownload to keep it alive - otherwise it will be destroyed
- // when this method returns
- COMPtr<WebDownload> download;
- download.adoptRef(WebDownload::createInstance(url, downloadDelegate.get()));
- download->start();
+ m_webView->downloadURL(url);
}
void WebContextMenuClient::searchWithGoogle(const Frame* frame)
@@ -160,7 +143,7 @@ void WebContextMenuClient::searchWithGoogle(const Frame* frame)
ResourceRequest request = ResourceRequest(url);
if (Page* page = frame->page())
- page->mainFrame()->loader()->urlSelected(FrameLoadRequest(request), 0, false, false);
+ page->mainFrame()->loader()->urlSelected(request, String(), 0, false, false, true);
}
void WebContextMenuClient::lookUpInDictionary(Frame*)
@@ -177,3 +160,9 @@ void WebContextMenuClient::stopSpeaking()
{
notImplemented();
}
+
+bool WebContextMenuClient::isSpeaking()
+{
+ notImplemented();
+ return false;
+}
diff --git a/WebKit/win/WebCoreSupport/WebContextMenuClient.h b/WebKit/win/WebCoreSupport/WebContextMenuClient.h
index a981f4e..153e30e 100644
--- a/WebKit/win/WebCoreSupport/WebContextMenuClient.h
+++ b/WebKit/win/WebCoreSupport/WebContextMenuClient.h
@@ -45,6 +45,7 @@ public:
virtual void lookUpInDictionary(WebCore::Frame*);
virtual void speak(const WebCore::String&);
virtual void stopSpeaking();
+ virtual bool isSpeaking();
private:
WebView* m_webView;
diff --git a/WebKit/win/WebCoreSupport/WebDragClient.cpp b/WebKit/win/WebCoreSupport/WebDragClient.cpp
index d42f7b5..e5c5a20 100644
--- a/WebKit/win/WebCoreSupport/WebDragClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebDragClient.cpp
@@ -40,6 +40,7 @@
#include <WebCore/FrameView.h>
#include <WebCore/GraphicsContext.h>
#include <WebCore/Page.h>
+#include <WebCore/Settings.h>
#include <WebCore/StringTruncator.h>
#include <WebCore/WebCoreTextRenderer.h>
#pragma warning(pop)
@@ -104,8 +105,19 @@ DragSourceAction WebDragClient::dragSourceActionMaskForPoint(const IntPoint& win
return (DragSourceAction)action;
}
-void WebDragClient::willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*)
+void WebDragClient::willPerformDragSourceAction(DragSourceAction action, const IntPoint& intPoint, Clipboard* clipboard)
{
+ COMPtr<IWebUIDelegate> uiDelegate;
+ if (!SUCCEEDED(m_webView->uiDelegate(&uiDelegate)))
+ return;
+
+ POINT point = intPoint;
+ COMPtr<IDataObject> dataObject = static_cast<ClipboardWin*>(clipboard)->dataObject();
+
+ COMPtr<IDataObject> newDataObject;
+ HRESULT result = uiDelegate->willPerformDragSourceAction(m_webView, static_cast<WebDragSourceAction>(action), &point, dataObject.get(), &newDataObject);
+ if (result == S_OK && newDataObject != dataObject)
+ static_cast<ClipboardWin*>(clipboard)->setExternalDataObject(newDataObject.get());
}
void WebDragClient::startDrag(DragImageRef image, const IntPoint& imageOrigin, const IntPoint& dragPoint, Clipboard* clipboard, Frame* frame, bool isLink)
@@ -157,25 +169,43 @@ void WebDragClient::startDrag(DragImageRef image, const IntPoint& imageOrigin, c
}
}
-static Font dragLabelFont(int size, bool bold)
+static Font dragLabelFont(int size, bool bold, FontRenderingMode renderingMode)
{
+ NONCLIENTMETRICS metrics;
+ metrics.cbSize = sizeof(metrics);
+ SystemParametersInfo(SPI_GETNONCLIENTMETRICS, metrics.cbSize, &metrics, 0);
FontDescription desc;
desc.setWeight(bold ? FontWeightBold : FontWeightNormal);
FontFamily family;
- family.setFamily("Lucida Grande");
+ family.setFamily(metrics.lfSmCaptionFont.lfFaceName);
desc.setFamily(family);
desc.setSpecifiedSize((float)size);
desc.setComputedSize((float)size);
+ desc.setRenderingMode(renderingMode);
Font result = Font(desc, 0, 0);
result.update(0);
return result;
}
-DragImageRef WebDragClient::createDragImageForLink(KURL& url, const String& inLabel, Frame*)
+DragImageRef WebDragClient::createDragImageForLink(KURL& url, const String& inLabel, Frame* frame)
{
- //This is more or less an exact match for the MacOS code
- static const Font labelFont = dragLabelFont(DRAG_LINK_LABEL_FONT_SIZE, true);
- static const Font urlFont = dragLabelFont(DRAG_LINK_URL_FONT_SIZE, false);
+ // This is more or less an exact match for the Mac OS X code.
+
+ const Font* labelFont;
+ const Font* urlFont;
+
+ if (frame->settings() && frame->settings()->fontRenderingMode() == AlternateRenderingMode) {
+ static const Font alternateRenderingModeLabelFont = dragLabelFont(DRAG_LINK_LABEL_FONT_SIZE, true, AlternateRenderingMode);
+ static const Font alternateRenderingModeURLFont = dragLabelFont(DRAG_LINK_URL_FONT_SIZE, false, AlternateRenderingMode);
+ labelFont = &alternateRenderingModeLabelFont;
+ urlFont = &alternateRenderingModeURLFont;
+ } else {
+ static const Font normalRenderingModeLabelFont = dragLabelFont(DRAG_LINK_LABEL_FONT_SIZE, true, NormalRenderingMode);
+ static const Font normalRenderingModeURLFont = dragLabelFont(DRAG_LINK_URL_FONT_SIZE, false, NormalRenderingMode);
+ labelFont = &normalRenderingModeLabelFont;
+ urlFont = &normalRenderingModeURLFont;
+ }
+
bool drawURLString = true;
bool clipURLString = false;
bool clipLabelString = false;
@@ -190,7 +220,7 @@ DragImageRef WebDragClient::createDragImageForLink(KURL& url, const String& inLa
//First step in drawing the link drag image width
TextRun labelRun(label.impl());
TextRun urlRun(urlString.impl());
- IntSize labelSize(labelFont.width(labelRun), labelFont.ascent() + labelFont.descent());
+ IntSize labelSize(labelFont->width(labelRun), labelFont->ascent() + labelFont->descent());
if (labelSize.width() > MAX_DRAG_LABEL_STRING_WIDTH){
labelSize.setWidth(MAX_DRAG_LABEL_STRING_WIDTH);
@@ -202,8 +232,8 @@ DragImageRef WebDragClient::createDragImageForLink(KURL& url, const String& inLa
labelSize.height() + DRAG_LABEL_BORDER_Y * 2);
if (drawURLString) {
- urlStringSize.setWidth(urlFont.width(urlRun));
- urlStringSize.setHeight(urlFont.ascent() + urlFont.descent());
+ urlStringSize.setWidth(urlFont->width(urlRun));
+ urlStringSize.setHeight(urlFont->ascent() + urlFont->descent());
imageSize.setHeight(imageSize.height() + urlStringSize.height());
if (urlStringSize.width() > MAX_DRAG_LABEL_STRING_WIDTH) {
imageSize.setWidth(MAX_DRAG_LABEL_WIDTH);
@@ -245,16 +275,16 @@ DragImageRef WebDragClient::createDragImageForLink(KURL& url, const String& inLa
static const Color bottomColor(255, 255, 255, 127); //original alpha = 0.5
if (drawURLString) {
if (clipURLString)
- urlString = StringTruncator::rightTruncate(urlString, imageSize.width() - (DRAG_LABEL_BORDER_X * 2.0f), urlFont, false);
- IntPoint textPos(DRAG_LABEL_BORDER_X, imageSize.height() - (DRAG_LABEL_BORDER_Y_OFFSET + urlFont.descent()));
- WebCoreDrawDoubledTextAtPoint(context, urlString, textPos, urlFont, topColor, bottomColor);
+ urlString = StringTruncator::rightTruncate(urlString, imageSize.width() - (DRAG_LABEL_BORDER_X * 2.0f), *urlFont, false);
+ IntPoint textPos(DRAG_LABEL_BORDER_X, imageSize.height() - (DRAG_LABEL_BORDER_Y_OFFSET + urlFont->descent()));
+ WebCoreDrawDoubledTextAtPoint(context, urlString, textPos, *urlFont, topColor, bottomColor);
}
if (clipLabelString)
- label = StringTruncator::rightTruncate(label, imageSize.width() - (DRAG_LABEL_BORDER_X * 2.0f), labelFont, false);
+ label = StringTruncator::rightTruncate(label, imageSize.width() - (DRAG_LABEL_BORDER_X * 2.0f), *labelFont, false);
- IntPoint textPos(DRAG_LABEL_BORDER_X, DRAG_LABEL_BORDER_Y + labelFont.pixelSize());
- WebCoreDrawDoubledTextAtPoint(context, label, textPos, labelFont, topColor, bottomColor);
+ IntPoint textPos(DRAG_LABEL_BORDER_X, DRAG_LABEL_BORDER_Y + labelFont->pixelSize());
+ WebCoreDrawDoubledTextAtPoint(context, label, textPos, *labelFont, topColor, bottomColor);
deallocContext(contextRef);
DeleteDC(workingDC);
diff --git a/WebKit/win/WebCoreSupport/WebEditorClient.cpp b/WebKit/win/WebCoreSupport/WebEditorClient.cpp
index 985742f..e626178 100644
--- a/WebKit/win/WebCoreSupport/WebEditorClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebEditorClient.cpp
@@ -646,6 +646,13 @@ void WebEditorClient::checkSpellingOfString(const UChar* text, int length, int*
ed->checkSpellingOfString(m_webView, text, length, misspellingLocation, misspellingLength);
}
+String WebEditorClient::getAutoCorrectSuggestionForMisspelledWord(const String& inputWord)
+{
+ // This method can be implemented using customized algorithms for the particular browser.
+ // Currently, it computes an empty string.
+ return String();
+}
+
void WebEditorClient::checkGrammarOfString(const UChar* text, int length, Vector<GrammarDetail>& details, int* badGrammarLocation, int* badGrammarLength)
{
details.clear();
diff --git a/WebKit/win/WebCoreSupport/WebEditorClient.h b/WebKit/win/WebCoreSupport/WebEditorClient.h
index 52cb66d..a29a264 100644
--- a/WebKit/win/WebCoreSupport/WebEditorClient.h
+++ b/WebKit/win/WebCoreSupport/WebEditorClient.h
@@ -101,6 +101,7 @@ public:
virtual void ignoreWordInSpellDocument(const WebCore::String&);
virtual void learnWord(const WebCore::String&);
virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength);
+ virtual WebCore::String getAutoCorrectSuggestionForMisspelledWord(const WebCore::String&);
virtual void checkGrammarOfString(const UChar*, int length, Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength);
virtual void updateSpellingUIWithGrammarString(const WebCore::String&, const WebCore::GrammarDetail& detail);
virtual void updateSpellingUIWithMisspelledWord(const WebCore::String&);
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
index c307660..0fea348 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -44,7 +44,6 @@
#include "WebHistoryItem.h"
#include "WebMutableURLRequest.h"
#include "WebNotificationCenter.h"
-#include "WebScriptDebugServer.h"
#include "WebURLAuthenticationChallenge.h"
#include "WebURLResponse.h"
#include "WebView.h"
@@ -65,6 +64,7 @@
#include <WebCore/PluginView.h>
#include <WebCore/RenderPart.h>
#include <WebCore/ResourceHandle.h>
+#include <WebCore/ScriptString.h>
#pragma warning(pop)
using namespace WebCore;
@@ -94,9 +94,19 @@ bool WebFrameLoaderClient::hasWebView() const
void WebFrameLoaderClient::forceLayout()
{
- FrameView* view = core(m_webFrame)->view();
- if (view)
- view->forceLayout(true);
+ Frame* frame = core(m_webFrame);
+ if (!frame)
+ return;
+
+ if (frame->document() && frame->document()->inPageCache())
+ return;
+
+ FrameView* view = frame->view();
+ if (!view)
+ return;
+
+ view->setNeedsLayout();
+ view->forceLayout(true);
}
void WebFrameLoaderClient::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request)
@@ -117,8 +127,8 @@ bool WebFrameLoaderClient::shouldUseCredentialStorage(DocumentLoader* loader, un
if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate)))
return true;
- COMPtr<IWebResourceLoadDelegatePrivate2> resourceLoadDelegatePrivate;
- if (FAILED(resourceLoadDelegate->QueryInterface(IID_IWebResourceLoadDelegatePrivate2, reinterpret_cast<void**>(&resourceLoadDelegatePrivate))))
+ COMPtr<IWebResourceLoadDelegatePrivate> resourceLoadDelegatePrivate;
+ if (FAILED(resourceLoadDelegate->QueryInterface(IID_IWebResourceLoadDelegatePrivate, reinterpret_cast<void**>(&resourceLoadDelegatePrivate))))
return true;
BOOL shouldUse;
@@ -177,6 +187,11 @@ void WebFrameLoaderClient::dispatchWillSendRequest(DocumentLoader* loader, unsig
if (webURLRequest == newWebURLRequest)
return;
+ if (!newWebURLRequest) {
+ request = ResourceRequest();
+ return;
+ }
+
COMPtr<WebMutableURLRequest> newWebURLRequestImpl(Query, newWebURLRequest);
if (!newWebURLRequestImpl)
return;
@@ -226,6 +241,10 @@ void WebFrameLoaderClient::dispatchDidFailLoading(DocumentLoader* loader, unsign
resourceLoadDelegate->didFailLoadingWithError(webView, identifier, webError.get(), getWebDataSource(loader));
}
+void WebFrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest(unsigned long, const ScriptString&)
+{
+}
+
bool WebFrameLoaderClient::shouldCacheResponse(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& response, const unsigned char* data, const unsigned long long length)
{
WebView* webView = m_webFrame->webView();
@@ -233,11 +252,11 @@ bool WebFrameLoaderClient::shouldCacheResponse(DocumentLoader* loader, unsigned
if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate)))
return true;
- COMPtr<IWebResourceLoadDelegatePrivate3> resourceLoadDelegatePrivate(Query, resourceLoadDelegate);
+ COMPtr<IWebResourceLoadDelegatePrivate> resourceLoadDelegatePrivate(Query, resourceLoadDelegate);
if (!resourceLoadDelegatePrivate)
return true;
- COMPtr<IWebURLResponse> urlResponse(WebURLResponse::createInstance(response));
+ COMPtr<IWebURLResponse> urlResponse(AdoptCOM, WebURLResponse::createInstance(response));
BOOL shouldCache;
if (SUCCEEDED(resourceLoadDelegatePrivate->shouldCacheResponse(webView, identifier, urlResponse.get(), data, length, getWebDataSource(loader), &shouldCache)))
return shouldCache;
@@ -350,11 +369,8 @@ void WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout()
{
WebView* webView = m_webFrame->webView();
COMPtr<IWebFrameLoadDelegatePrivate> frameLoadDelegatePrivate;
- if (SUCCEEDED(webView->frameLoadDelegatePrivate(&frameLoadDelegatePrivate)) && frameLoadDelegatePrivate) {
- COMPtr<IWebFrameLoadDelegatePrivate2> frameLoadDelegatePrivate2(Query, frameLoadDelegatePrivate);
- if (frameLoadDelegatePrivate2)
- frameLoadDelegatePrivate2->didFirstVisuallyNonEmptyLayoutInFrame(webView, m_webFrame);
- }
+ if (SUCCEEDED(webView->frameLoadDelegatePrivate(&frameLoadDelegatePrivate)) && frameLoadDelegatePrivate)
+ frameLoadDelegatePrivate->didFirstVisuallyNonEmptyLayoutInFrame(webView, m_webFrame);
}
Frame* WebFrameLoaderClient::dispatchCreatePage()
@@ -481,8 +497,7 @@ void WebFrameLoaderClient::updateGlobalHistory()
return;
DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader();
- history->visitedURL(loader->urlForHistory(), loader->title(), loader->originalRequestCopy().httpMethod(), loader->urlForHistoryReflectsFailure());
- updateGlobalHistoryRedirectLinks();
+ history->visitedURL(loader->urlForHistory(), loader->title(), loader->originalRequestCopy().httpMethod(), loader->urlForHistoryReflectsFailure(), !loader->clientRedirectSourceForHistory());
}
void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
@@ -492,6 +507,7 @@ void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
return;
DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader();
+ ASSERT(loader->unreachableURL().isEmpty());
if (!loader->clientRedirectSourceForHistory().isNull()) {
if (COMPtr<IWebHistoryItem> iWebHistoryItem = history->itemForURLString(loader->clientRedirectSourceForHistory())) {
@@ -606,7 +622,7 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& URL, const Strin
childFrame->tree()->setName(name);
childFrame->init();
- loadURLIntoChild(URL, referrer, webFrame.get());
+ coreFrame->loader()->loadURLIntoChildFrame(URL, referrer, childFrame.get());
// The frame's onload handler may have removed it from the document.
if (!childFrame->tree()->parent())
@@ -615,53 +631,72 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& URL, const Strin
return childFrame.release();
}
-void WebFrameLoaderClient::loadURLIntoChild(const KURL& originalURL, const String& referrer, WebFrame* childFrame)
+void WebFrameLoaderClient::dispatchDidFailToStartPlugin(const PluginView* pluginView) const
{
- ASSERT(childFrame);
- ASSERT(core(childFrame));
+ WebView* webView = m_webFrame->webView();
- Frame* coreFrame = core(m_webFrame);
- ASSERT(coreFrame);
+ COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
+ if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate)))
+ return;
+
+ RetainPtr<CFMutableDictionaryRef> userInfo(AdoptCF, CFDictionaryCreateMutable(0, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+
+ Frame* frame = core(m_webFrame);
+ ASSERT(frame == pluginView->parentFrame());
+
+ if (!pluginView->pluginsPage().isNull()) {
+ KURL pluginPageURL = frame->document()->completeURL(deprecatedParseURL(pluginView->pluginsPage()));
+ if (pluginPageURL.protocolInHTTPFamily()) {
+ static CFStringRef key = MarshallingHelpers::LPCOLESTRToCFStringRef(WebKitErrorPlugInPageURLStringKey);
+ RetainPtr<CFStringRef> str(AdoptCF, pluginPageURL.string().createCFString());
+ CFDictionarySetValue(userInfo.get(), key, str.get());
+ }
+ }
- HistoryItem* parentItem = coreFrame->loader()->currentHistoryItem();
- FrameLoadType loadType = coreFrame->loader()->loadType();
- FrameLoadType childLoadType = FrameLoadTypeRedirectWithLockedBackForwardList;
-
- KURL url = originalURL;
-
- // If we're moving in the backforward list, we might want to replace the content
- // of this child frame with whatever was there at that point.
- // Reload will maintain the frame contents, LoadSame will not.
- if (parentItem && parentItem->children().size() && isBackForwardLoadType(loadType)) {
- if (HistoryItem* childItem = parentItem->childItemWithName(core(childFrame)->tree()->name())) {
- // Use the original URL to ensure we get all the side-effects, such as
- // onLoad handlers, of any redirects that happened. An example of where
- // this is needed is Radar 3213556.
- url = childItem->originalURL();
- // These behaviors implied by these loadTypes should apply to the child frames
- childLoadType = loadType;
-
- if (isBackForwardLoadType(loadType))
- // For back/forward, remember this item so we can traverse any child items as child frames load
- core(childFrame)->loader()->setProvisionalHistoryItem(childItem);
- else
- // For reload, just reinstall the current item, since a new child frame was created but we won't be creating a new BF item
- core(childFrame)->loader()->setCurrentHistoryItem(childItem);
+ if (!pluginView->mimeType().isNull()) {
+ static CFStringRef key = MarshallingHelpers::LPCOLESTRToCFStringRef(WebKitErrorMIMETypeKey);
+
+ RetainPtr<CFStringRef> str(AdoptCF, pluginView->mimeType().createCFString());
+ CFDictionarySetValue(userInfo.get(), key, str.get());
+ }
+
+ if (pluginView->plugin()) {
+ String pluginName = pluginView->plugin()->name();
+ if (!pluginName.isNull()) {
+ static CFStringRef key = MarshallingHelpers::LPCOLESTRToCFStringRef(WebKitErrorPlugInNameKey);
+ RetainPtr<CFStringRef> str(AdoptCF, pluginName.createCFString());
+ CFDictionarySetValue(userInfo.get(), key, str.get());
}
}
- // FIXME: Handle loading WebArchives here
- String frameName = core(childFrame)->tree()->name();
- core(childFrame)->loader()->loadURL(url, referrer, frameName, false, childLoadType, 0, 0);
+ COMPtr<CFDictionaryPropertyBag> userInfoBag(AdoptCOM, CFDictionaryPropertyBag::createInstance());
+ userInfoBag->setDictionary(userInfo.get());
+
+ int errorCode = 0;
+ switch (pluginView->status()) {
+ case PluginStatusCanNotFindPlugin:
+ errorCode = WebKitErrorCannotFindPlugIn;
+ break;
+ case PluginStatusCanNotLoadPlugin:
+ errorCode = WebKitErrorCannotLoadPlugIn;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+ ResourceError resourceError(String(WebKitErrorDomain), errorCode, pluginView->url().string(), String());
+ COMPtr<IWebError> error(AdoptCOM, WebError::createInstance(resourceError, userInfoBag.get()));
+
+ resourceLoadDelegate->plugInFailedWithError(webView, error.get(), getWebDataSource(frame->loader()->documentLoader()));
}
-Widget* WebFrameLoaderClient::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
+PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
{
WebView* webView = m_webFrame->webView();
COMPtr<IWebUIDelegate> ui;
if (SUCCEEDED(webView->uiDelegate(&ui)) && ui) {
- COMPtr<IWebUIDelegatePrivate4> uiPrivate(Query, ui);
+ COMPtr<IWebUIDelegatePrivate> uiPrivate(Query, ui);
if (uiPrivate) {
// Assemble the view arguments in a property bag.
@@ -693,63 +728,12 @@ Widget* WebFrameLoaderClient::createPlugin(const IntSize& pluginSize, HTMLPlugIn
}
Frame* frame = core(m_webFrame);
- PluginView* pluginView = PluginView::create(frame, pluginSize, element, url, paramNames, paramValues, mimeType, loadManually);
+ RefPtr<PluginView> pluginView = PluginView::create(frame, pluginSize, element, url, paramNames, paramValues, mimeType, loadManually);
if (pluginView->status() == PluginStatusLoadedSuccessfully)
return pluginView;
- COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
-
- if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate)))
- return pluginView;
-
- RetainPtr<CFMutableDictionaryRef> userInfo(AdoptCF, CFDictionaryCreateMutable(0, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
-
- unsigned count = (unsigned)paramNames.size();
- for (unsigned i = 0; i < count; i++) {
- if (paramNames[i] == "pluginspage") {
- static CFStringRef key = MarshallingHelpers::LPCOLESTRToCFStringRef(WebKitErrorPlugInPageURLStringKey);
- RetainPtr<CFStringRef> str(AdoptCF, paramValues[i].createCFString());
- CFDictionarySetValue(userInfo.get(), key, str.get());
- break;
- }
- }
-
- if (!mimeType.isNull()) {
- static CFStringRef key = MarshallingHelpers::LPCOLESTRToCFStringRef(WebKitErrorMIMETypeKey);
-
- RetainPtr<CFStringRef> str(AdoptCF, mimeType.createCFString());
- CFDictionarySetValue(userInfo.get(), key, str.get());
- }
-
- String pluginName;
- if (pluginView->plugin())
- pluginName = pluginView->plugin()->name();
- if (!pluginName.isNull()) {
- static CFStringRef key = MarshallingHelpers::LPCOLESTRToCFStringRef(WebKitErrorPlugInNameKey);
- RetainPtr<CFStringRef> str(AdoptCF, pluginName.createCFString());
- CFDictionarySetValue(userInfo.get(), key, str.get());
- }
-
- COMPtr<CFDictionaryPropertyBag> userInfoBag(AdoptCOM, CFDictionaryPropertyBag::createInstance());
- userInfoBag->setDictionary(userInfo.get());
-
- int errorCode = 0;
- switch (pluginView->status()) {
- case PluginStatusCanNotFindPlugin:
- errorCode = WebKitErrorCannotFindPlugIn;
- break;
- case PluginStatusCanNotLoadPlugin:
- errorCode = WebKitErrorCannotLoadPlugIn;
- break;
- default:
- ASSERT_NOT_REACHED();
- }
-
- ResourceError resourceError(String(WebKitErrorDomain), errorCode, url.string(), String());
- COMPtr<IWebError> error(AdoptCOM, WebError::createInstance(resourceError, userInfoBag.get()));
-
- resourceLoadDelegate->plugInFailedWithError(webView, error.get(), getWebDataSource(frame->loader()->documentLoader()));
+ dispatchDidFailToStartPlugin(pluginView.get());
return pluginView;
}
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
index ac7a8c7..ef7e982 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
@@ -35,6 +35,7 @@
namespace WebCore {
class PluginManualLoader;
+ class PluginView;
}
template <typename T> class COMPtr;
@@ -56,6 +57,7 @@ public:
virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived);
virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier);
virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&);
+ virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long identifier, const WebCore::ScriptString&);
virtual bool shouldCacheResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&, const unsigned char* data, unsigned long long length);
virtual void dispatchDidHandleOnloadEvents();
@@ -101,18 +103,19 @@ public:
virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WebCore::String& name, WebCore::HTMLFrameOwnerElement* ownerElement,
const WebCore::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
- virtual WebCore::Widget* createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WebCore::String>&, const Vector<WebCore::String>&, const WebCore::String&, bool loadManually);
+ virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WebCore::String>&, const Vector<WebCore::String>&, const WebCore::String&, bool loadManually);
virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
virtual bool shouldUsePluginDocument(const WebCore::String& mimeType) const;
+ virtual void dispatchDidFailToStartPlugin(const WebCore::PluginView*) const;
+
protected:
WebFrameLoaderClient(WebFrame*);
~WebFrameLoaderClient();
private:
PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL&, const WebCore::String& name, WebCore::HTMLFrameOwnerElement*, const WebCore::String& referrer);
- void loadURLIntoChild(const WebCore::KURL&, const WebCore::String& referrer, WebFrame* childFrame);
void receivedData(const char*, int, const WebCore::String&);
WebHistory* webHistory() const;
diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
index 5bb1a83..ba724b4 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
@@ -41,6 +41,7 @@
#include <WebCore/FloatRect.h>
#include <WebCore/FrameView.h>
#include <WebCore/InspectorController.h>
+#include <WebCore/NotImplemented.h>
#include <WebCore/Page.h>
#include <WebCore/RenderObject.h>
#include <WebCore/WindowMessageBroadcaster.h>
@@ -51,12 +52,12 @@
using namespace WebCore;
+static const char* const inspectorStartsAttachedName = "inspectorStartsAttached";
+
static LPCTSTR kWebInspectorWindowClassName = TEXT("WebInspectorWindowClass");
static ATOM registerWindowClass();
static LPCTSTR kWebInspectorPointerProp = TEXT("WebInspectorPointer");
-static const unsigned defaultAttachedHeight = 300;
-
static const IntRect& defaultWindowRect()
{
static IntRect rect(60, 200, 750, 650);
@@ -165,6 +166,10 @@ Page* WebInspectorClient::createPage()
return 0;
if (FAILED(preferences->setMinimumLogicalFontSize(9)))
return 0;
+ if (FAILED(preferences->setFixedFontFamily(BString(L"Courier New"))))
+ return 0;
+ if (FAILED(preferences->setDefaultFixedFontSize(13)))
+ return 0;
if (FAILED(m_webView->setPreferences(preferences.get())))
return 0;
@@ -211,13 +216,13 @@ String WebInspectorClient::hiddenPanels()
void WebInspectorClient::showWindow()
{
showWindowWithoutNotifications();
- m_inspectedWebView->page()->inspectorController()->setWindowVisible(true);
+ m_inspectedWebView->page()->inspectorController()->setWindowVisible(true, m_shouldAttachWhenShown);
}
void WebInspectorClient::closeWindow()
{
closeWindowWithoutNotifications();
- m_inspectedWebView->page()->inspectorController()->setWindowVisible(false);
+ m_inspectedWebView->page()->inspectorController()->setWindowVisible(false, m_shouldAttachWhenShown);
}
bool WebInspectorClient::windowVisible()
@@ -230,7 +235,7 @@ void WebInspectorClient::attachWindow()
if (m_attached)
return;
- m_shouldAttachWhenShown = true;
+ m_inspectedWebView->page()->inspectorController()->setSetting(inspectorStartsAttachedName, InspectorController::Setting(true));
closeWindowWithoutNotifications();
showWindowWithoutNotifications();
@@ -241,7 +246,7 @@ void WebInspectorClient::detachWindow()
if (!m_attached)
return;
- m_shouldAttachWhenShown = false;
+ m_inspectedWebView->page()->inspectorController()->setSetting(inspectorStartsAttachedName, InspectorController::Setting(false));
closeWindowWithoutNotifications();
showWindowWithoutNotifications();
@@ -249,7 +254,30 @@ void WebInspectorClient::detachWindow()
void WebInspectorClient::setAttachedWindowHeight(unsigned height)
{
- // FIXME: implement this.
+ if (!m_attached)
+ return;
+
+ HWND hostWindow;
+ if (!SUCCEEDED(m_inspectedWebView->hostWindow((OLE_HANDLE*)&hostWindow)))
+ return;
+
+ RECT hostWindowRect;
+ GetClientRect(hostWindow, &hostWindowRect);
+
+ RECT inspectedRect;
+ GetClientRect(m_inspectedWebViewHwnd, &inspectedRect);
+
+ int totalHeight = hostWindowRect.bottom - hostWindowRect.top;
+ int webViewWidth = inspectedRect.right - inspectedRect.left;
+
+ SetWindowPos(m_webViewHwnd, 0, 0, totalHeight - height, webViewWidth, height, SWP_NOZORDER);
+
+ // We want to set the inspected web view height to the totalHeight, because the height adjustment
+ // of the inspected web view happens in onWebViewWindowPosChanging, not here.
+ SetWindowPos(m_inspectedWebViewHwnd, 0, 0, 0, webViewWidth, totalHeight, SWP_NOZORDER);
+
+ RedrawWindow(m_webViewHwnd, 0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_UPDATENOW);
+ RedrawWindow(m_inspectedWebViewHwnd, 0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_UPDATENOW);
}
void WebInspectorClient::highlight(Node*)
@@ -280,6 +308,11 @@ void WebInspectorClient::inspectedURLChanged(const String& newURL)
updateWindowTitle();
}
+void WebInspectorClient::inspectorWindowObjectCleared()
+{
+ notImplemented();
+}
+
void WebInspectorClient::closeWindowWithoutNotifications()
{
if (!m_hwnd)
@@ -318,6 +351,9 @@ void WebInspectorClient::showWindowWithoutNotifications()
ASSERT(m_webView);
ASSERT(m_inspectedWebViewHwnd);
+ InspectorController::Setting shouldAttach = m_inspectedWebView->page()->inspectorController()->setting(inspectorStartsAttachedName);
+ m_shouldAttachWhenShown = shouldAttach.type() == InspectorController::Setting::BooleanType ? shouldAttach.booleanValue() : false;
+
if (!m_shouldAttachWhenShown) {
// Put the Inspector's WebView inside our window and show it.
m_webView->setHostWindow(reinterpret_cast<OLE_HANDLE>(m_hwnd));
@@ -381,7 +417,7 @@ LRESULT WebInspectorClient::onSize(WPARAM, LPARAM)
LRESULT WebInspectorClient::onClose(WPARAM, LPARAM)
{
::ShowWindow(m_hwnd, SW_HIDE);
- m_inspectedWebView->page()->inspectorController()->setWindowVisible(false);
+ m_inspectedWebView->page()->inspectorController()->setWindowVisible(false, m_shouldAttachWhenShown);
hideHighlight();
@@ -404,9 +440,13 @@ void WebInspectorClient::onWebViewWindowPosChanging(WPARAM, LPARAM lParam)
if (windowPos->flags & SWP_NOSIZE)
return;
- windowPos->cy -= defaultAttachedHeight;
+ RECT inspectorRect;
+ GetClientRect(m_webViewHwnd, &inspectorRect);
+ unsigned inspectorHeight = inspectorRect.bottom - inspectorRect.top;
+
+ windowPos->cy -= inspectorHeight;
- ::SetWindowPos(m_webViewHwnd, 0, windowPos->x, windowPos->y + windowPos->cy, windowPos->cx, defaultAttachedHeight, SWP_NOZORDER);
+ SetWindowPos(m_webViewHwnd, 0, windowPos->x, windowPos->y + windowPos->cy, windowPos->cx, inspectorHeight, SWP_NOZORDER);
}
static LRESULT CALLBACK WebInspectorWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.h b/WebKit/win/WebCoreSupport/WebInspectorClient.h
index b497788..8965e87 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorClient.h
+++ b/WebKit/win/WebCoreSupport/WebInspectorClient.h
@@ -70,6 +70,8 @@ public:
virtual void storeSetting(const WebCore::String& key, const WebCore::InspectorController::Setting&);
virtual void removeSetting(const WebCore::String& key);
+ virtual void inspectorWindowObjectCleared();
+
private:
~WebInspectorClient();
diff --git a/WebKit/win/WebCoreSupport/WebInspectorDelegate.h b/WebKit/win/WebCoreSupport/WebInspectorDelegate.h
index a14c5fc..85f14b2 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorDelegate.h
+++ b/WebKit/win/WebCoreSupport/WebInspectorDelegate.h
@@ -1,257 +1,333 @@
-/*
- * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- *
- * 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 WebInspectorDelegate_h
-#define WebInspectorDelegate_h
-
-struct IDataObject;
-struct IPropertyBag;
-struct IWebView;
-struct IWebFrame;
-struct IWebError;
-struct IWebURLRequest;
-struct IWebOpenPanelResultListener;
-
-class WebInspectorDelegate : public IWebUIDelegate {
-public:
- static WebInspectorDelegate* createInstance();
-
- // IUnknown
+/*
+ * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
+ *
+ * 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 WebInspectorDelegate_h
+#define WebInspectorDelegate_h
+
+struct IDataObject;
+struct IPropertyBag;
+struct IWebView;
+struct IWebFrame;
+struct IWebError;
+struct IWebURLRequest;
+struct IWebOpenPanelResultListener;
+
+class WebInspectorDelegate : public IWebUIDelegate {
+public:
+ static WebInspectorDelegate* createInstance();
+
+ // IUnknown
virtual ULONG STDMETHODCALLTYPE AddRef();
- virtual ULONG STDMETHODCALLTYPE Release();
- virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void**) { return E_NOTIMPL; };
-
- // IWebUIDelegate
- virtual HRESULT STDMETHODCALLTYPE dragDestinationActionMaskForDraggingInfo(
- /* [in] */ IWebView*,
- /* [in] */ IDataObject*,
- /* [retval][out] */ WebDragDestinationAction* action);
-
- // Not implemented
- virtual HRESULT STDMETHODCALLTYPE createWebViewWithRequest(
- /* [in] */ IWebView*,
- /* [in] */ IWebURLRequest*,
- /* [retval][out] */ IWebView**) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE webViewShow(
- /* [in] */ IWebView*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE webViewClose(
- /* [in] */ IWebView*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE webViewFocus(
- /* [in] */ IWebView*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE webViewUnfocus(
- /* [in] */ IWebView*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE webViewFirstResponder(
- /* [in] */ IWebView*,
- /* [retval][out] */ OLE_HANDLE*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE makeFirstResponder(
- /* [in] */ IWebView*,
- /* [in] */ OLE_HANDLE) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE setStatusText(
- /* [in] */ IWebView*,
- /* [in] */ BSTR) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE webViewStatusText(
- /* [in] */ IWebView*,
- /* [retval][out] */ BSTR*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE webViewAreToolbarsVisible(
- /* [in] */ IWebView*,
- /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE setToolbarsVisible(
- /* [in] */ IWebView*,
- /* [in] */ BOOL) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE webViewIsStatusBarVisible(
- /* [in] */ IWebView*,
- /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE setStatusBarVisible(
- /* [in] */ IWebView*,
- /* [in] */ BOOL) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE webViewIsResizable(
- /* [in] */ IWebView*,
- /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE setResizable(
- /* [in] */ IWebView*,
- /* [in] */ BOOL) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE setFrame(
- /* [in] */ IWebView*,
- /* [in] */ RECT*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE webViewFrame(
- /* [in] */ IWebView*,
- /* [retval][out] */ RECT*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE setContentRect(
- /* [in] */ IWebView*,
- /* [in] */ RECT*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE webViewContentRect(
- /* [in] */ IWebView*,
- /* [retval][out] */ RECT*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE runJavaScriptAlertPanelWithMessage(
- /* [in] */ IWebView*,
- /* [in] */ BSTR) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE runJavaScriptConfirmPanelWithMessage(
- /* [in] */ IWebView*,
- /* [in] */ BSTR,
- /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE runJavaScriptTextInputPanelWithPrompt(
- /* [in] */ IWebView*,
- /* [in] */ BSTR /*message*/,
- /* [in] */ BSTR /*defaultText*/,
- /* [retval][out] */ BSTR*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE runBeforeUnloadConfirmPanelWithMessage(
- /* [in] */ IWebView*,
- /* [in] */ BSTR /*message*/,
- /* [in] */ IWebFrame* /*initiatedByFrame*/,
- /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE runOpenPanelForFileButtonWithResultListener(
- /* [in] */ IWebView*,
- /* [in] */ IWebOpenPanelResultListener*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE mouseDidMoveOverElement(
- /* [in] */ IWebView*,
- /* [in] */ IPropertyBag*,
- /* [in] */ UINT /*modifierFlags*/) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE contextMenuItemsForElement(
- /* [in] */ IWebView*,
- /* [in] */ IPropertyBag*,
- /* [in] */ OLE_HANDLE,
- /* [retval][out] */ OLE_HANDLE*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE validateUserInterfaceItem(
- /* [in] */ IWebView*,
- /* [in] */ UINT,
- /* [in] */ BOOL,
- /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE shouldPerformAction(
- /* [in] */ IWebView*,
- /* [in] */ UINT /*itemCommandID*/,
- /* [in] */ UINT /*sender*/) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE willPerformDragDestinationAction(
- /* [in] */ IWebView*,
- /* [in] */ WebDragDestinationAction,
- /* [in] */ IDataObject*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE dragSourceActionMaskForPoint(
- /* [in] */ IWebView*,
- /* [in] */ LPPOINT,
- /* [retval][out] */ WebDragSourceAction*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE willPerformDragSourceAction(
- /* [in] */ IWebView*,
- /* [in] */ WebDragSourceAction,
- /* [in] */ LPPOINT,
- /* [in] */ IDataObject*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE contextMenuItemSelected(
- /* [in] */ IWebView*,
- /* [in] */ void* /*item*/,
- /* [in] */ IPropertyBag*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE hasCustomMenuImplementation(
- /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE trackCustomPopupMenu(
- /* [in] */ IWebView*,
- /* [in] */ OLE_HANDLE,
- /* [in] */ LPPOINT) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE measureCustomMenuItem(
- /* [in] */ IWebView*,
- /* [in] */ void* /*measureItem*/) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE drawCustomMenuItem(
- /* [in] */ IWebView*,
- /* [in] */ void* /*drawItem*/) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE addCustomMenuDrawingData(
- /* [in] */ IWebView*,
- /* [in] */ OLE_HANDLE) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE cleanUpCustomMenuDrawingData(
- /* [in] */ IWebView*,
- /* [in] */ OLE_HANDLE) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE canTakeFocus(
- /* [in] */ IWebView*,
- /* [in] */ BOOL /*forward*/,
- /* [out] */ BOOL*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE takeFocus(
- /* [in] */ IWebView*,
- /* [in] */ BOOL /*forward*/) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE registerUndoWithTarget(
- /* [in] */ IWebUndoTarget*,
- /* [in] */ BSTR /*actionName*/,
- /* [in] */ IUnknown* /*actionArg*/) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE removeAllActionsWithTarget(
- /* [in] */ IWebUndoTarget*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE setActionTitle(
- /* [in] */ BSTR) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE undo() { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE redo() { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE canUndo(
- /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
-
- virtual HRESULT STDMETHODCALLTYPE canRedo(
- /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
-
-private:
- WebInspectorDelegate();
-
- ULONG m_refCount;
-};
-
-#endif // WebInspectorDelegate_h
+ virtual ULONG STDMETHODCALLTYPE Release();
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void**) { return E_NOTIMPL; };
+
+ // IWebUIDelegate
+ virtual HRESULT STDMETHODCALLTYPE dragDestinationActionMaskForDraggingInfo(
+ /* [in] */ IWebView*,
+ /* [in] */ IDataObject*,
+ /* [retval][out] */ WebDragDestinationAction* action);
+
+ // Not implemented
+ virtual HRESULT STDMETHODCALLTYPE createWebViewWithRequest(
+ /* [in] */ IWebView*,
+ /* [in] */ IWebURLRequest*,
+ /* [retval][out] */ IWebView**) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE webViewShow(
+ /* [in] */ IWebView*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE webViewClose(
+ /* [in] */ IWebView*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE webViewFocus(
+ /* [in] */ IWebView*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE webViewUnfocus(
+ /* [in] */ IWebView*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE webViewFirstResponder(
+ /* [in] */ IWebView*,
+ /* [retval][out] */ OLE_HANDLE*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE makeFirstResponder(
+ /* [in] */ IWebView*,
+ /* [in] */ OLE_HANDLE) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE setStatusText(
+ /* [in] */ IWebView*,
+ /* [in] */ BSTR) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE webViewStatusText(
+ /* [in] */ IWebView*,
+ /* [retval][out] */ BSTR*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE webViewAreToolbarsVisible(
+ /* [in] */ IWebView*,
+ /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE setToolbarsVisible(
+ /* [in] */ IWebView*,
+ /* [in] */ BOOL) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE webViewIsStatusBarVisible(
+ /* [in] */ IWebView*,
+ /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE setStatusBarVisible(
+ /* [in] */ IWebView*,
+ /* [in] */ BOOL) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE webViewIsResizable(
+ /* [in] */ IWebView*,
+ /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE setResizable(
+ /* [in] */ IWebView*,
+ /* [in] */ BOOL) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE setFrame(
+ /* [in] */ IWebView*,
+ /* [in] */ RECT*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE webViewFrame(
+ /* [in] */ IWebView*,
+ /* [retval][out] */ RECT*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE setContentRect(
+ /* [in] */ IWebView*,
+ /* [in] */ RECT*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE webViewContentRect(
+ /* [in] */ IWebView*,
+ /* [retval][out] */ RECT*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE runJavaScriptAlertPanelWithMessage(
+ /* [in] */ IWebView*,
+ /* [in] */ BSTR) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE runJavaScriptConfirmPanelWithMessage(
+ /* [in] */ IWebView*,
+ /* [in] */ BSTR,
+ /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE runJavaScriptTextInputPanelWithPrompt(
+ /* [in] */ IWebView*,
+ /* [in] */ BSTR /*message*/,
+ /* [in] */ BSTR /*defaultText*/,
+ /* [retval][out] */ BSTR*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE runBeforeUnloadConfirmPanelWithMessage(
+ /* [in] */ IWebView*,
+ /* [in] */ BSTR /*message*/,
+ /* [in] */ IWebFrame* /*initiatedByFrame*/,
+ /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE runOpenPanelForFileButtonWithResultListener(
+ /* [in] */ IWebView*,
+ /* [in] */ IWebOpenPanelResultListener*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE mouseDidMoveOverElement(
+ /* [in] */ IWebView*,
+ /* [in] */ IPropertyBag*,
+ /* [in] */ UINT /*modifierFlags*/) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE contextMenuItemsForElement(
+ /* [in] */ IWebView*,
+ /* [in] */ IPropertyBag*,
+ /* [in] */ OLE_HANDLE,
+ /* [retval][out] */ OLE_HANDLE*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE validateUserInterfaceItem(
+ /* [in] */ IWebView*,
+ /* [in] */ UINT,
+ /* [in] */ BOOL,
+ /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE shouldPerformAction(
+ /* [in] */ IWebView*,
+ /* [in] */ UINT /*itemCommandID*/,
+ /* [in] */ UINT /*sender*/) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE willPerformDragDestinationAction(
+ /* [in] */ IWebView*,
+ /* [in] */ WebDragDestinationAction,
+ /* [in] */ IDataObject*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE dragSourceActionMaskForPoint(
+ /* [in] */ IWebView*,
+ /* [in] */ LPPOINT,
+ /* [retval][out] */ WebDragSourceAction*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE willPerformDragSourceAction(
+ /* [in] */ IWebView*,
+ /* [in] */ WebDragSourceAction,
+ /* [in] */ LPPOINT,
+ /* [in] */ IDataObject*,
+ /* [retval][out] */ IDataObject**) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE contextMenuItemSelected(
+ /* [in] */ IWebView*,
+ /* [in] */ void* /*item*/,
+ /* [in] */ IPropertyBag*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE hasCustomMenuImplementation(
+ /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE trackCustomPopupMenu(
+ /* [in] */ IWebView*,
+ /* [in] */ OLE_HANDLE,
+ /* [in] */ LPPOINT) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE measureCustomMenuItem(
+ /* [in] */ IWebView*,
+ /* [in] */ void* /*measureItem*/) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE drawCustomMenuItem(
+ /* [in] */ IWebView*,
+ /* [in] */ void* /*drawItem*/) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE addCustomMenuDrawingData(
+ /* [in] */ IWebView*,
+ /* [in] */ OLE_HANDLE) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE cleanUpCustomMenuDrawingData(
+ /* [in] */ IWebView*,
+ /* [in] */ OLE_HANDLE) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE canTakeFocus(
+ /* [in] */ IWebView*,
+ /* [in] */ BOOL /*forward*/,
+ /* [out] */ BOOL*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE takeFocus(
+ /* [in] */ IWebView*,
+ /* [in] */ BOOL /*forward*/) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE registerUndoWithTarget(
+ /* [in] */ IWebUndoTarget*,
+ /* [in] */ BSTR /*actionName*/,
+ /* [in] */ IUnknown* /*actionArg*/) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE removeAllActionsWithTarget(
+ /* [in] */ IWebUndoTarget*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE setActionTitle(
+ /* [in] */ BSTR) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE undo() { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE redo() { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE canUndo(
+ /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE canRedo(
+ /* [retval][out] */ BOOL*) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE printFrame(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IWebFrame *frame) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE ftpDirectoryTemplatePath(
+ /* [in] */ IWebView *webView,
+ /* [retval][out] */ BSTR *path) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE webViewHeaderHeight(
+ /* [in] */ IWebView *webView,
+ /* [retval][out] */ float *result) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE webViewFooterHeight(
+ /* [in] */ IWebView *webView,
+ /* [retval][out] */ float *result) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE drawHeaderInRect(
+ /* [in] */ IWebView *webView,
+ /* [in] */ RECT *rect,
+ /* [in] */ OLE_HANDLE drawingContext) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE drawFooterInRect(
+ /* [in] */ IWebView *webView,
+ /* [in] */ RECT *rect,
+ /* [in] */ OLE_HANDLE drawingContext,
+ /* [in] */ UINT pageIndex,
+ /* [in] */ UINT pageCount) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE webViewPrintingMarginRect(
+ /* [in] */ IWebView *webView,
+ /* [retval][out] */ RECT *rect) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE canRunModal(
+ /* [in] */ IWebView *webView,
+ /* [retval][out] */ BOOL *canRunBoolean) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE createModalDialog(
+ /* [in] */ IWebView *sender,
+ /* [in] */ IWebURLRequest *request,
+ /* [retval][out] */ IWebView **newWebView) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE runModal(
+ /* [in] */ IWebView *webView) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE isMenuBarVisible(
+ /* [in] */ IWebView *webView,
+ /* [retval][out] */ BOOL *visible) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE setMenuBarVisible(
+ /* [in] */ IWebView *webView,
+ /* [in] */ BOOL visible) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE runDatabaseSizeLimitPrompt(
+ /* [in] */ IWebView *webView,
+ /* [in] */ BSTR displayName,
+ /* [in] */ IWebFrame *initiatedByFrame,
+ /* [retval][out] */ BOOL *allowed) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE paintCustomScrollbar(
+ /* [in] */ IWebView *webView,
+ /* [in] */ HDC hDC,
+ /* [in] */ RECT rect,
+ /* [in] */ WebScrollBarControlSize size,
+ /* [in] */ WebScrollbarControlState state,
+ /* [in] */ WebScrollbarControlPart pressedPart,
+ /* [in] */ BOOL vertical,
+ /* [in] */ float value,
+ /* [in] */ float proportion,
+ /* [in] */ WebScrollbarControlPartMask parts) { return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE paintCustomScrollCorner(
+ /* [in] */ IWebView *webView,
+ /* [in] */ HDC hDC,
+ /* [in] */ RECT rect) { return E_NOTIMPL; }
+
+private:
+ WebInspectorDelegate();
+
+ ULONG m_refCount;
+};
+
+#endif // WebInspectorDelegate_h