diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
commit | 1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch) | |
tree | 4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /WebKit/win/WebActionPropertyBag.cpp | |
parent | 9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff) | |
download | external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'WebKit/win/WebActionPropertyBag.cpp')
-rw-r--r-- | WebKit/win/WebActionPropertyBag.cpp | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/WebKit/win/WebActionPropertyBag.cpp b/WebKit/win/WebActionPropertyBag.cpp index 41f9ccc..5ebe4c1 100644 --- a/WebKit/win/WebActionPropertyBag.cpp +++ b/WebKit/win/WebActionPropertyBag.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,12 +25,12 @@ #include "config.h" #include "WebKitDLL.h" - -#include "IWebView.h" -#include "IWebPolicyDelegate.h" #include "WebActionPropertyBag.h" -#include "WebElementPropertyBag.h" + #include "COMPtr.h" +#include "DOMCoreClasses.h" +#include "WebElementPropertyBag.h" +#include "WebKit.h" #pragma warning(push, 0) #include <WebCore/BString.h> @@ -42,22 +42,27 @@ using namespace WebCore; // WebActionPropertyBag ------------------------------------------------ -WebActionPropertyBag::WebActionPropertyBag(const NavigationAction& action, Frame* frame) + +WebActionPropertyBag::WebActionPropertyBag(const NavigationAction& action, PassRefPtr<HTMLFormElement> form, PassRefPtr<Frame> frame) : m_refCount(0) - , m_action(action) + , m_action(action) + , m_form(form) , m_frame(frame) { + gClassCount++; + gClassNameCount.add("WebActionPropertyBag"); } WebActionPropertyBag::~WebActionPropertyBag() { + gClassCount--; + gClassNameCount.remove("WebActionPropertyBag"); } -WebActionPropertyBag* WebActionPropertyBag::createInstance(const NavigationAction& action, Frame* frame) +WebActionPropertyBag* WebActionPropertyBag::createInstance(const NavigationAction& action, PassRefPtr<HTMLFormElement> form, PassRefPtr<Frame> frame) { - WebActionPropertyBag* instance = new WebActionPropertyBag(action, frame); + WebActionPropertyBag* instance = new WebActionPropertyBag(action, form, frame); instance->AddRef(); - return instance; } @@ -77,12 +82,12 @@ HRESULT STDMETHODCALLTYPE WebActionPropertyBag::QueryInterface(REFIID riid, void return S_OK; } -ULONG STDMETHODCALLTYPE WebActionPropertyBag::AddRef(void) +ULONG STDMETHODCALLTYPE WebActionPropertyBag::AddRef() { return ++m_refCount; } -ULONG STDMETHODCALLTYPE WebActionPropertyBag::Release(void) +ULONG STDMETHODCALLTYPE WebActionPropertyBag::Release() { ULONG newRef = --m_refCount; if (!newRef) @@ -115,24 +120,28 @@ HRESULT STDMETHODCALLTYPE WebActionPropertyBag::Read(LPCOLESTR pszPropName, VARI V_VT(pVar) = VT_I4; V_I4(pVar) = m_action.type(); return S_OK; - } else if (isEqual(pszPropName, WebActionElementKey)) { + } + if (isEqual(pszPropName, WebActionElementKey)) { if (const MouseEvent* mouseEvent = findMouseEvent(m_action.event())) { IntPoint point(mouseEvent->clientX(), mouseEvent->clientY()); V_VT(pVar) = VT_UNKNOWN; V_UNKNOWN(pVar) = WebElementPropertyBag::createInstance(m_frame->eventHandler()->hitTestResultAtPoint(point, false)); return S_OK; } - } else if (isEqual(pszPropName, WebActionButtonKey)) { + } + if (isEqual(pszPropName, WebActionButtonKey)) { if (const MouseEvent* mouseEvent = findMouseEvent(m_action.event())) { V_VT(pVar) = VT_I4; V_I4(pVar) = mouseEvent->button(); return S_OK; } - } else if (isEqual(pszPropName, WebActionOriginalURLKey)) { + } + if (isEqual(pszPropName, WebActionOriginalURLKey)) { V_VT(pVar) = VT_BSTR; V_BSTR(pVar) = BString(m_action.url().string()).release(); return S_OK; - } else if (isEqual(pszPropName, WebActionModifierFlagsKey)) { + } + if (isEqual(pszPropName, WebActionModifierFlagsKey)) { if (const UIEventWithKeyState* keyEvent = findEventWithKeyState(const_cast<Event*>(m_action.event()))) { int modifiers = 0; @@ -148,6 +157,12 @@ HRESULT STDMETHODCALLTYPE WebActionPropertyBag::Read(LPCOLESTR pszPropName, VARI return S_OK; } } + if (isEqual(pszPropName, WebActionFormKey)) { + IDOMNode* form = DOMNode::createInstance(m_form.get()); + V_VT(pVar) = VT_UNKNOWN; + V_UNKNOWN(pVar) = form; + return S_OK; + } return E_INVALIDARG; } @@ -155,6 +170,6 @@ HRESULT STDMETHODCALLTYPE WebActionPropertyBag::Write(LPCOLESTR pszPropName, VAR { if (!pszPropName || !pVar) return E_POINTER; - VariantClear(pVar); + return E_FAIL; } |