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 /WebKitTools/DumpRenderTree/win/EventSender.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 'WebKitTools/DumpRenderTree/win/EventSender.cpp')
-rw-r--r-- | WebKitTools/DumpRenderTree/win/EventSender.cpp | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/WebKitTools/DumpRenderTree/win/EventSender.cpp b/WebKitTools/DumpRenderTree/win/EventSender.cpp index 66d8772..efecc03 100644 --- a/WebKitTools/DumpRenderTree/win/EventSender.cpp +++ b/WebKitTools/DumpRenderTree/win/EventSender.cpp @@ -26,18 +26,18 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "DumpRenderTree.h" +#include "config.h" #include "EventSender.h" #include "DraggingInfo.h" +#include "DumpRenderTree.h" #include <WebCore/COMPtr.h> #include <wtf/ASCIICType.h> #include <wtf/Platform.h> #include <JavaScriptCore/JavaScriptCore.h> #include <JavaScriptCore/Assertions.h> -#include <WebKit/IWebFrame.h> -#include <WebKit/IWebFramePrivate.h> +#include <WebKit/WebKit.h> #include <windows.h> #define WM_DRT_SEND_QUEUED_EVENT (WM_APP+1) @@ -485,8 +485,8 @@ static JSValueRef textZoomInCallback(JSContextRef context, JSObjectRef function, if (FAILED(frame->webView(&webView))) return JSValueMakeUndefined(context); - COMPtr<IWebIBActions> webIBActions; - if (FAILED(webView->QueryInterface(IID_IWebIBActions, (void**)&webIBActions))) + COMPtr<IWebIBActions> webIBActions(Query, webView); + if (!webIBActions) return JSValueMakeUndefined(context); webIBActions->makeTextLarger(0); @@ -499,14 +499,42 @@ static JSValueRef textZoomOutCallback(JSContextRef context, JSObjectRef function if (FAILED(frame->webView(&webView))) return JSValueMakeUndefined(context); - COMPtr<IWebIBActions> webIBActions; - if (FAILED(webView->QueryInterface(IID_IWebIBActions, (void**)&webIBActions))) + COMPtr<IWebIBActions> webIBActions(Query, webView); + if (!webIBActions) return JSValueMakeUndefined(context); webIBActions->makeTextSmaller(0); return JSValueMakeUndefined(context); } +static JSValueRef zoomPageInCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + COMPtr<IWebView> webView; + if (FAILED(frame->webView(&webView))) + return JSValueMakeUndefined(context); + + COMPtr<IWebIBActions> webIBActions(Query, webView); + if (!webIBActions) + return JSValueMakeUndefined(context); + + webIBActions->zoomPageIn(0); + return JSValueMakeUndefined(context); +} + +static JSValueRef zoomPageOutCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + COMPtr<IWebView> webView; + if (FAILED(frame->webView(&webView))) + return JSValueMakeUndefined(context); + + COMPtr<IWebIBActions> webIBActions(Query, webView); + if (!webIBActions) + return JSValueMakeUndefined(context); + + webIBActions->zoomPageOut(0); + return JSValueMakeUndefined(context); +} + static JSStaticFunction staticFunctions[] = { { "contextClick", contextClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "mouseDown", mouseDownCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, @@ -517,6 +545,8 @@ static JSStaticFunction staticFunctions[] = { { "dispatchMessage", dispatchMessageCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "textZoomIn", textZoomInCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "textZoomOut", textZoomOutCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "zoomPageIn", zoomPageInCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "zoomPageOut", zoomPageOutCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { 0, 0, 0 } }; |