WebKit2: Spelling and Grammar Checking: Make sure to remove the markings from the...
[WebKit-https.git] / Source / WebKit2 / WebProcess / WebPage / WebPage.h
1 /*
2  * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
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.
12  *
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.
24  */
25
26 #ifndef WebPage_h
27 #define WebPage_h
28
29 #include "APIObject.h"
30 #include "DrawingArea.h"
31 #include "FindController.h"
32 #include "GeolocationPermissionRequestManager.h"
33 #include "ImageOptions.h"
34 #include "InjectedBundlePageContextMenuClient.h"
35 #include "InjectedBundlePageEditorClient.h"
36 #include "InjectedBundlePageFormClient.h"
37 #include "InjectedBundlePageLoaderClient.h"
38 #include "InjectedBundlePagePolicyClient.h"
39 #include "InjectedBundlePageResourceLoadClient.h"
40 #include "InjectedBundlePageUIClient.h"
41 #include "MessageSender.h"
42 #include "Plugin.h"
43 #include "SandboxExtension.h"
44 #include "WebEditCommand.h"
45 #include <WebCore/DragData.h>
46 #include <WebCore/Editor.h>
47 #include <WebCore/FrameLoaderTypes.h>
48 #include <WebCore/IntRect.h>
49 #include <WebCore/ScrollTypes.h>
50 #include <WebCore/WebCoreKeyboardUIMode.h>
51 #include <wtf/HashMap.h>
52 #include <wtf/OwnPtr.h>
53 #include <wtf/PassRefPtr.h>
54 #include <wtf/RefPtr.h>
55 #include <wtf/text/WTFString.h>
56
57 #if ENABLE(TOUCH_EVENTS)
58 #include <WebCore/PlatformTouchEvent.h>
59 #endif
60
61 #if PLATFORM(MAC)
62 #include "DictionaryPopupInfo.h"
63 #include <wtf/RetainPtr.h>
64 OBJC_CLASS AccessibilityWebPageObject;
65 OBJC_CLASS NSDictionary;
66 OBJC_CLASS NSObject;
67 #endif
68
69 namespace CoreIPC {
70     class ArgumentDecoder;
71     class Connection;
72     class MessageID;
73 }
74
75 namespace WebCore {
76     class GraphicsContext;
77     class KeyboardEvent;
78     class Page;
79     class PrintContext;
80     class Range;
81     class ResourceRequest;
82     class SharedBuffer;
83     class VisibleSelection;
84     struct KeypressCommand;
85 }
86
87 namespace WebKit {
88
89 class DrawingArea;
90 class InjectedBundleBackForwardList;
91 class PageOverlay;
92 class PluginView;
93 class SessionState;
94 class WebContextMenu;
95 class WebContextMenuItemData;
96 class WebEvent;
97 class WebFrame;
98 class WebFullScreenManager;
99 class WebImage;
100 class WebInspector;
101 class WebKeyboardEvent;
102 class WebMouseEvent;
103 class WebOpenPanelResultListener;
104 class WebPageGroupProxy;
105 class WebPopupMenu;
106 class WebWheelEvent;
107 struct AttributedString;
108 struct PrintInfo;
109 struct TextInputState;
110 struct WebPageCreationParameters;
111 struct WebPreferencesStore;
112
113 #if ENABLE(GESTURE_EVENTS)
114 class WebGestureEvent;
115 #endif
116
117 #if ENABLE(TOUCH_EVENTS)
118 class WebTouchEvent;
119 #endif
120
121 class WebPage : public APIObject, public CoreIPC::MessageSender<WebPage> {
122 public:
123     static const Type APIType = TypeBundlePage;
124
125     static PassRefPtr<WebPage> create(uint64_t pageID, const WebPageCreationParameters&);
126     virtual ~WebPage();
127
128     // Used by MessageSender.
129     CoreIPC::Connection* connection() const;
130     uint64_t destinationID() const { return pageID(); }
131
132     void close();
133
134     WebCore::Page* corePage() const { return m_page.get(); }
135     uint64_t pageID() const { return m_pageID; }
136
137     void setSize(const WebCore::IntSize&);
138     const WebCore::IntSize& size() const { return m_viewSize; }
139     WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
140     
141     InjectedBundleBackForwardList* backForwardList();
142     DrawingArea* drawingArea() const { return m_drawingArea.get(); }
143
144     WebPageGroupProxy* pageGroup() const { return m_pageGroup.get(); }
145
146     void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
147
148     void scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
149
150 #if ENABLE(INSPECTOR)
151     WebInspector* inspector();
152 #endif
153
154 #if ENABLE(FULLSCREEN_API)
155     WebFullScreenManager* fullScreenManager();
156 #endif
157
158     // -- Called by the DrawingArea.
159     // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
160     void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
161     void drawPageOverlay(WebCore::GraphicsContext&, const WebCore::IntRect&);
162     void layoutIfNeeded();
163
164     // -- Called from WebCore clients.
165 #if PLATFORM(MAC)
166     bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*, bool saveCommands);
167 #elif !PLATFORM(GTK)
168     bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*);
169 #endif
170
171     void show();
172     String userAgent() const { return m_userAgent; }
173     WebCore::IntRect windowResizerRect() const;
174     WebCore::KeyboardUIMode keyboardUIMode();
175
176     WebEditCommand* webEditCommand(uint64_t);
177     void addWebEditCommand(uint64_t, WebEditCommand*);
178     void removeWebEditCommand(uint64_t);
179     bool isInRedo() const { return m_isInRedo; }
180
181     void setActivePopupMenu(WebPopupMenu*);
182     
183     WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
184     void setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener>);
185
186     // -- Called from WebProcess.
187     void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
188     CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
189
190     // -- InjectedBundle methods
191     void initializeInjectedBundleContextMenuClient(WKBundlePageContextMenuClient*);
192     void initializeInjectedBundleEditorClient(WKBundlePageEditorClient*);
193     void initializeInjectedBundleFormClient(WKBundlePageFormClient*);
194     void initializeInjectedBundleLoaderClient(WKBundlePageLoaderClient*);
195     void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClient*);
196     void initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClient*);
197     void initializeInjectedBundleUIClient(WKBundlePageUIClient*);
198
199     InjectedBundlePageContextMenuClient& injectedBundleContextMenuClient() { return m_contextMenuClient; }
200     InjectedBundlePageEditorClient& injectedBundleEditorClient() { return m_editorClient; }
201     InjectedBundlePageFormClient& injectedBundleFormClient() { return m_formClient; }
202     InjectedBundlePageLoaderClient& injectedBundleLoaderClient() { return m_loaderClient; }
203     InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
204     InjectedBundlePageResourceLoadClient& injectedBundleResourceLoadClient() { return m_resourceLoadClient; }
205     InjectedBundlePageUIClient& injectedBundleUIClient() { return m_uiClient; }
206
207     bool findStringFromInjectedBundle(const String&, FindOptions);
208
209     WebFrame* mainFrame() const { return m_mainFrame.get(); }
210     PassRefPtr<Plugin> createPlugin(const Plugin::Parameters&);
211
212     String renderTreeExternalRepresentation() const;
213     void executeEditingCommand(const String& commandName, const String& argument);
214     bool isEditingCommandEnabled(const String& commandName);
215     void clearMainFrameName();
216     void sendClose();
217
218     double textZoomFactor() const;
219     void setTextZoomFactor(double);
220     double pageZoomFactor() const;
221     void setPageZoomFactor(double);
222     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
223
224     void scaleWebView(double scale, const WebCore::IntPoint& origin);
225     double viewScaleFactor() const;
226
227     void setUseFixedLayout(bool);
228     void setFixedLayoutSize(const WebCore::IntSize&);
229
230     bool drawsBackground() const { return m_drawsBackground; }
231     bool drawsTransparentBackground() const { return m_drawsTransparentBackground; }
232
233     void stopLoading();
234     void stopLoadingFrame(uint64_t frameID);
235     void setDefersLoading(bool deferLoading);
236
237 #if USE(ACCELERATED_COMPOSITING)
238     void enterAcceleratedCompositingMode(WebCore::GraphicsLayer*);
239     void exitAcceleratedCompositingMode();
240 #endif
241
242 #if PLATFORM(MAC)
243     void addPluginView(PluginView*);
244     void removePluginView(PluginView*);
245
246     bool windowIsVisible() const { return m_windowIsVisible; }
247     const WebCore::IntRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; }
248     const WebCore::IntRect& viewFrameInWindowCoordinates() const { return m_viewFrameInWindowCoordinates; }
249 #elif PLATFORM(WIN)
250     HWND nativeWindow() const { return m_nativeWindow; }
251 #endif
252
253     bool windowIsFocused() const;
254     void installPageOverlay(PassRefPtr<PageOverlay>);
255     void uninstallPageOverlay(PageOverlay*);
256     bool hasPageOverlay() const { return m_pageOverlay; }
257     WebCore::IntRect windowToScreen(const WebCore::IntRect&);
258
259     PassRefPtr<WebImage> snapshotInViewCoordinates(const WebCore::IntRect&, ImageOptions);
260     PassRefPtr<WebImage> snapshotInDocumentCoordinates(const WebCore::IntRect&, ImageOptions);
261     PassRefPtr<WebImage> scaledSnapshotInDocumentCoordinates(const WebCore::IntRect&, double scaleFactor, ImageOptions);
262
263     static const WebEvent* currentEvent();
264
265     FindController& findController() { return m_findController; }
266     GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager; }
267
268     void pageDidScroll();
269 #if ENABLE(TILED_BACKING_STORE)
270     void pageDidRequestScroll(const WebCore::IntPoint&);
271     void setActualVisibleContentRect(const WebCore::IntRect&);
272
273     bool resizesToContentsEnabled() const { return !m_resizesToContentsLayoutSize.isEmpty(); }
274     WebCore::IntSize resizesToContentsLayoutSize() const { return m_resizesToContentsLayoutSize; }
275     void setResizesToContentsUsingLayoutSize(const WebCore::IntSize& targetLayoutSize);
276     void resizeToContentsIfNeeded();
277 #endif
278
279     WebContextMenu* contextMenu();
280     
281     bool hasLocalDataForURL(const WebCore::KURL&);
282     String cachedResponseMIMETypeForURL(const WebCore::KURL&);
283     
284     static bool canHandleRequest(const WebCore::ResourceRequest&);
285
286     class SandboxExtensionTracker {
287     public:
288         ~SandboxExtensionTracker();
289
290         void invalidate();
291
292         void beginLoad(WebFrame*, const SandboxExtension::Handle& handle);
293         void willPerformLoadDragDestinationAction(PassRefPtr<SandboxExtension> pendingDropSandboxExtension);
294         void didStartProvisionalLoad(WebFrame*);
295         void didCommitProvisionalLoad(WebFrame*);
296         void didFailProvisionalLoad(WebFrame*);
297
298     private:
299         void setPendingProvisionalSandboxExtension(PassRefPtr<SandboxExtension>);
300
301         RefPtr<SandboxExtension> m_pendingProvisionalSandboxExtension;
302         RefPtr<SandboxExtension> m_provisionalSandboxExtension;
303         RefPtr<SandboxExtension> m_committedSandboxExtension;
304     };
305
306     SandboxExtensionTracker& sandboxExtensionTracker() { return m_sandboxExtensionTracker; }
307
308 #if PLATFORM(MAC)
309     void registerUIProcessAccessibilityTokens(const CoreIPC::DataReference& elemenToken, const CoreIPC::DataReference& windowToken);
310     AccessibilityWebPageObject* accessibilityRemoteObject();
311     WebCore::IntPoint accessibilityPosition() const { return m_accessibilityPosition; }    
312     
313     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput);
314
315     void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, TextInputState& newState);
316     void confirmComposition(TextInputState& newState);
317     void insertText(const String& text, uint64_t replacementRangeStart, uint64_t replacementRangeEnd, bool& handled, TextInputState& newState);
318     void getMarkedRange(uint64_t& location, uint64_t& length);
319     void getSelectedRange(uint64_t& location, uint64_t& length);
320     void getAttributedSubstringFromRange(uint64_t location, uint64_t length, AttributedString&);
321     void characterIndexForPoint(const WebCore::IntPoint point, uint64_t& result);
322     void firstRectForCharacterRange(uint64_t location, uint64_t length, WebCore::IntRect& resultRect);
323     void executeKeypressCommands(const Vector<WebCore::KeypressCommand>&, bool& handled, TextInputState& newState);
324     void writeSelectionToPasteboard(const WTF::String& pasteboardName, const WTF::Vector<WTF::String>& pasteboardTypes, bool& result);
325     void readSelectionFromPasteboard(const WTF::String& pasteboardName, bool& result);
326     bool performNonEditingBehaviorForSelector(const String&);
327 #elif PLATFORM(WIN)
328     void confirmComposition(const String& compositionString);
329     void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
330     void firstRectForCharacterInSelectedRange(const uint64_t characterPosition, WebCore::IntRect& resultRect);
331     void getSelectedText(WTF::String&);
332
333     void gestureWillBegin(const WebCore::IntPoint&, bool& canBeginPanning);
334     void gestureDidScroll(const WebCore::IntSize&);
335     void gestureDidEnd();
336 #endif
337
338     // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
339     // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed.
340     void dummy(bool&);
341
342 #if PLATFORM(MAC)
343     void performDictionaryLookupForSelection(DictionaryPopupInfo::Type, WebCore::Frame*, const WebCore::VisibleSelection&);
344
345     bool isSpeaking();
346     void speak(const String&);
347     void stopSpeaking();
348
349     bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; }
350 #endif
351
352     void replaceSelectionWithText(WebCore::Frame*, const String&);
353 #if PLATFORM(WIN)
354     void performDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, const WebCore::DragDataMap&, uint32_t flags);
355 #else
356     void performDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, const WTF::String& dragStorageName, uint32_t flags, const SandboxExtension::Handle&);
357 #endif
358     void dragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation);
359
360     void willPerformLoadDragDestinationAction();
361
362     void beginPrinting(uint64_t frameID, const PrintInfo&);
363     void endPrinting();
364     void computePagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
365 #if PLATFORM(MAC) || PLATFORM(WIN)
366     void drawRectToPDF(uint64_t frameID, const WebCore::IntRect&, uint64_t callbackID);
367     void drawPagesToPDF(uint64_t frameID, uint32_t first, uint32_t count, uint64_t callbackID);
368 #endif
369
370     bool mainFrameHasCustomRepresentation() const;
371
372     void didChangeScrollOffsetForMainFrame();
373
374     bool canRunBeforeUnloadConfirmPanel() const { return m_canRunBeforeUnloadConfirmPanel; }
375     void setCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) { m_canRunBeforeUnloadConfirmPanel = canRunBeforeUnloadConfirmPanel; }
376
377     bool canRunModal() const { return m_canRunModal; }
378     void setCanRunModal(bool canRunModal) { m_canRunModal = canRunModal; }
379
380     void runModal();
381
382     float userSpaceScaleFactor() const { return m_userSpaceScaleFactor; }
383
384     void setMemoryCacheMessagesEnabled(bool);
385
386     void forceRepaintWithoutCallback();
387
388     void unmarkAllMisspellings();
389     void unmarkAllBadGrammar();
390
391 #if PLATFORM(MAC)
392     void setDragSource(NSObject *);
393 #endif
394
395 #if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD)
396     void handleCorrectionPanelResult(const String&);
397 #endif
398
399     void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
400     void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
401     void simulateMouseMotion(WebCore::IntPoint, double time);
402
403 private:
404     WebPage(uint64_t pageID, const WebPageCreationParameters&);
405
406     virtual Type type() const { return APIType; }
407
408     void platformInitialize();
409
410     void didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
411     CoreIPC::SyncReplyMode didReceiveSyncWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
412
413 #if !PLATFORM(MAC)
414     static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
415 #endif
416     bool performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&);
417
418 #if PLATFORM(MAC)
419     bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
420 #endif
421
422     String sourceForFrame(WebFrame*);
423
424     void loadData(PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::KURL& baseURL, const WebCore::KURL& failingURL);
425
426     bool platformHasLocalDataForURL(const WebCore::KURL&);
427
428     // Actions
429     void tryClose();
430     void loadURL(const String&, const SandboxExtension::Handle&);
431     void loadURLRequest(const WebCore::ResourceRequest&, const SandboxExtension::Handle&);
432     void loadHTMLString(const String& htmlString, const String& baseURL);
433     void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL);
434     void loadPlainTextString(const String&);
435     void linkClicked(const String& url, const WebMouseEvent&);
436     void reload(bool reloadFromOrigin);
437     void goForward(uint64_t, const SandboxExtension::Handle&);
438     void goBack(uint64_t, const SandboxExtension::Handle&);
439     void goToBackForwardItem(uint64_t, const SandboxExtension::Handle&);
440     void setActive(bool);
441     void setFocused(bool);
442     void setInitialFocus(bool);
443     void setWindowResizerSize(const WebCore::IntSize&);
444     void setIsInWindow(bool);
445     void validateCommand(const String&, uint64_t);
446     void executeEditCommand(const String&);
447
448     void mouseEvent(const WebMouseEvent&);
449     void wheelEvent(const WebWheelEvent&);
450     void keyEvent(const WebKeyboardEvent&);
451 #if ENABLE(GESTURE_EVENTS)
452     void gestureEvent(const WebGestureEvent&);
453 #endif
454 #if ENABLE(TOUCH_EVENTS)
455     void touchEvent(const WebTouchEvent&);
456 #endif
457
458     static void scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
459     static void logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
460
461     uint64_t restoreSession(const SessionState&);
462     void restoreSessionAndNavigateToCurrentItem(const SessionState&, const SandboxExtension::Handle&);
463
464     void didRemoveBackForwardItem(uint64_t);
465
466     void setDrawsBackground(bool);
467     void setDrawsTransparentBackground(bool);
468
469     void viewWillStartLiveResize();
470     void viewWillEndLiveResize();
471
472     void getContentsAsString(uint64_t callbackID);
473     void getMainResourceDataOfFrame(uint64_t frameID, uint64_t callbackID);
474     void getResourceDataFromFrame(uint64_t frameID, const String& resourceURL, uint64_t callbackID);
475     void getRenderTreeExternalRepresentation(uint64_t callbackID);
476     void getSelectionOrContentsAsString(uint64_t callbackID);
477     void getSourceForFrame(uint64_t frameID, uint64_t callbackID);
478     void getWebArchiveOfFrame(uint64_t frameID, uint64_t callbackID);
479     void runJavaScriptInMainFrame(const String&, uint64_t callbackID);
480     void forceRepaint(uint64_t callbackID);
481
482     void preferencesDidChange(const WebPreferencesStore&);
483     void platformPreferencesDidChange(const WebPreferencesStore&);
484     void updatePreferences(const WebPreferencesStore&);
485
486     void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID);
487     void setUserAgent(const String&);
488     void setCustomTextEncodingName(const String&);
489
490 #if PLATFORM(MAC)
491     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
492     void performDictionaryLookupForRange(DictionaryPopupInfo::Type, WebCore::Frame*, WebCore::Range*, NSDictionary *options);
493
494     void setWindowIsVisible(bool windowIsVisible);
495     void windowAndViewFramesChanged(const WebCore::IntRect& windowFrameInScreenCoordinates, const WebCore::IntRect& viewFrameInWindowCoordinates, const WebCore::IntPoint& accessibilityViewCoordinates);
496 #endif
497
498     void unapplyEditCommand(uint64_t commandID);
499     void reapplyEditCommand(uint64_t commandID);
500     void didRemoveEditCommand(uint64_t commandID);
501
502     void findString(const String&, uint32_t findOptions, uint32_t maxMatchCount);
503     void hideFindUI();
504     void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
505
506 #if PLATFORM(QT)
507     void findZoomableAreaForPoint(const WebCore::IntPoint&);
508 #endif
509
510     void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
511     void setTextForActivePopupMenu(int32_t index);
512
513     void didChooseFilesForOpenPanel(const Vector<String>&);
514     void didCancelForOpenPanel();
515 #if ENABLE(WEB_PROCESS_SANDBOX)
516     void extendSandboxForFileFromOpenPanel(const SandboxExtension::Handle&);
517 #endif
518
519     void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
520
521     void advanceToNextMisspelling(bool startBeforeSelection);
522     void changeSpellingToWord(const String& word);
523 #if PLATFORM(MAC)
524     void uppercaseWord();
525     void lowercaseWord();
526     void capitalizeWord();
527
528     void setSmartInsertDeleteEnabled(bool isSmartInsertDeleteEnabled) { m_isSmartInsertDeleteEnabled = isSmartInsertDeleteEnabled; }
529 #endif
530
531 #if ENABLE(CONTEXT_MENUS)
532     void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
533 #endif
534
535     void platformDragEnded();
536
537     static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
538
539     OwnPtr<WebCore::Page> m_page;
540     RefPtr<WebFrame> m_mainFrame;
541     RefPtr<InjectedBundleBackForwardList> m_backForwardList;
542
543     RefPtr<WebPageGroupProxy> m_pageGroup;
544
545     String m_userAgent;
546
547     WebCore::IntSize m_viewSize;
548     OwnPtr<DrawingArea> m_drawingArea;
549
550     bool m_drawsBackground;
551     bool m_drawsTransparentBackground;
552
553     bool m_isInRedo;
554     bool m_isClosed;
555
556     bool m_tabToLinks;
557
558 #if PLATFORM(MAC)
559     // Whether the containing window is visible or not.
560     bool m_windowIsVisible;
561
562     // Whether smart insert/delete is enabled or not.
563     bool m_isSmartInsertDeleteEnabled;
564
565     // The frame of the containing window in screen coordinates.
566     WebCore::IntRect m_windowFrameInScreenCoordinates;
567
568     // The frame of the view in window coordinates.
569     WebCore::IntRect m_viewFrameInWindowCoordinates;
570
571     // The accessibility position of the view.
572     WebCore::IntPoint m_accessibilityPosition;
573     
574     // All plug-in views on this web page.
575     HashSet<PluginView*> m_pluginViews;
576     
577     RetainPtr<AccessibilityWebPageObject> m_mockAccessibilityElement;
578
579     RetainPtr<NSObject> m_dragSource;
580
581     WebCore::KeyboardEvent* m_keyboardEventBeingInterpreted;
582
583 #elif PLATFORM(WIN)
584     // Our view's window (in the UI process).
585     HWND m_nativeWindow;
586
587     RefPtr<WebCore::Node> m_gestureTargetNode;
588 #endif
589     
590     HashMap<uint64_t, RefPtr<WebEditCommand> > m_editCommandMap;
591
592     WebCore::IntSize m_windowResizerSize;
593
594     InjectedBundlePageContextMenuClient m_contextMenuClient;
595     InjectedBundlePageEditorClient m_editorClient;
596     InjectedBundlePageFormClient m_formClient;
597     InjectedBundlePageLoaderClient m_loaderClient;
598     InjectedBundlePagePolicyClient m_policyClient;
599     InjectedBundlePageResourceLoadClient m_resourceLoadClient;
600     InjectedBundlePageUIClient m_uiClient;
601
602 #if ENABLE(TILED_BACKING_STORE)
603     WebCore::IntSize m_resizesToContentsLayoutSize;
604 #endif
605
606     FindController m_findController;
607     RefPtr<PageOverlay> m_pageOverlay;
608
609 #if ENABLE(INSPECTOR)
610     RefPtr<WebInspector> m_inspector;
611 #endif
612 #if ENABLE(FULLSCREEN_API)
613     RefPtr<WebFullScreenManager> m_fullScreenManager;
614 #endif
615     RefPtr<WebPopupMenu> m_activePopupMenu;
616     RefPtr<WebContextMenu> m_contextMenu;
617     RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
618     GeolocationPermissionRequestManager m_geolocationPermissionRequestManager;
619
620     OwnPtr<WebCore::PrintContext> m_printContext;
621
622     SandboxExtensionTracker m_sandboxExtensionTracker;
623     uint64_t m_pageID;
624
625     RefPtr<SandboxExtension> m_pendingDropSandboxExtension;
626
627     bool m_canRunBeforeUnloadConfirmPanel;
628
629     bool m_canRunModal;
630     bool m_isRunningModal;
631
632     float m_userSpaceScaleFactor;
633
634     bool m_cachedMainFrameIsPinnedToLeftSide;
635     bool m_cachedMainFrameIsPinnedToRightSide;
636
637 #if PLATFORM(WIN)
638     bool m_gestureReachedScrollingLimit;
639 #endif
640 };
641
642 } // namespace WebKit
643
644 #endif // WebPage_h