2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
29 #include "APIClient.h"
32 #include "WebOpenPanelParameters.h"
33 #include <wtf/Forward.h>
34 #include <wtf/PassRefPtr.h>
39 class ResourceRequest;
40 struct WindowFeatures;
46 class GeolocationPermissionRequestProxy;
47 class NativeWebKeyboardEvent;
48 class NativeWebWheelEvent;
52 class WebSecurityOrigin;
53 class WebOpenPanelResultListenerProxy;
55 class WebUIClient : public APIClient<WKPageUIClient, kWKPageUIClientCurrentVersion> {
57 PassRefPtr<WebPageProxy> createNewPage(WebPageProxy*, const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, WebEvent::Modifiers, WebMouseEvent::Button);
58 void showPage(WebPageProxy*);
59 void close(WebPageProxy*);
61 void takeFocus(WebPageProxy*, WKFocusDirection);
62 void focus(WebPageProxy*);
63 void unfocus(WebPageProxy*);
65 void runJavaScriptAlert(WebPageProxy*, const String&, WebFrameProxy*);
66 bool runJavaScriptConfirm(WebPageProxy*, const String&, WebFrameProxy*);
67 String runJavaScriptPrompt(WebPageProxy*, const String&, const String&, WebFrameProxy*);
69 void setStatusText(WebPageProxy*, const String&);
70 void mouseDidMoveOverElement(WebPageProxy*, WebEvent::Modifiers, APIObject*);
71 void missingPluginButtonClicked(WebPageProxy*, const String& mimeType, const String& url, const String& pluginsPageURL);
73 bool implementsDidNotHandleKeyEvent() const;
74 void didNotHandleKeyEvent(WebPageProxy*, const NativeWebKeyboardEvent&);
76 bool implementsDidNotHandleWheelEvent() const;
77 void didNotHandleWheelEvent(WebPageProxy*, const NativeWebWheelEvent&);
79 bool toolbarsAreVisible(WebPageProxy*);
80 void setToolbarsAreVisible(WebPageProxy*, bool);
81 bool menuBarIsVisible(WebPageProxy*);
82 void setMenuBarIsVisible(WebPageProxy*, bool);
83 bool statusBarIsVisible(WebPageProxy*);
84 void setStatusBarIsVisible(WebPageProxy*, bool);
85 bool isResizable(WebPageProxy*);
86 void setIsResizable(WebPageProxy*, bool);
88 void setWindowFrame(WebPageProxy*, const WebCore::FloatRect&);
89 WebCore::FloatRect windowFrame(WebPageProxy*);
91 bool canRunBeforeUnloadConfirmPanel() const;
92 bool runBeforeUnloadConfirmPanel(WebPageProxy*, const String&, WebFrameProxy*);
94 void didDraw(WebPageProxy*);
95 void pageDidScroll(WebPageProxy*);
97 unsigned long long exceededDatabaseQuota(WebPageProxy*, WebFrameProxy*, WebSecurityOrigin*, const String& databaseName, const String& databaseDisplayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage);
99 bool runOpenPanel(WebPageProxy*, WebFrameProxy*, const WebOpenPanelParameters::Data&, WebOpenPanelResultListenerProxy*);
100 bool decidePolicyForGeolocationPermissionRequest(WebPageProxy*, WebFrameProxy*, WebSecurityOrigin*, GeolocationPermissionRequestProxy*);
103 float headerHeight(WebPageProxy*, WebFrameProxy*);
104 float footerHeight(WebPageProxy*, WebFrameProxy*);
105 void drawHeader(WebPageProxy*, WebFrameProxy*, const WebCore::FloatRect&);
106 void drawFooter(WebPageProxy*, WebFrameProxy*, const WebCore::FloatRect&);
107 void printFrame(WebPageProxy*, WebFrameProxy*);
109 bool canRunModal() const;
110 void runModal(WebPageProxy*);
112 void didCompleteRubberBandForMainFrame(WebPageProxy*, const WebCore::IntSize&);
114 void saveDataToFileInDownloadsFolder(WebPageProxy*, const String& suggestedFilename, const String& mimeType, const String& originatingURLString, WebData*);
116 bool shouldInterruptJavaScript(WebPageProxy*);
119 } // namespace WebKit
121 #endif // WebUIClient_h