2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Corporation. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
24 * THE POSSIBILITY OF SUCH DAMAGE.
28 #include "WebPageProxy.h"
30 #include "AuthenticationChallengeProxy.h"
31 #include "AuthenticationDecisionListener.h"
32 #include "DataReference.h"
33 #include "DownloadProxy.h"
34 #include "DrawingAreaProxy.h"
35 #include "EventDispatcherMessages.h"
36 #include "FindIndicator.h"
38 #include "MessageID.h"
39 #include "NativeWebKeyboardEvent.h"
40 #include "NativeWebMouseEvent.h"
41 #include "NativeWebWheelEvent.h"
42 #include "NotificationPermissionRequest.h"
43 #include "NotificationPermissionRequestManager.h"
44 #include "PageClient.h"
45 #include "PrintInfo.h"
46 #include "SessionState.h"
47 #include "StringPairVector.h"
48 #include "TextChecker.h"
49 #include "TextCheckerState.h"
50 #include "WKContextPrivate.h"
51 #include "WebBackForwardList.h"
52 #include "WebBackForwardListItem.h"
53 #include "WebCertificateInfo.h"
54 #include "WebContext.h"
55 #include "WebContextMenuProxy.h"
56 #include "WebContextUserMessageCoders.h"
57 #include "WebCoreArgumentCoders.h"
59 #include "WebEditCommandProxy.h"
61 #include "WebFormSubmissionListenerProxy.h"
62 #include "WebFramePolicyListenerProxy.h"
63 #include "WebFullScreenManagerProxy.h"
64 #include "WebInspectorProxy.h"
65 #include "WebNotificationManagerProxy.h"
66 #include "WebOpenPanelResultListenerProxy.h"
67 #include "WebPageCreationParameters.h"
68 #include "WebPageGroup.h"
69 #include "WebPageGroupData.h"
70 #include "WebPageMessages.h"
71 #include "WebPopupItem.h"
72 #include "WebPopupMenuProxy.h"
73 #include "WebPreferences.h"
74 #include "WebProcessMessages.h"
75 #include "WebProcessProxy.h"
76 #include "WebProtectionSpace.h"
77 #include "WebSecurityOrigin.h"
78 #include "WebURLRequest.h"
79 #include <WebCore/DragController.h>
80 #include <WebCore/DragData.h>
81 #include <WebCore/DragSession.h>
82 #include <WebCore/FloatRect.h>
83 #include <WebCore/FocusDirection.h>
84 #include <WebCore/MIMETypeRegistry.h>
85 #include <WebCore/TextCheckerClient.h>
86 #include <WebCore/WindowFeatures.h>
89 #if USE(UI_SIDE_COMPOSITING)
90 #include "LayerTreeHostProxyMessages.h"
94 #include "ArgumentCodersQt.h"
98 #include "ArgumentCodersGtk.h"
102 #include <wtf/RefCountedLeakCounter.h>
105 #if ENABLE(TIZEN_ISF_PORT)
106 #include <WebCore/Logging.h>
109 // This controls what strategy we use for mouse wheel coalescing.
110 #define MERGE_WHEEL_EVENTS 1
112 #define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, m_process->connection())
113 #define MESSAGE_CHECK_URL(url) MESSAGE_CHECK_BASE(m_process->checkURLReceivedFromWebProcess(url), m_process->connection())
115 using namespace WebCore;
117 // Represents the number of wheel events we can hold in the queue before we start pushing them preemptively.
118 static const unsigned wheelEventQueueSizeThreshold = 10;
122 WKPageDebugPaintFlags WebPageProxy::s_debugPaintFlags = 0;
124 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, webPageProxyCounter, ("WebPageProxy"));
127 static const char* webKeyboardEventTypeString(WebEvent::Type type)
130 case WebEvent::KeyDown:
133 case WebEvent::KeyUp:
136 case WebEvent::RawKeyDown:
143 ASSERT_NOT_REACHED();
147 #endif // !LOG_DISABLED
149 PassRefPtr<WebPageProxy> WebPageProxy::create(PageClient* pageClient, PassRefPtr<WebProcessProxy> process, WebPageGroup* pageGroup, uint64_t pageID)
151 return adoptRef(new WebPageProxy(pageClient, process, pageGroup, pageID));
154 WebPageProxy::WebPageProxy(PageClient* pageClient, PassRefPtr<WebProcessProxy> process, WebPageGroup* pageGroup, uint64_t pageID)
155 : m_pageClient(pageClient)
157 , m_pageGroup(pageGroup)
159 , m_userAgent(standardUserAgent())
160 , m_geolocationPermissionRequestManager(this)
161 , m_notificationPermissionRequestManager(this)
162 #if ENABLE(TIZEN_MEDIA_STREAM)
163 , m_userMediaPermissionRequestManager(this)
165 , m_estimatedProgress(0)
166 , m_isInWindow(m_pageClient->isViewInWindow())
167 , m_isVisible(m_pageClient->isViewVisible())
168 , m_backForwardList(WebBackForwardList::create(this))
169 , m_loadStateAtProcessExit(WebFrameProxy::LoadStateFinished)
170 , m_textZoomFactor(1)
171 , m_pageZoomFactor(1)
172 , m_pageScaleFactor(1)
173 , m_intrinsicDeviceScaleFactor(1)
174 , m_customDeviceScaleFactor(0)
175 #if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
176 , m_layerHostingMode(LayerHostingModeInWindowServer)
178 , m_layerHostingMode(LayerHostingModeDefault)
180 , m_drawsBackground(true)
181 , m_drawsTransparentBackground(false)
182 , m_areMemoryCacheClientCallsEnabled(true)
183 , m_useFixedLayout(false)
184 , m_paginationMode(Page::Pagination::Unpaginated)
185 , m_paginationBehavesLikeColumns(false)
187 , m_gapBetweenPages(0)
190 , m_isInPrintingMode(false)
191 , m_isPerformingDOMPrintOperation(false)
192 , m_inDecidePolicyForResponse(false)
193 , m_syncMimeTypePolicyActionIsValid(false)
194 , m_syncMimeTypePolicyAction(PolicyUse)
195 , m_syncMimeTypePolicyDownloadID(0)
196 , m_inDecidePolicyForNavigationAction(false)
197 , m_syncNavigationActionPolicyActionIsValid(false)
198 , m_syncNavigationActionPolicyAction(PolicyUse)
199 , m_syncNavigationActionPolicyDownloadID(0)
200 , m_processingMouseMoveEvent(false)
201 #if ENABLE(TOUCH_EVENTS)
202 , m_needTouchEvents(false)
205 , m_isPageSuspended(false)
207 , m_isSmartInsertDeleteEnabled(TextChecker::isSmartInsertDeleteEnabled())
209 , m_spellDocumentTag(0)
210 , m_hasSpellDocumentTag(false)
211 , m_pendingLearnOrIgnoreWordMessageCount(0)
212 , m_mainFrameHasCustomRepresentation(false)
213 , m_mainFrameHasHorizontalScrollbar(false)
214 , m_mainFrameHasVerticalScrollbar(false)
215 , m_canShortCircuitHorizontalWheelEvents(true)
216 , m_mainFrameIsPinnedToLeftSide(false)
217 , m_mainFrameIsPinnedToRightSide(false)
219 , m_renderTreeSize(0)
220 , m_shouldSendEventsSynchronously(false)
222 #if ENABLE(PAGE_VISIBILITY_API)
223 , m_visibilityState(PageVisibilityStateVisible)
227 webPageProxyCounter.increment();
230 WebContext::statistics().wkPageCount++;
232 m_pageGroup->addPage(this);
235 WebPageProxy::~WebPageProxy()
240 WebContext::statistics().wkPageCount--;
242 if (m_hasSpellDocumentTag)
243 TextChecker::closeSpellDocumentWithTag(m_spellDocumentTag);
245 m_pageGroup->removePage(this);
248 webPageProxyCounter.decrement();
252 WebProcessProxy* WebPageProxy::process() const
254 return m_process.get();
257 PlatformProcessIdentifier WebPageProxy::processIdentifier() const
262 return m_process->processIdentifier();
265 bool WebPageProxy::isValid()
267 // A page that has been explicitly closed is never valid.
274 void WebPageProxy::initializeLoaderClient(const WKPageLoaderClient* loadClient)
276 m_loaderClient.initialize(loadClient);
281 process()->send(Messages::WebPage::SetWillGoToBackForwardItemCallbackEnabled(loadClient->version > 0), m_pageID);
284 void WebPageProxy::initializePolicyClient(const WKPagePolicyClient* policyClient)
286 m_policyClient.initialize(policyClient);
289 void WebPageProxy::initializeFormClient(const WKPageFormClient* formClient)
291 m_formClient.initialize(formClient);
294 void WebPageProxy::initializeResourceLoadClient(const WKPageResourceLoadClient* client)
296 m_resourceLoadClient.initialize(client);
299 void WebPageProxy::initializeUIClient(const WKPageUIClient* client)
304 m_uiClient.initialize(client);
306 process()->send(Messages::WebPage::SetCanRunBeforeUnloadConfirmPanel(m_uiClient.canRunBeforeUnloadConfirmPanel()), m_pageID);
307 process()->send(Messages::WebPage::SetCanRunModal(m_uiClient.canRunModal()), m_pageID);
310 void WebPageProxy::initializeFindClient(const WKPageFindClient* client)
312 m_findClient.initialize(client);
315 #if ENABLE(CONTEXT_MENUS)
316 void WebPageProxy::initializeContextMenuClient(const WKPageContextMenuClient* client)
318 m_contextMenuClient.initialize(client);
322 void WebPageProxy::reattachToWebProcess()
328 m_process = m_process->context()->relaunchProcessIfNecessary();
329 process()->addExistingWebPage(this, m_pageID);
333 m_pageClient->didRelaunchProcess();
334 m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
337 void WebPageProxy::reattachToWebProcessWithItem(WebBackForwardListItem* item)
339 if (item && item != m_backForwardList->currentItem())
340 m_backForwardList->goToItem(item);
342 reattachToWebProcess();
347 process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
348 process()->responsivenessTimer()->start();
351 void WebPageProxy::initializeWebPage()
355 BackForwardListItemVector items = m_backForwardList->entries();
356 for (size_t i = 0; i < items.size(); ++i)
357 process()->registerNewWebBackForwardListItem(items[i].get());
359 m_drawingArea = m_pageClient->createDrawingAreaProxy();
360 ASSERT(m_drawingArea);
362 #if ENABLE(INSPECTOR_SERVER)
363 if (m_pageGroup->preferences()->developerExtrasEnabled())
364 inspector()->enableRemoteInspection();
367 process()->send(Messages::WebProcess::CreateWebPage(m_pageID, creationParameters()), 0);
369 #if ENABLE(PAGE_VISIBILITY_API)
370 process()->send(Messages::WebPage::SetVisibilityState(m_visibilityState, /* isInitialState */ true), m_pageID);
374 void WebPageProxy::close()
381 m_backForwardList->pageClosed();
382 m_pageClient->pageClosed();
384 process()->disconnectFramesFromPage(this);
387 #if ENABLE(INSPECTOR)
389 m_inspector->invalidate();
394 #if ENABLE(FULLSCREEN_API)
395 if (m_fullScreenManager) {
396 m_fullScreenManager->invalidate();
397 m_fullScreenManager = 0;
401 if (m_openPanelResultListener) {
402 m_openPanelResultListener->invalidate();
403 m_openPanelResultListener = 0;
406 #if ENABLE(INPUT_TYPE_COLOR)
407 if (m_colorChooser) {
408 m_colorChooser->invalidate();
409 m_colorChooser = nullptr;
413 #if ENABLE(GEOLOCATION)
414 m_geolocationPermissionRequestManager.invalidateRequests();
417 m_notificationPermissionRequestManager.invalidateRequests();
418 #if ENABLE(TIZEN_MEDIA_STREAM)
419 m_userMediaPermissionRequestManager.invalidateRequests();
422 m_toolTip = String();
424 m_mainFrameHasHorizontalScrollbar = false;
425 m_mainFrameHasVerticalScrollbar = false;
427 m_mainFrameIsPinnedToLeftSide = false;
428 m_mainFrameIsPinnedToRightSide = false;
430 m_visibleScrollerThumbRect = IntRect();
432 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
433 invalidateCallbackMap(m_booleanCallbacks);
435 invalidateCallbackMap(m_voidCallbacks);
436 invalidateCallbackMap(m_dataCallbacks);
437 invalidateCallbackMap(m_stringCallbacks);
438 m_loadDependentStringCallbackIDs.clear();
439 invalidateCallbackMap(m_scriptValueCallbacks);
440 invalidateCallbackMap(m_computedPagesCallbacks);
442 invalidateCallbackMap(m_printFinishedCallbacks);
445 Vector<WebEditCommandProxy*> editCommandVector;
446 copyToVector(m_editCommandSet, editCommandVector);
447 m_editCommandSet.clear();
448 for (size_t i = 0, size = editCommandVector.size(); i < size; ++i)
449 editCommandVector[i]->invalidate();
451 m_activePopupMenu = 0;
453 m_estimatedProgress = 0.0;
455 m_loaderClient.initialize(0);
456 m_policyClient.initialize(0);
457 m_uiClient.initialize(0);
459 m_drawingArea = nullptr;
461 process()->send(Messages::WebPage::Close(), m_pageID);
462 process()->removeWebPage(m_pageID);
465 bool WebPageProxy::tryClose()
470 process()->send(Messages::WebPage::TryClose(), m_pageID);
471 process()->responsivenessTimer()->start();
475 bool WebPageProxy::maybeInitializeSandboxExtensionHandle(const KURL& url, SandboxExtension::Handle& sandboxExtensionHandle)
477 if (!url.isLocalFile())
480 #if ENABLE(INSPECTOR)
481 // Don't give the inspector full access to the file system.
482 if (WebInspectorProxy::isInspectorPage(this))
486 SandboxExtension::createHandle("/", SandboxExtension::ReadOnly, sandboxExtensionHandle);
490 void WebPageProxy::loadURL(const String& url)
492 setPendingAPIRequestURL(url);
495 reattachToWebProcess();
497 SandboxExtension::Handle sandboxExtensionHandle;
498 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), url), sandboxExtensionHandle);
499 if (createdExtension)
500 process()->willAcquireUniversalFileReadSandboxExtension();
501 process()->send(Messages::WebPage::LoadURL(url, sandboxExtensionHandle), m_pageID);
502 process()->responsivenessTimer()->start();
505 void WebPageProxy::loadURLRequest(WebURLRequest* urlRequest)
507 setPendingAPIRequestURL(urlRequest->resourceRequest().url());
510 reattachToWebProcess();
512 SandboxExtension::Handle sandboxExtensionHandle;
513 bool createdExtension = maybeInitializeSandboxExtensionHandle(urlRequest->resourceRequest().url(), sandboxExtensionHandle);
514 if (createdExtension)
515 process()->willAcquireUniversalFileReadSandboxExtension();
516 process()->send(Messages::WebPage::LoadURLRequest(urlRequest->resourceRequest(), sandboxExtensionHandle), m_pageID);
517 process()->responsivenessTimer()->start();
520 void WebPageProxy::loadHTMLString(const String& htmlString, const String& baseURL)
523 reattachToWebProcess();
525 process()->assumeReadAccessToBaseURL(baseURL);
526 process()->send(Messages::WebPage::LoadHTMLString(htmlString, baseURL), m_pageID);
527 process()->responsivenessTimer()->start();
530 void WebPageProxy::loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL)
533 reattachToWebProcess();
536 m_mainFrame->setUnreachableURL(unreachableURL);
538 process()->assumeReadAccessToBaseURL(baseURL);
539 process()->send(Messages::WebPage::LoadAlternateHTMLString(htmlString, baseURL, unreachableURL), m_pageID);
540 process()->responsivenessTimer()->start();
543 void WebPageProxy::loadPlainTextString(const String& string)
546 reattachToWebProcess();
548 process()->send(Messages::WebPage::LoadPlainTextString(string), m_pageID);
549 process()->responsivenessTimer()->start();
552 void WebPageProxy::loadWebArchiveData(const WebData* webArchiveData)
555 reattachToWebProcess();
557 process()->send(Messages::WebPage::LoadWebArchiveData(webArchiveData->dataReference()), m_pageID);
558 process()->responsivenessTimer()->start();
562 void WebPageProxy::loadContentsbyMimeType(const WebData* contents, const String& mimeType, const String& encoding, const String& baseURL)
565 reattachToWebProcess();
567 process()->assumeReadAccessToBaseURL(baseURL);
568 process()->send(Messages::WebPage::LoadContentsbyMimeType(contents->dataReference(), mimeType, encoding, baseURL), m_pageID);
569 process()->responsivenessTimer()->start();
573 void WebPageProxy::stopLoading()
578 process()->send(Messages::WebPage::StopLoading(), m_pageID);
579 process()->responsivenessTimer()->start();
582 void WebPageProxy::reload(bool reloadFromOrigin)
584 SandboxExtension::Handle sandboxExtensionHandle;
586 if (m_backForwardList->currentItem()) {
587 String url = m_backForwardList->currentItem()->url();
588 setPendingAPIRequestURL(url);
590 // We may not have an extension yet if back/forward list was reinstated after a WebProcess crash or a browser relaunch
591 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), url), sandboxExtensionHandle);
592 if (createdExtension)
593 process()->willAcquireUniversalFileReadSandboxExtension();
597 reattachToWebProcessWithItem(m_backForwardList->currentItem());
601 process()->send(Messages::WebPage::Reload(reloadFromOrigin, sandboxExtensionHandle), m_pageID);
602 process()->responsivenessTimer()->start();
605 void WebPageProxy::goForward()
607 if (isValid() && !canGoForward())
610 WebBackForwardListItem* forwardItem = m_backForwardList->forwardItem();
614 setPendingAPIRequestURL(forwardItem->url());
617 reattachToWebProcessWithItem(forwardItem);
621 process()->send(Messages::WebPage::GoForward(forwardItem->itemID()), m_pageID);
622 process()->responsivenessTimer()->start();
625 bool WebPageProxy::canGoForward() const
627 return m_backForwardList->forwardItem();
630 void WebPageProxy::goBack()
632 if (isValid() && !canGoBack())
635 WebBackForwardListItem* backItem = m_backForwardList->backItem();
639 setPendingAPIRequestURL(backItem->url());
642 reattachToWebProcessWithItem(backItem);
646 process()->send(Messages::WebPage::GoBack(backItem->itemID()), m_pageID);
647 process()->responsivenessTimer()->start();
650 bool WebPageProxy::canGoBack() const
652 return m_backForwardList->backItem();
655 void WebPageProxy::goToBackForwardItem(WebBackForwardListItem* item)
658 reattachToWebProcessWithItem(item);
662 setPendingAPIRequestURL(item->url());
664 process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
665 process()->responsivenessTimer()->start();
668 void WebPageProxy::tryRestoreScrollPosition()
673 process()->send(Messages::WebPage::TryRestoreScrollPosition(), m_pageID);
676 void WebPageProxy::didChangeBackForwardList(WebBackForwardListItem* added, Vector<RefPtr<APIObject> >* removed)
678 m_loaderClient.didChangeBackForwardList(this, added, removed);
681 void WebPageProxy::shouldGoToBackForwardListItem(uint64_t itemID, bool& shouldGoToBackForwardItem)
683 WebBackForwardListItem* item = process()->webBackForwardItem(itemID);
684 shouldGoToBackForwardItem = item && m_loaderClient.shouldGoToBackForwardListItem(this, item);
687 void WebPageProxy::willGoToBackForwardListItem(uint64_t itemID, CoreIPC::ArgumentDecoder* arguments)
689 RefPtr<APIObject> userData;
690 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
691 if (!arguments->decode(messageDecoder))
694 if (WebBackForwardListItem* item = process()->webBackForwardItem(itemID))
695 m_loaderClient.willGoToBackForwardListItem(this, item, userData.get());
698 String WebPageProxy::activeURL() const
700 // If there is a currently pending url, it is the active URL,
701 // even when there's no main frame yet, as it might be the
702 // first API request.
703 if (!m_pendingAPIRequestURL.isNull())
704 return m_pendingAPIRequestURL;
709 if (!m_mainFrame->unreachableURL().isEmpty())
710 return m_mainFrame->unreachableURL();
712 switch (m_mainFrame->loadState()) {
713 case WebFrameProxy::LoadStateProvisional:
714 return m_mainFrame->provisionalURL();
715 case WebFrameProxy::LoadStateCommitted:
716 case WebFrameProxy::LoadStateFinished:
717 return m_mainFrame->url();
720 ASSERT_NOT_REACHED();
724 String WebPageProxy::provisionalURL() const
728 return m_mainFrame->provisionalURL();
731 String WebPageProxy::committedURL() const
736 return m_mainFrame->url();
739 bool WebPageProxy::canShowMIMEType(const String& mimeType) const
741 if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType))
744 if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType))
747 if (mimeType.startsWith("text/", false))
748 return !MIMETypeRegistry::isUnsupportedTextMIMEType(mimeType);
750 #if ENABLE(TIZEN_FIX_PLUGIN_DOWNLOAD)
751 // check plugin mime types if the plugin option is enabled
752 if (arePluginsEnabled()) {
753 String newMimeType = mimeType;
754 PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL());
755 if (!plugin.path.isNull())
758 #else // ENABLE(TIZEN_FIX_PLUGIN_DOWNLOAD)
759 String newMimeType = mimeType;
760 PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL());
761 if (!plugin.path.isNull())
763 #endif // ENABLE(TIZEN_FIX_PLUGIN_DOWNLOAD)
768 void WebPageProxy::setDrawsBackground(bool drawsBackground)
770 if (m_drawsBackground == drawsBackground)
773 m_drawsBackground = drawsBackground;
776 process()->send(Messages::WebPage::SetDrawsBackground(drawsBackground), m_pageID);
779 void WebPageProxy::setDrawsTransparentBackground(bool drawsTransparentBackground)
781 if (m_drawsTransparentBackground == drawsTransparentBackground)
784 m_drawsTransparentBackground = drawsTransparentBackground;
787 process()->send(Messages::WebPage::SetDrawsTransparentBackground(drawsTransparentBackground), m_pageID);
790 void WebPageProxy::viewWillStartLiveResize()
794 process()->send(Messages::WebPage::ViewWillStartLiveResize(), m_pageID);
797 void WebPageProxy::viewWillEndLiveResize()
801 process()->send(Messages::WebPage::ViewWillEndLiveResize(), m_pageID);
804 void WebPageProxy::setViewNeedsDisplay(const IntRect& rect)
806 m_pageClient->setViewNeedsDisplay(rect);
809 void WebPageProxy::displayView()
811 m_pageClient->displayView();
814 void WebPageProxy::scrollView(const IntRect& scrollRect, const IntSize& scrollOffset)
816 m_pageClient->scrollView(scrollRect, scrollOffset);
819 void WebPageProxy::viewStateDidChange(ViewStateFlags flags)
824 if (flags & ViewIsFocused)
825 process()->send(Messages::WebPage::SetFocused(m_pageClient->isViewFocused()), m_pageID);
827 if (flags & ViewWindowIsActive)
828 process()->send(Messages::WebPage::SetActive(m_pageClient->isViewWindowActive()), m_pageID);
830 if (flags & ViewIsVisible) {
831 bool isVisible = m_pageClient->isViewVisible();
832 if (isVisible != m_isVisible) {
833 m_isVisible = isVisible;
834 m_drawingArea->visibilityDidChange();
837 // If we've started the responsiveness timer as part of telling the web process to update the backing store
838 // state, it might not send back a reply (since it won't paint anything if the web page is hidden) so we
839 // stop the unresponsiveness timer here.
840 process()->responsivenessTimer()->stop();
845 if (flags & ViewIsInWindow) {
846 bool isInWindow = m_pageClient->isViewInWindow();
847 if (m_isInWindow != isInWindow) {
848 m_isInWindow = isInWindow;
849 process()->send(Messages::WebPage::SetIsInWindow(isInWindow), m_pageID);
853 LayerHostingMode layerHostingMode = m_pageClient->viewLayerHostingMode();
854 if (m_layerHostingMode != layerHostingMode) {
855 m_layerHostingMode = layerHostingMode;
856 m_drawingArea->layerHostingModeDidChange();
861 #if ENABLE(PAGE_VISIBILITY_API)
862 PageVisibilityState visibilityState = PageVisibilityStateHidden;
864 if (m_pageClient->isViewVisible())
865 visibilityState = PageVisibilityStateVisible;
867 if (visibilityState != m_visibilityState) {
868 m_visibilityState = visibilityState;
869 process()->send(Messages::WebPage::SetVisibilityState(visibilityState, false), m_pageID);
873 updateBackingStoreDiscardableState();
876 IntSize WebPageProxy::viewSize() const
878 return m_pageClient->viewSize();
881 void WebPageProxy::setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent& keyboardEvent)
885 process()->send(Messages::WebPage::SetInitialFocus(forward, isKeyboardEventValid, keyboardEvent), m_pageID);
888 void WebPageProxy::setWindowResizerSize(const IntSize& windowResizerSize)
892 process()->send(Messages::WebPage::SetWindowResizerSize(windowResizerSize), m_pageID);
895 void WebPageProxy::clearSelection()
899 process()->send(Messages::WebPage::ClearSelection(), m_pageID);
902 void WebPageProxy::validateCommand(const String& commandName, PassRefPtr<ValidateCommandCallback> callback)
905 callback->invalidate();
909 uint64_t callbackID = callback->callbackID();
910 m_validateCommandCallbacks.set(callbackID, callback.get());
911 process()->send(Messages::WebPage::ValidateCommand(commandName, callbackID), m_pageID);
914 void WebPageProxy::setMaintainsInactiveSelection(bool newValue)
916 m_maintainsInactiveSelection = newValue;
919 void WebPageProxy::executeEditCommand(const String& commandName)
924 DEFINE_STATIC_LOCAL(String, ignoreSpellingCommandName, ("ignoreSpelling"));
925 if (commandName == ignoreSpellingCommandName)
926 ++m_pendingLearnOrIgnoreWordMessageCount;
928 process()->send(Messages::WebPage::ExecuteEditCommand(commandName), m_pageID);
931 #if USE(TILED_BACKING_STORE)
932 void WebPageProxy::setViewportSize(const IntSize& size)
937 process()->send(Messages::WebPage::SetViewportSize(size), m_pageID);
941 #if ENABLE(DRAG_SUPPORT)
942 void WebPageProxy::dragEntered(DragData* dragData, const String& dragStorageName)
944 SandboxExtension::Handle sandboxExtensionHandle;
945 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
946 performDragControllerAction(DragControllerActionEntered, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
949 void WebPageProxy::dragUpdated(DragData* dragData, const String& dragStorageName)
951 SandboxExtension::Handle sandboxExtensionHandle;
952 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
953 performDragControllerAction(DragControllerActionUpdated, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
956 void WebPageProxy::dragExited(DragData* dragData, const String& dragStorageName)
958 SandboxExtension::Handle sandboxExtensionHandle;
959 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
960 performDragControllerAction(DragControllerActionExited, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
963 void WebPageProxy::performDrag(DragData* dragData, const String& dragStorageName, const SandboxExtension::Handle& sandboxExtensionHandle, const SandboxExtension::HandleArray& sandboxExtensionsForUpload)
965 performDragControllerAction(DragControllerActionPerformDrag, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionsForUpload);
968 void WebPageProxy::performDragControllerAction(DragControllerAction action, DragData* dragData, const String& dragStorageName, const SandboxExtension::Handle& sandboxExtensionHandle, const SandboxExtension::HandleArray& sandboxExtensionsForUpload)
973 // FIXME: We should pass the drag data map only on DragEnter.
974 process()->send(Messages::WebPage::PerformDragControllerAction(action, dragData->clientPosition(), dragData->globalPosition(),
975 dragData->draggingSourceOperationMask(), dragData->dragDataMap(), dragData->flags()), m_pageID);
976 #elif PLATFORM(QT) || PLATFORM(GTK)
977 process()->send(Messages::WebPage::PerformDragControllerAction(action, *dragData), m_pageID);
979 process()->send(Messages::WebPage::PerformDragControllerAction(action, dragData->clientPosition(), dragData->globalPosition(), dragData->draggingSourceOperationMask(), dragStorageName, dragData->flags(), sandboxExtensionHandle, sandboxExtensionsForUpload), m_pageID);
983 void WebPageProxy::didPerformDragControllerAction(WebCore::DragSession dragSession)
985 m_currentDragSession = dragSession;
988 #if PLATFORM(QT) || PLATFORM(GTK)
989 void WebPageProxy::startDrag(const DragData& dragData, const ShareableBitmap::Handle& dragImageHandle)
991 RefPtr<ShareableBitmap> dragImage = 0;
992 if (!dragImageHandle.isNull()) {
993 dragImage = ShareableBitmap::create(dragImageHandle);
998 m_pageClient->startDrag(dragData, dragImage.release());
1002 void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& globalPosition, uint64_t operation)
1006 process()->send(Messages::WebPage::DragEnded(clientPosition, globalPosition, operation), m_pageID);
1008 #endif // ENABLE(DRAG_SUPPORT)
1010 void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event)
1015 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1016 if (isWaitingForJavaScriptPopupReply())
1020 // NOTE: This does not start the responsiveness timer because mouse move should not indicate interaction.
1021 if (event.type() != WebEvent::MouseMove)
1022 process()->responsivenessTimer()->start();
1024 if (m_processingMouseMoveEvent) {
1025 m_nextMouseMoveEvent = adoptPtr(new NativeWebMouseEvent(event));
1029 m_processingMouseMoveEvent = true;
1032 // <https://bugs.webkit.org/show_bug.cgi?id=57904> We need to keep track of the mouse down event in the case where we
1033 // display a popup menu for select elements. When the user changes the selected item,
1034 // we fake a mouse up event by using this stored down event. This event gets cleared
1035 // when the mouse up message is received from WebProcess.
1036 if (event.type() == WebEvent::MouseDown)
1037 m_currentlyProcessedMouseDownEvent = adoptPtr(new NativeWebMouseEvent(event));
1039 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
1040 // We have to hide text-selection's context menu when other area is clicked.
1041 // In case of normal context menu, it is hided by elm_ctxpopup's logic.
1042 if (event.type() == WebEvent::MouseDown)
1046 #if ENABLE(TIZEN_ISF_PORT)
1047 if (event.type() == WebEvent::MouseDown)
1048 m_pageClient->handleInputMethodMousePress();
1051 if (m_shouldSendEventsSynchronously) {
1052 bool handled = false;
1053 process()->sendSync(Messages::WebPage::MouseEventSyncForTesting(event), Messages::WebPage::MouseEventSyncForTesting::Reply(handled), m_pageID);
1054 didReceiveEvent(event.type(), handled);
1056 process()->send(Messages::WebPage::MouseEvent(event), m_pageID);
1059 #if MERGE_WHEEL_EVENTS
1060 static bool canCoalesce(const WebWheelEvent& a, const WebWheelEvent& b)
1062 if (a.position() != b.position())
1064 if (a.globalPosition() != b.globalPosition())
1066 if (a.modifiers() != b.modifiers())
1068 if (a.granularity() != b.granularity())
1071 if (a.phase() != b.phase())
1073 if (a.momentumPhase() != b.momentumPhase())
1075 if (a.hasPreciseScrollingDeltas() != b.hasPreciseScrollingDeltas())
1082 static WebWheelEvent coalesce(const WebWheelEvent& a, const WebWheelEvent& b)
1084 ASSERT(canCoalesce(a, b));
1086 FloatSize mergedDelta = a.delta() + b.delta();
1087 FloatSize mergedWheelTicks = a.wheelTicks() + b.wheelTicks();
1090 FloatSize mergedUnacceleratedScrollingDelta = a.unacceleratedScrollingDelta() + b.unacceleratedScrollingDelta();
1092 return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.directionInvertedFromDevice(), b.phase(), b.momentumPhase(), b.hasPreciseScrollingDeltas(), b.scrollCount(), mergedUnacceleratedScrollingDelta, b.modifiers(), b.timestamp());
1094 return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.modifiers(), b.timestamp());
1097 #endif // MERGE_WHEEL_EVENTS
1099 static WebWheelEvent coalescedWheelEvent(Deque<NativeWebWheelEvent>& queue, Vector<NativeWebWheelEvent>& coalescedEvents)
1101 ASSERT(!queue.isEmpty());
1102 ASSERT(coalescedEvents.isEmpty());
1104 #if MERGE_WHEEL_EVENTS
1105 NativeWebWheelEvent firstEvent = queue.takeFirst();
1106 coalescedEvents.append(firstEvent);
1108 WebWheelEvent event = firstEvent;
1109 while (!queue.isEmpty() && canCoalesce(event, queue.first())) {
1110 NativeWebWheelEvent firstEvent = queue.takeFirst();
1111 coalescedEvents.append(firstEvent);
1112 event = coalesce(event, firstEvent);
1117 while (!queue.isEmpty())
1118 coalescedEvents.append(queue.takeFirst());
1119 return coalescedEvents.last();
1123 void WebPageProxy::handleWheelEvent(const NativeWebWheelEvent& event)
1128 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1129 if (isWaitingForJavaScriptPopupReply())
1133 if (!m_currentlyProcessedWheelEvents.isEmpty()) {
1134 m_wheelEventQueue.append(event);
1135 if (m_wheelEventQueue.size() < wheelEventQueueSizeThreshold)
1137 // The queue has too many wheel events, so push a new event.
1140 if (!m_wheelEventQueue.isEmpty()) {
1141 processNextQueuedWheelEvent();
1145 OwnPtr<Vector<NativeWebWheelEvent> > coalescedWheelEvent = adoptPtr(new Vector<NativeWebWheelEvent>);
1146 coalescedWheelEvent->append(event);
1147 m_currentlyProcessedWheelEvents.append(coalescedWheelEvent.release());
1148 sendWheelEvent(event);
1151 void WebPageProxy::processNextQueuedWheelEvent()
1153 OwnPtr<Vector<NativeWebWheelEvent> > nextCoalescedEvent = adoptPtr(new Vector<NativeWebWheelEvent>);
1154 WebWheelEvent nextWheelEvent = coalescedWheelEvent(m_wheelEventQueue, *nextCoalescedEvent.get());
1155 m_currentlyProcessedWheelEvents.append(nextCoalescedEvent.release());
1156 sendWheelEvent(nextWheelEvent);
1159 void WebPageProxy::sendWheelEvent(const WebWheelEvent& event)
1161 process()->responsivenessTimer()->start();
1163 if (m_shouldSendEventsSynchronously) {
1164 bool handled = false;
1165 process()->sendSync(Messages::WebPage::WheelEventSyncForTesting(event), Messages::WebPage::WheelEventSyncForTesting::Reply(handled), m_pageID);
1166 didReceiveEvent(event.type(), handled);
1170 process()->send(Messages::EventDispatcher::WheelEvent(m_pageID, event, canGoBack(), canGoForward()), 0);
1173 void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event)
1178 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1179 if (isWaitingForJavaScriptPopupReply())
1183 LOG(KeyHandling, "WebPageProxy::handleKeyboardEvent: %s", webKeyboardEventTypeString(event.type()));
1185 m_keyEventQueue.append(event);
1187 process()->responsivenessTimer()->start();
1188 if (m_shouldSendEventsSynchronously) {
1189 bool handled = false;
1190 process()->sendSync(Messages::WebPage::KeyEventSyncForTesting(event), Messages::WebPage::KeyEventSyncForTesting::Reply(handled), m_pageID);
1191 didReceiveEvent(event.type(), handled);
1193 process()->send(Messages::WebPage::KeyEvent(event), m_pageID);
1196 #if ENABLE(GESTURE_EVENTS)
1197 void WebPageProxy::handleGestureEvent(const WebGestureEvent& event)
1202 m_gestureEventQueue.append(event);
1204 process()->responsivenessTimer()->start();
1205 process()->send(Messages::EventDispatcher::GestureEvent(m_pageID, event), 0);
1209 #if ENABLE(TOUCH_EVENTS)
1211 void WebPageProxy::handlePotentialActivation(const IntPoint& touchPoint, const IntSize& touchArea)
1213 process()->send(Messages::WebPage::HighlightPotentialActivation(touchPoint, touchArea), m_pageID);
1217 void WebPageProxy::handleTouchEvent(const NativeWebTouchEvent& event)
1222 // If the page is suspended, which should be the case during panning, pinching
1223 // and animation on the page itself (kinetic scrolling, tap to zoom) etc, then
1224 // we do not send any of the events to the page even if is has listeners.
1225 if (m_needTouchEvents && !m_isPageSuspended) {
1227 // Do not send the TouchMove event if last TouchMove is not processed yet.
1228 // TouchMove event will be sent too many times without below codes,
1229 // and it will affect Web Applications' performance.
1230 if (event.type() == WebEvent::TouchMove
1231 && !m_touchEventQueue.isEmpty()
1232 && m_touchEventQueue.last().forwardedEvent.type() == event.type())
1235 m_touchEventQueue.append(event);
1236 process()->responsivenessTimer()->start();
1237 if (m_shouldSendEventsSynchronously) {
1238 bool handled = false;
1239 process()->sendSync(Messages::WebPage::TouchEventSyncForTesting(event), Messages::WebPage::TouchEventSyncForTesting::Reply(handled), m_pageID);
1240 didReceiveEvent(event.type(), handled);
1242 process()->send(Messages::WebPage::TouchEvent(event), m_pageID);
1244 if (m_touchEventQueue.isEmpty()) {
1245 bool isEventHandled = false;
1246 m_pageClient->doneWithTouchEvent(event, isEventHandled);
1248 // We attach the incoming events to the newest queued event so that all
1249 // the events are delivered in the correct order when the event is dequed.
1250 QueuedTouchEvents& lastEvent = m_touchEventQueue.last();
1251 lastEvent.deferredTouchEvents.append(event);
1257 #if ENABLE(TIZEN_VIBRATION)
1258 void WebPageProxy::vibrate(uint64_t time)
1260 m_pageClient->vibrate(time);
1263 void WebPageProxy::cancelVibration()
1265 m_pageClient->cancelVibration();
1269 #if ENABLE(SCREEN_ORIENTATION_SUPPORT) && ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT)
1270 void WebPageProxy::lockOrientation(int willLockOrientation, bool& result)
1272 result = m_pageClient->lockOrientation(willLockOrientation);
1274 void WebPageProxy::unlockOrientation()
1276 m_pageClient->unlockOrientation();
1280 void WebPageProxy::scrollBy(ScrollDirection direction, ScrollGranularity granularity)
1285 process()->send(Messages::WebPage::ScrollBy(direction, granularity), m_pageID);
1288 void WebPageProxy::centerSelectionInVisibleArea()
1293 process()->send(Messages::WebPage::CenterSelectionInVisibleArea(), m_pageID);
1296 void WebPageProxy::receivedPolicyDecision(PolicyAction action, WebFrameProxy* frame, uint64_t listenerID)
1301 if (action == PolicyIgnore)
1302 clearPendingAPIRequestURL();
1304 uint64_t downloadID = 0;
1305 if (action == PolicyDownload) {
1306 // Create a download proxy.
1307 DownloadProxy* download = m_process->context()->createDownloadProxy();
1308 downloadID = download->downloadID();
1310 // Our design does not suppport downloads without a WebPage.
1311 handleDownloadRequest(download);
1315 // If we received a policy decision while in decidePolicyForResponse the decision will
1316 // be sent back to the web process by decidePolicyForResponse.
1317 if (m_inDecidePolicyForResponse) {
1318 m_syncMimeTypePolicyActionIsValid = true;
1319 m_syncMimeTypePolicyAction = action;
1320 m_syncMimeTypePolicyDownloadID = downloadID;
1324 // If we received a policy decision while in decidePolicyForNavigationAction the decision will
1325 // be sent back to the web process by decidePolicyForNavigationAction.
1326 if (m_inDecidePolicyForNavigationAction) {
1327 m_syncNavigationActionPolicyActionIsValid = true;
1328 m_syncNavigationActionPolicyAction = action;
1329 m_syncNavigationActionPolicyDownloadID = downloadID;
1333 process()->send(Messages::WebPage::DidReceivePolicyDecision(frame->frameID(), listenerID, action, downloadID), m_pageID);
1336 String WebPageProxy::pageTitle() const
1338 // Return the null string if there is no main frame (e.g. nothing has been loaded in the page yet, WebProcess has
1339 // crashed, page has been closed).
1343 return m_mainFrame->title();
1346 void WebPageProxy::setUserAgent(const String& userAgent)
1348 if (m_userAgent == userAgent)
1350 m_userAgent = userAgent;
1354 process()->send(Messages::WebPage::SetUserAgent(m_userAgent), m_pageID);
1357 void WebPageProxy::setApplicationNameForUserAgent(const String& applicationName)
1359 if (m_applicationNameForUserAgent == applicationName)
1362 m_applicationNameForUserAgent = applicationName;
1363 if (!m_customUserAgent.isEmpty())
1366 setUserAgent(standardUserAgent(m_applicationNameForUserAgent));
1369 void WebPageProxy::setCustomUserAgent(const String& customUserAgent)
1371 if (m_customUserAgent == customUserAgent)
1374 m_customUserAgent = customUserAgent;
1376 if (m_customUserAgent.isEmpty()) {
1377 setUserAgent(standardUserAgent(m_applicationNameForUserAgent));
1381 setUserAgent(m_customUserAgent);
1384 void WebPageProxy::resumeActiveDOMObjectsAndAnimations()
1386 if (!isValid() || !m_isPageSuspended)
1389 m_isPageSuspended = false;
1391 process()->send(Messages::WebPage::ResumeActiveDOMObjectsAndAnimations(), m_pageID);
1394 void WebPageProxy::suspendActiveDOMObjectsAndAnimations()
1396 if (!isValid() || m_isPageSuspended)
1399 m_isPageSuspended = true;
1401 process()->send(Messages::WebPage::SuspendActiveDOMObjectsAndAnimations(), m_pageID);
1404 bool WebPageProxy::supportsTextEncoding() const
1406 return !m_mainFrameHasCustomRepresentation && m_mainFrame && !m_mainFrame->isDisplayingStandaloneImageDocument();
1409 void WebPageProxy::setCustomTextEncodingName(const String& encodingName)
1411 if (m_customTextEncodingName == encodingName)
1413 m_customTextEncodingName = encodingName;
1417 process()->send(Messages::WebPage::SetCustomTextEncodingName(encodingName), m_pageID);
1420 void WebPageProxy::terminateProcess()
1422 // NOTE: This uses a check of m_isValid rather than calling isValid() since
1423 // we want this to run even for pages being closed or that already closed.
1427 process()->terminate();
1430 #if !USE(CF) || defined(BUILDING_QT__)
1431 PassRefPtr<WebData> WebPageProxy::sessionStateData(WebPageProxySessionStateFilterCallback, void* context) const
1433 // FIXME: Return session state data for saving Page state.
1437 void WebPageProxy::restoreFromSessionStateData(WebData*)
1439 // FIXME: Restore the Page from the passed in session state data.
1443 bool WebPageProxy::supportsTextZoom() const
1445 if (m_mainFrameHasCustomRepresentation)
1448 // FIXME: This should also return false for standalone media and plug-in documents.
1449 if (!m_mainFrame || m_mainFrame->isDisplayingStandaloneImageDocument())
1455 void WebPageProxy::setTextZoomFactor(double zoomFactor)
1460 if (m_mainFrameHasCustomRepresentation)
1463 if (m_textZoomFactor == zoomFactor)
1466 m_textZoomFactor = zoomFactor;
1467 process()->send(Messages::WebPage::SetTextZoomFactor(m_textZoomFactor), m_pageID);
1470 double WebPageProxy::pageZoomFactor() const
1472 return m_mainFrameHasCustomRepresentation ? m_pageClient->customRepresentationZoomFactor() : m_pageZoomFactor;
1475 void WebPageProxy::setPageZoomFactor(double zoomFactor)
1480 if (m_mainFrameHasCustomRepresentation) {
1481 m_pageClient->setCustomRepresentationZoomFactor(zoomFactor);
1485 if (m_pageZoomFactor == zoomFactor)
1488 m_pageZoomFactor = zoomFactor;
1489 process()->send(Messages::WebPage::SetPageZoomFactor(m_pageZoomFactor), m_pageID);
1492 void WebPageProxy::setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor)
1497 if (m_mainFrameHasCustomRepresentation) {
1498 m_pageClient->setCustomRepresentationZoomFactor(pageZoomFactor);
1502 if (m_pageZoomFactor == pageZoomFactor && m_textZoomFactor == textZoomFactor)
1505 m_pageZoomFactor = pageZoomFactor;
1506 m_textZoomFactor = textZoomFactor;
1507 process()->send(Messages::WebPage::SetPageAndTextZoomFactors(m_pageZoomFactor, m_textZoomFactor), m_pageID);
1510 void WebPageProxy::scalePage(double scale, const IntPoint& origin)
1515 process()->send(Messages::WebPage::ScalePage(scale, origin), m_pageID);
1517 m_pageClient->setRequestedScaleFactor(scale);
1521 void WebPageProxy::setIntrinsicDeviceScaleFactor(float scaleFactor)
1523 if (m_intrinsicDeviceScaleFactor == scaleFactor)
1526 m_intrinsicDeviceScaleFactor = scaleFactor;
1529 m_drawingArea->deviceScaleFactorDidChange();
1532 void WebPageProxy::windowScreenDidChange(PlatformDisplayID displayID)
1537 process()->send(Messages::WebPage::WindowScreenDidChange(displayID), m_pageID);
1540 float WebPageProxy::deviceScaleFactor() const
1542 if (m_customDeviceScaleFactor)
1543 return m_customDeviceScaleFactor;
1544 return m_intrinsicDeviceScaleFactor;
1547 void WebPageProxy::setCustomDeviceScaleFactor(float customScaleFactor)
1552 if (m_customDeviceScaleFactor == customScaleFactor)
1555 float oldScaleFactor = deviceScaleFactor();
1557 m_customDeviceScaleFactor = customScaleFactor;
1559 if (deviceScaleFactor() != oldScaleFactor)
1560 m_drawingArea->deviceScaleFactorDidChange();
1563 void WebPageProxy::setUseFixedLayout(bool fixed)
1568 // This check is fine as the value is initialized in the web
1569 // process as part of the creation parameters.
1570 if (fixed == m_useFixedLayout)
1573 m_useFixedLayout = fixed;
1575 m_fixedLayoutSize = IntSize();
1576 process()->send(Messages::WebPage::SetUseFixedLayout(fixed), m_pageID);
1579 void WebPageProxy::setFixedLayoutSize(const IntSize& size)
1584 if (size == m_fixedLayoutSize)
1587 m_fixedLayoutSize = size;
1588 process()->send(Messages::WebPage::SetFixedLayoutSize(size), m_pageID);
1591 void WebPageProxy::setPaginationMode(WebCore::Page::Pagination::Mode mode)
1593 if (mode == m_paginationMode)
1596 m_paginationMode = mode;
1600 process()->send(Messages::WebPage::SetPaginationMode(mode), m_pageID);
1603 void WebPageProxy::setPaginationBehavesLikeColumns(bool behavesLikeColumns)
1605 if (behavesLikeColumns == m_paginationBehavesLikeColumns)
1608 m_paginationBehavesLikeColumns = behavesLikeColumns;
1612 process()->send(Messages::WebPage::SetPaginationBehavesLikeColumns(behavesLikeColumns), m_pageID);
1615 void WebPageProxy::setPageLength(double pageLength)
1617 if (pageLength == m_pageLength)
1620 m_pageLength = pageLength;
1624 process()->send(Messages::WebPage::SetPageLength(pageLength), m_pageID);
1627 void WebPageProxy::setGapBetweenPages(double gap)
1629 if (gap == m_gapBetweenPages)
1632 m_gapBetweenPages = gap;
1636 process()->send(Messages::WebPage::SetGapBetweenPages(gap), m_pageID);
1639 void WebPageProxy::pageScaleFactorDidChange(double scaleFactor)
1641 m_pageScaleFactor = scaleFactor;
1642 m_pageClient->pageScaleFactorDidChange();
1645 void WebPageProxy::setMemoryCacheClientCallsEnabled(bool memoryCacheClientCallsEnabled)
1650 if (m_areMemoryCacheClientCallsEnabled == memoryCacheClientCallsEnabled)
1653 m_areMemoryCacheClientCallsEnabled = memoryCacheClientCallsEnabled;
1654 process()->send(Messages::WebPage::SetMemoryCacheMessagesEnabled(memoryCacheClientCallsEnabled), m_pageID);
1657 void WebPageProxy::findString(const String& string, FindOptions options, unsigned maxMatchCount)
1659 if (m_mainFrameHasCustomRepresentation)
1660 m_pageClient->findStringInCustomRepresentation(string, options, maxMatchCount);
1662 process()->send(Messages::WebPage::FindString(string, options, maxMatchCount), m_pageID);
1665 void WebPageProxy::hideFindUI()
1667 process()->send(Messages::WebPage::HideFindUI(), m_pageID);
1670 void WebPageProxy::countStringMatches(const String& string, FindOptions options, unsigned maxMatchCount)
1672 if (m_mainFrameHasCustomRepresentation) {
1673 m_pageClient->countStringMatchesInCustomRepresentation(string, options, maxMatchCount);
1680 process()->send(Messages::WebPage::CountStringMatches(string, options, maxMatchCount), m_pageID);
1683 void WebPageProxy::runJavaScriptInMainFrame(const String& script, PassRefPtr<ScriptValueCallback> prpCallback)
1685 RefPtr<ScriptValueCallback> callback = prpCallback;
1687 callback->invalidate();
1691 uint64_t callbackID = callback->callbackID();
1692 m_scriptValueCallbacks.set(callbackID, callback.get());
1693 process()->send(Messages::WebPage::RunJavaScriptInMainFrame(script, callbackID), m_pageID);
1696 void WebPageProxy::getRenderTreeExternalRepresentation(PassRefPtr<StringCallback> prpCallback)
1698 RefPtr<StringCallback> callback = prpCallback;
1700 callback->invalidate();
1704 uint64_t callbackID = callback->callbackID();
1705 m_stringCallbacks.set(callbackID, callback.get());
1706 process()->send(Messages::WebPage::GetRenderTreeExternalRepresentation(callbackID), m_pageID);
1709 void WebPageProxy::getSourceForFrame(WebFrameProxy* frame, PassRefPtr<StringCallback> prpCallback)
1711 RefPtr<StringCallback> callback = prpCallback;
1713 callback->invalidate();
1717 uint64_t callbackID = callback->callbackID();
1718 m_loadDependentStringCallbackIDs.add(callbackID);
1719 m_stringCallbacks.set(callbackID, callback.get());
1720 process()->send(Messages::WebPage::GetSourceForFrame(frame->frameID(), callbackID), m_pageID);
1723 void WebPageProxy::getContentsAsString(PassRefPtr<StringCallback> prpCallback)
1725 RefPtr<StringCallback> callback = prpCallback;
1727 callback->invalidate();
1731 uint64_t callbackID = callback->callbackID();
1732 m_loadDependentStringCallbackIDs.add(callbackID);
1733 m_stringCallbacks.set(callbackID, callback.get());
1734 process()->send(Messages::WebPage::GetContentsAsString(callbackID), m_pageID);
1737 void WebPageProxy::getSelectionOrContentsAsString(PassRefPtr<StringCallback> prpCallback)
1739 RefPtr<StringCallback> callback = prpCallback;
1741 callback->invalidate();
1745 uint64_t callbackID = callback->callbackID();
1746 m_stringCallbacks.set(callbackID, callback.get());
1747 process()->send(Messages::WebPage::GetSelectionOrContentsAsString(callbackID), m_pageID);
1750 void WebPageProxy::getMainResourceDataOfFrame(WebFrameProxy* frame, PassRefPtr<DataCallback> prpCallback)
1752 RefPtr<DataCallback> callback = prpCallback;
1754 callback->invalidate();
1758 uint64_t callbackID = callback->callbackID();
1759 m_dataCallbacks.set(callbackID, callback.get());
1760 process()->send(Messages::WebPage::GetMainResourceDataOfFrame(frame->frameID(), callbackID), m_pageID);
1763 void WebPageProxy::getResourceDataFromFrame(WebFrameProxy* frame, WebURL* resourceURL, PassRefPtr<DataCallback> prpCallback)
1765 RefPtr<DataCallback> callback = prpCallback;
1767 callback->invalidate();
1771 uint64_t callbackID = callback->callbackID();
1772 m_dataCallbacks.set(callbackID, callback.get());
1773 process()->send(Messages::WebPage::GetResourceDataFromFrame(frame->frameID(), resourceURL->string(), callbackID), m_pageID);
1776 void WebPageProxy::getWebArchiveOfFrame(WebFrameProxy* frame, PassRefPtr<DataCallback> prpCallback)
1778 RefPtr<DataCallback> callback = prpCallback;
1780 callback->invalidate();
1784 uint64_t callbackID = callback->callbackID();
1785 m_dataCallbacks.set(callbackID, callback.get());
1786 process()->send(Messages::WebPage::GetWebArchiveOfFrame(frame->frameID(), callbackID), m_pageID);
1789 void WebPageProxy::forceRepaint(PassRefPtr<VoidCallback> prpCallback)
1791 RefPtr<VoidCallback> callback = prpCallback;
1793 callback->invalidate();
1797 uint64_t callbackID = callback->callbackID();
1798 m_voidCallbacks.set(callbackID, callback.get());
1799 m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
1800 process()->send(Messages::WebPage::ForceRepaint(callbackID), m_pageID);
1803 void WebPageProxy::preferencesDidChange()
1808 #if ENABLE(INSPECTOR_SERVER)
1809 if (m_pageGroup->preferences()->developerExtrasEnabled())
1810 inspector()->enableRemoteInspection();
1813 // FIXME: It probably makes more sense to send individual preference changes.
1814 // However, WebKitTestRunner depends on getting a preference change notification
1815 // even if nothing changed in UI process, so that overrides get removed.
1817 // Preferences need to be updated during synchronous printing to make "print backgrounds" preference work when toggled from a print dialog checkbox.
1818 process()->send(Messages::WebPage::PreferencesDidChange(pageGroup()->preferences()->store()), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
1821 void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
1823 if (messageID.is<CoreIPC::MessageClassDrawingAreaProxy>()) {
1824 m_drawingArea->didReceiveDrawingAreaProxyMessage(connection, messageID, arguments);
1828 #if USE(UI_SIDE_COMPOSITING)
1829 if (messageID.is<CoreIPC::MessageClassLayerTreeHostProxy>()) {
1830 m_drawingArea->didReceiveLayerTreeHostProxyMessage(connection, messageID, arguments);
1835 #if ENABLE(INSPECTOR)
1836 if (messageID.is<CoreIPC::MessageClassWebInspectorProxy>()) {
1837 if (WebInspectorProxy* inspector = this->inspector())
1838 inspector->didReceiveWebInspectorProxyMessage(connection, messageID, arguments);
1843 #if ENABLE(FULLSCREEN_API)
1844 if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) {
1845 fullScreenManager()->didReceiveMessage(connection, messageID, arguments);
1850 didReceiveWebPageProxyMessage(connection, messageID, arguments);
1853 void WebPageProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
1855 #if ENABLE(INSPECTOR)
1856 if (messageID.is<CoreIPC::MessageClassWebInspectorProxy>()) {
1857 if (WebInspectorProxy* inspector = this->inspector())
1858 inspector->didReceiveSyncWebInspectorProxyMessage(connection, messageID, arguments, reply);
1863 #if ENABLE(FULLSCREEN_API)
1864 if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) {
1865 fullScreenManager()->didReceiveSyncMessage(connection, messageID, arguments, reply);
1870 // FIXME: Do something with reply.
1871 didReceiveSyncWebPageProxyMessage(connection, messageID, arguments, reply);
1874 void WebPageProxy::didCreateMainFrame(uint64_t frameID)
1876 MESSAGE_CHECK(!m_mainFrame);
1877 MESSAGE_CHECK(process()->canCreateFrame(frameID));
1879 m_mainFrame = WebFrameProxy::create(this, frameID);
1881 // Add the frame to the process wide map.
1882 process()->frameCreated(frameID, m_mainFrame.get());
1885 void WebPageProxy::didCreateSubframe(uint64_t frameID, uint64_t parentFrameID)
1887 MESSAGE_CHECK(m_mainFrame);
1889 WebFrameProxy* parentFrame = process()->webFrame(parentFrameID);
1890 MESSAGE_CHECK(parentFrame);
1891 MESSAGE_CHECK(parentFrame->isDescendantOf(m_mainFrame.get()));
1893 MESSAGE_CHECK(process()->canCreateFrame(frameID));
1895 RefPtr<WebFrameProxy> subFrame = WebFrameProxy::create(this, frameID);
1897 // Add the frame to the process wide map.
1898 process()->frameCreated(frameID, subFrame.get());
1900 // Insert the frame into the frame hierarchy.
1901 parentFrame->appendChild(subFrame.get());
1904 static bool isDisconnectedFrame(WebFrameProxy* frame)
1906 return !frame->page() || !frame->page()->mainFrame() || !frame->isDescendantOf(frame->page()->mainFrame());
1909 void WebPageProxy::didSaveFrameToPageCache(uint64_t frameID)
1911 MESSAGE_CHECK(m_mainFrame);
1913 WebFrameProxy* subframe = process()->webFrame(frameID);
1914 MESSAGE_CHECK(subframe);
1916 if (isDisconnectedFrame(subframe))
1919 MESSAGE_CHECK(subframe->isDescendantOf(m_mainFrame.get()));
1921 subframe->didRemoveFromHierarchy();
1924 void WebPageProxy::didRestoreFrameFromPageCache(uint64_t frameID, uint64_t parentFrameID)
1926 MESSAGE_CHECK(m_mainFrame);
1928 WebFrameProxy* subframe = process()->webFrame(frameID);
1929 MESSAGE_CHECK(subframe);
1930 MESSAGE_CHECK(!subframe->parentFrame());
1931 MESSAGE_CHECK(subframe->page() == m_mainFrame->page());
1933 WebFrameProxy* parentFrame = process()->webFrame(parentFrameID);
1934 MESSAGE_CHECK(parentFrame);
1935 MESSAGE_CHECK(parentFrame->isDescendantOf(m_mainFrame.get()));
1937 // Insert the frame into the frame hierarchy.
1938 parentFrame->appendChild(subframe);
1942 // Always start progress at initialProgressValue. This helps provide feedback as
1943 // soon as a load starts.
1945 static const double initialProgressValue = 0.1;
1947 double WebPageProxy::estimatedProgress() const
1949 if (!pendingAPIRequestURL().isNull())
1950 return initialProgressValue;
1951 return m_estimatedProgress;
1954 void WebPageProxy::didStartProgress()
1956 m_estimatedProgress = initialProgressValue;
1959 //FIXME: After ewk_view_loader_client is implemented,
1960 // consider this line to move to loaderClient.
1961 m_pageClient->didStartProgress();
1964 m_loaderClient.didStartProgress(this);
1967 void WebPageProxy::didChangeProgress(double value)
1969 m_estimatedProgress = value;
1971 m_loaderClient.didChangeProgress(this);
1974 void WebPageProxy::didFinishProgress()
1976 m_estimatedProgress = 1.0;
1979 //FIXME: consider to move this to loaderClient.
1980 m_pageClient->didFinishProgress();
1983 m_loaderClient.didFinishProgress(this);
1986 void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::ArgumentDecoder* arguments)
1988 clearPendingAPIRequestURL();
1990 RefPtr<APIObject> userData;
1991 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
1992 if (!arguments->decode(messageDecoder))
1995 WebFrameProxy* frame = process()->webFrame(frameID);
1996 MESSAGE_CHECK(frame);
1997 MESSAGE_CHECK_URL(url);
1999 frame->setUnreachableURL(unreachableURL);
2001 frame->didStartProvisionalLoad(url);
2002 m_loaderClient.didStartProvisionalLoadForFrame(this, frame, userData.get());
2005 void WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, const String& url, CoreIPC::ArgumentDecoder* arguments)
2007 RefPtr<APIObject> userData;
2008 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2009 if (!arguments->decode(messageDecoder))
2012 WebFrameProxy* frame = process()->webFrame(frameID);
2013 MESSAGE_CHECK(frame);
2014 MESSAGE_CHECK_URL(url);
2016 frame->didReceiveServerRedirectForProvisionalLoad(url);
2018 m_loaderClient.didReceiveServerRedirectForProvisionalLoadForFrame(this, frame, userData.get());
2021 void WebPageProxy::didFailProvisionalLoadForFrame(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
2023 RefPtr<APIObject> userData;
2024 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2025 if (!arguments->decode(messageDecoder))
2028 WebFrameProxy* frame = process()->webFrame(frameID);
2029 MESSAGE_CHECK(frame);
2031 frame->didFailProvisionalLoad();
2033 m_loaderClient.didFailProvisionalLoadWithErrorForFrame(this, frame, error, userData.get());
2036 void WebPageProxy::clearLoadDependentCallbacks()
2038 Vector<uint64_t> callbackIDsCopy;
2039 copyToVector(m_loadDependentStringCallbackIDs, callbackIDsCopy);
2040 m_loadDependentStringCallbackIDs.clear();
2042 for (size_t i = 0; i < callbackIDsCopy.size(); ++i) {
2043 RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackIDsCopy[i]);
2045 callback->invalidate();
2049 void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, const PlatformCertificateInfo& certificateInfo, CoreIPC::ArgumentDecoder* arguments)
2051 RefPtr<APIObject> userData;
2052 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2053 if (!arguments->decode(messageDecoder))
2056 WebFrameProxy* frame = process()->webFrame(frameID);
2057 MESSAGE_CHECK(frame);
2060 // FIXME (bug 59111): didCommitLoadForFrame comes too late when restoring a page from b/f cache, making us disable secure event mode in password fields.
2061 // FIXME (bug 59121): A load going on in one frame shouldn't affect typing in sibling frames.
2062 m_pageClient->resetTextInputState();
2063 #if !defined(BUILDING_ON_SNOW_LEOPARD)
2064 // FIXME: Should this be moved inside resetTextInputState()?
2065 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
2066 m_pageClient->dismissDictionaryLookupPanel();
2070 clearLoadDependentCallbacks();
2072 frame->didCommitLoad(mimeType, certificateInfo);
2074 if (frame->isMainFrame()) {
2075 m_mainFrameHasCustomRepresentation = frameHasCustomRepresentation;
2077 if (m_mainFrameHasCustomRepresentation) {
2078 // Always assume that the main frame is pinned here, since the custom representation view will handle
2079 // any wheel events and dispatch them to the WKView when necessary.
2080 m_mainFrameIsPinnedToLeftSide = true;
2081 m_mainFrameIsPinnedToRightSide = true;
2083 m_pageClient->didCommitLoadForMainFrame(frameHasCustomRepresentation);
2086 m_loaderClient.didCommitLoadForFrame(this, frame, userData.get());
2089 void WebPageProxy::didFinishDocumentLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2091 RefPtr<APIObject> userData;
2092 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2093 if (!arguments->decode(messageDecoder))
2096 WebFrameProxy* frame = process()->webFrame(frameID);
2097 MESSAGE_CHECK(frame);
2099 m_loaderClient.didFinishDocumentLoadForFrame(this, frame, userData.get());
2102 void WebPageProxy::didFinishLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2104 RefPtr<APIObject> userData;
2105 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2106 if (!arguments->decode(messageDecoder))
2109 WebFrameProxy* frame = process()->webFrame(frameID);
2110 MESSAGE_CHECK(frame);
2112 frame->didFinishLoad();
2115 if (frame->isMainFrame())
2116 m_pageClient->didFinishLoadForMainFrame();
2119 m_loaderClient.didFinishLoadForFrame(this, frame, userData.get());
2122 void WebPageProxy::didFailLoadForFrame(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
2124 RefPtr<APIObject> userData;
2125 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2126 if (!arguments->decode(messageDecoder))
2129 WebFrameProxy* frame = process()->webFrame(frameID);
2130 MESSAGE_CHECK(frame);
2132 clearLoadDependentCallbacks();
2134 frame->didFailLoad();
2136 m_loaderClient.didFailLoadWithErrorForFrame(this, frame, error, userData.get());
2139 void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t opaqueSameDocumentNavigationType, const String& url, CoreIPC::ArgumentDecoder* arguments)
2141 RefPtr<APIObject> userData;
2142 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2143 if (!arguments->decode(messageDecoder))
2146 WebFrameProxy* frame = process()->webFrame(frameID);
2147 MESSAGE_CHECK(frame);
2148 MESSAGE_CHECK_URL(url);
2150 clearPendingAPIRequestURL();
2151 frame->didSameDocumentNavigation(url);
2153 #if ENABLE(TIZEN_ISF_PORT)
2154 if (m_pageClient->getInputMethodState()) {
2155 LOG(ISF, "%s\n", __func__);
2156 setInputMethodState(false, String(), String());
2160 m_loaderClient.didSameDocumentNavigationForFrame(this, frame, static_cast<SameDocumentNavigationType>(opaqueSameDocumentNavigationType), userData.get());
2163 void WebPageProxy::didReceiveTitleForFrame(uint64_t frameID, const String& title, CoreIPC::ArgumentDecoder* arguments)
2165 RefPtr<APIObject> userData;
2166 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2167 if (!arguments->decode(messageDecoder))
2170 WebFrameProxy* frame = process()->webFrame(frameID);
2171 MESSAGE_CHECK(frame);
2173 frame->didChangeTitle(title);
2175 m_loaderClient.didReceiveTitleForFrame(this, title, frame, userData.get());
2178 void WebPageProxy::didFirstLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2180 RefPtr<APIObject> userData;
2181 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2182 if (!arguments->decode(messageDecoder))
2185 WebFrameProxy* frame = process()->webFrame(frameID);
2186 MESSAGE_CHECK(frame);
2188 m_loaderClient.didFirstLayoutForFrame(this, frame, userData.get());
2191 void WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2193 RefPtr<APIObject> userData;
2194 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2195 if (!arguments->decode(messageDecoder))
2198 WebFrameProxy* frame = process()->webFrame(frameID);
2199 MESSAGE_CHECK(frame);
2202 if (frame->isMainFrame())
2203 m_pageClient->didFirstVisuallyNonEmptyLayoutForMainFrame();
2206 m_loaderClient.didFirstVisuallyNonEmptyLayoutForFrame(this, frame, userData.get());
2209 void WebPageProxy::didNewFirstVisuallyNonEmptyLayout(CoreIPC::ArgumentDecoder* arguments)
2211 RefPtr<APIObject> userData;
2212 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2213 if (!arguments->decode(messageDecoder))
2216 m_loaderClient.didNewFirstVisuallyNonEmptyLayout(this, userData.get());
2219 void WebPageProxy::didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2221 RefPtr<APIObject> userData;
2222 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2223 if (!arguments->decode(messageDecoder))
2226 WebFrameProxy* frame = process()->webFrame(frameID);
2227 MESSAGE_CHECK(frame);
2229 frame->didRemoveFromHierarchy();
2231 m_loaderClient.didRemoveFrameFromHierarchy(this, frame, userData.get());
2234 void WebPageProxy::didDisplayInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2236 RefPtr<APIObject> userData;
2237 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2238 if (!arguments->decode(messageDecoder))
2241 WebFrameProxy* frame = process()->webFrame(frameID);
2242 MESSAGE_CHECK(frame);
2244 m_loaderClient.didDisplayInsecureContentForFrame(this, frame, userData.get());
2247 void WebPageProxy::didRunInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2249 RefPtr<APIObject> userData;
2250 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2251 if (!arguments->decode(messageDecoder))
2254 WebFrameProxy* frame = process()->webFrame(frameID);
2255 MESSAGE_CHECK(frame);
2257 m_loaderClient.didRunInsecureContentForFrame(this, frame, userData.get());
2260 void WebPageProxy::didDetectXSSForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2262 RefPtr<APIObject> userData;
2263 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2264 if (!arguments->decode(messageDecoder))
2267 WebFrameProxy* frame = process()->webFrame(frameID);
2268 MESSAGE_CHECK(frame);
2270 m_loaderClient.didDetectXSSForFrame(this, frame, userData.get());
2273 void WebPageProxy::frameDidBecomeFrameSet(uint64_t frameID, bool value)
2275 WebFrameProxy* frame = process()->webFrame(frameID);
2276 MESSAGE_CHECK(frame);
2278 frame->setIsFrameSet(value);
2279 if (frame->isMainFrame())
2280 m_frameSetLargestFrame = value ? m_mainFrame : 0;
2284 void WebPageProxy::decidePolicyForNavigationAction(uint64_t frameID, uint32_t opaqueNavigationType, uint32_t opaqueModifiers, int32_t opaqueMouseButton, const ResourceRequest& request, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID)
2286 RefPtr<APIObject> userData;
2287 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2288 if (!arguments->decode(messageDecoder))
2291 if (request.url() != pendingAPIRequestURL())
2292 clearPendingAPIRequestURL();
2294 WebFrameProxy* frame = process()->webFrame(frameID);
2295 MESSAGE_CHECK(frame);
2296 MESSAGE_CHECK_URL(request.url());
2298 NavigationType navigationType = static_cast<NavigationType>(opaqueNavigationType);
2299 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
2300 WebMouseEvent::Button mouseButton = static_cast<WebMouseEvent::Button>(opaqueMouseButton);
2302 RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
2304 ASSERT(!m_inDecidePolicyForNavigationAction);
2306 m_inDecidePolicyForNavigationAction = true;
2307 m_syncNavigationActionPolicyActionIsValid = false;
2309 if (!m_policyClient.decidePolicyForNavigationAction(this, frame, navigationType, modifiers, mouseButton, request, listener.get(), userData.get()))
2312 m_inDecidePolicyForNavigationAction = false;
2314 // Check if we received a policy decision already. If we did, we can just pass it back.
2315 receivedPolicyAction = m_syncNavigationActionPolicyActionIsValid;
2316 if (m_syncNavigationActionPolicyActionIsValid) {
2317 policyAction = m_syncNavigationActionPolicyAction;
2318 downloadID = m_syncNavigationActionPolicyDownloadID;
2322 void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, uint32_t opaqueNavigationType, uint32_t opaqueModifiers, int32_t opaqueMouseButton, const ResourceRequest& request, const String& frameName, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments)
2324 RefPtr<APIObject> userData;
2325 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2326 if (!arguments->decode(messageDecoder))
2329 WebFrameProxy* frame = process()->webFrame(frameID);
2330 MESSAGE_CHECK(frame);
2331 MESSAGE_CHECK_URL(request.url());
2333 NavigationType navigationType = static_cast<NavigationType>(opaqueNavigationType);
2334 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
2335 WebMouseEvent::Button mouseButton = static_cast<WebMouseEvent::Button>(opaqueMouseButton);
2337 RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
2338 if (!m_policyClient.decidePolicyForNewWindowAction(this, frame, navigationType, modifiers, mouseButton, request, frameName, listener.get(), userData.get()))
2342 void WebPageProxy::decidePolicyForResponse(uint64_t frameID, const ResourceResponse& response, const ResourceRequest& request, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID)
2344 RefPtr<APIObject> userData;
2345 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2346 if (!arguments->decode(messageDecoder))
2349 WebFrameProxy* frame = process()->webFrame(frameID);
2350 MESSAGE_CHECK(frame);
2351 MESSAGE_CHECK_URL(request.url());
2352 MESSAGE_CHECK_URL(response.url());
2354 RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
2356 ASSERT(!m_inDecidePolicyForResponse);
2358 m_inDecidePolicyForResponse = true;
2359 m_syncMimeTypePolicyActionIsValid = false;
2361 if (!m_policyClient.decidePolicyForResponse(this, frame, response, request, listener.get(), userData.get()))
2364 m_inDecidePolicyForResponse = false;
2366 // Check if we received a policy decision already. If we did, we can just pass it back.
2367 receivedPolicyAction = m_syncMimeTypePolicyActionIsValid;
2368 if (m_syncMimeTypePolicyActionIsValid) {
2369 policyAction = m_syncMimeTypePolicyAction;
2370 downloadID = m_syncMimeTypePolicyDownloadID;
2374 void WebPageProxy::unableToImplementPolicy(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
2376 RefPtr<APIObject> userData;
2377 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2378 if (!arguments->decode(messageDecoder))
2381 WebFrameProxy* frame = process()->webFrame(frameID);
2382 MESSAGE_CHECK(frame);
2384 m_policyClient.unableToImplementPolicy(this, frame, error, userData.get());
2389 void WebPageProxy::willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const StringPairVector& textFieldValues, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments)
2391 RefPtr<APIObject> userData;
2392 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2393 if (!arguments->decode(messageDecoder))
2396 WebFrameProxy* frame = process()->webFrame(frameID);
2397 MESSAGE_CHECK(frame);
2399 WebFrameProxy* sourceFrame = process()->webFrame(sourceFrameID);
2400 MESSAGE_CHECK(sourceFrame);
2402 RefPtr<WebFormSubmissionListenerProxy> listener = frame->setUpFormSubmissionListenerProxy(listenerID);
2403 if (!m_formClient.willSubmitForm(this, frame, sourceFrame, textFieldValues.stringPairVector(), userData.get(), listener.get()))
2404 listener->continueSubmission();
2407 // ResourceLoad Client
2409 void WebPageProxy::didInitiateLoadForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceRequest& request, bool pageIsProvisionallyLoading)
2411 WebFrameProxy* frame = process()->webFrame(frameID);
2412 MESSAGE_CHECK(frame);
2413 MESSAGE_CHECK_URL(request.url());
2415 m_resourceLoadClient.didInitiateLoadForResource(this, frame, resourceIdentifier, request, pageIsProvisionallyLoading);
2418 void WebPageProxy::didSendRequestForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceRequest& request, const ResourceResponse& redirectResponse)
2420 WebFrameProxy* frame = process()->webFrame(frameID);
2421 MESSAGE_CHECK(frame);
2422 MESSAGE_CHECK_URL(request.url());
2424 m_resourceLoadClient.didSendRequestForResource(this, frame, resourceIdentifier, request, redirectResponse);
2427 void WebPageProxy::didReceiveResponseForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceResponse& response)
2429 WebFrameProxy* frame = process()->webFrame(frameID);
2430 MESSAGE_CHECK(frame);
2431 MESSAGE_CHECK_URL(response.url());
2433 m_resourceLoadClient.didReceiveResponseForResource(this, frame, resourceIdentifier, response);
2436 void WebPageProxy::didReceiveContentLengthForResource(uint64_t frameID, uint64_t resourceIdentifier, uint64_t contentLength)
2438 WebFrameProxy* frame = process()->webFrame(frameID);
2439 MESSAGE_CHECK(frame);
2441 m_resourceLoadClient.didReceiveContentLengthForResource(this, frame, resourceIdentifier, contentLength);
2444 void WebPageProxy::didFinishLoadForResource(uint64_t frameID, uint64_t resourceIdentifier)
2446 WebFrameProxy* frame = process()->webFrame(frameID);
2447 MESSAGE_CHECK(frame);
2449 m_resourceLoadClient.didFinishLoadForResource(this, frame, resourceIdentifier);
2452 void WebPageProxy::didFailLoadForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceError& error)
2454 WebFrameProxy* frame = process()->webFrame(frameID);
2455 MESSAGE_CHECK(frame);
2457 m_resourceLoadClient.didFailLoadForResource(this, frame, resourceIdentifier, error);
2462 void WebPageProxy::createNewPage(const ResourceRequest& request, const WindowFeatures& windowFeatures, uint32_t opaqueModifiers, int32_t opaqueMouseButton, uint64_t& newPageID, WebPageCreationParameters& newPageParameters)
2464 RefPtr<WebPageProxy> newPage = m_uiClient.createNewPage(this, request, windowFeatures, static_cast<WebEvent::Modifiers>(opaqueModifiers), static_cast<WebMouseEvent::Button>(opaqueMouseButton));
2466 newPageID = newPage->pageID();
2467 newPageParameters = newPage->creationParameters();
2472 void WebPageProxy::showPage()
2474 m_uiClient.showPage(this);
2477 void WebPageProxy::closePage(bool stopResponsivenessTimer)
2479 if (stopResponsivenessTimer)
2480 process()->responsivenessTimer()->stop();
2482 m_pageClient->clearAllEditCommands();
2483 m_uiClient.close(this);
2487 void WebPageProxy::runJavaScriptAlert(uint64_t frameID, const String& message, PassRefPtr<Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply> reply)
2489 WebFrameProxy* frame = process()->webFrame(frameID);
2490 MESSAGE_CHECK(frame);
2492 // Since runJavaScriptAlert() can spin a nested run loop we need to turn off the responsiveness timer.
2493 process()->responsivenessTimer()->stop();
2495 m_alertReply = reply;
2496 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2497 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2499 if (!m_uiClient.runJavaScriptAlert(this, message, frame))
2500 replyJavaScriptAlert();
2503 void WebPageProxy::runJavaScriptConfirm(uint64_t frameID, const String& message, PassRefPtr<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply> reply)
2505 WebFrameProxy* frame = process()->webFrame(frameID);
2506 MESSAGE_CHECK(frame);
2508 // Since runJavaScriptConfirm() can spin a nested run loop we need to turn off the responsiveness timer.
2509 process()->responsivenessTimer()->stop();
2511 m_confirmReply = reply;
2512 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2513 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2515 if (!m_uiClient.runJavaScriptConfirm(this, message, frame))
2516 replyJavaScriptConfirm(false);
2519 void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const String& message, const String& defaultValue, PassRefPtr<Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply> reply)
2521 WebFrameProxy* frame = process()->webFrame(frameID);
2522 MESSAGE_CHECK(frame);
2524 // Since runJavaScriptPrompt() can spin a nested run loop we need to turn off the responsiveness timer.
2525 process()->responsivenessTimer()->stop();
2527 m_promptReply = reply;
2528 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2529 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2531 if (!m_uiClient.runJavaScriptPrompt(this, message, defaultValue, frame))
2532 replyJavaScriptPrompt(String());
2535 void WebPageProxy::runJavaScriptAlert(uint64_t frameID, const String& message)
2537 WebFrameProxy* frame = process()->webFrame(frameID);
2538 MESSAGE_CHECK(frame);
2540 // Since runJavaScriptAlert() can spin a nested run loop we need to turn off the responsiveness timer.
2541 process()->responsivenessTimer()->stop();
2543 m_uiClient.runJavaScriptAlert(this, message, frame);
2546 void WebPageProxy::runJavaScriptConfirm(uint64_t frameID, const String& message, bool& result)
2548 WebFrameProxy* frame = process()->webFrame(frameID);
2549 MESSAGE_CHECK(frame);
2551 // Since runJavaScriptConfirm() can spin a nested run loop we need to turn off the responsiveness timer.
2552 process()->responsivenessTimer()->stop();
2554 result = m_uiClient.runJavaScriptConfirm(this, message, frame);
2557 void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const String& message, const String& defaultValue, String& result)
2559 WebFrameProxy* frame = process()->webFrame(frameID);
2560 MESSAGE_CHECK(frame);
2562 // Since runJavaScriptPrompt() can spin a nested run loop we need to turn off the responsiveness timer.
2563 process()->responsivenessTimer()->stop();
2565 result = m_uiClient.runJavaScriptPrompt(this, message, defaultValue, frame);
2569 void WebPageProxy::shouldInterruptJavaScript(bool& result)
2571 // Since shouldInterruptJavaScript() can spin a nested run loop we need to turn off the responsiveness timer.
2572 process()->responsivenessTimer()->stop();
2574 result = m_uiClient.shouldInterruptJavaScript(this);
2577 void WebPageProxy::setStatusText(const String& text)
2579 m_uiClient.setStatusText(this, text);
2582 void WebPageProxy::mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t opaqueModifiers, CoreIPC::ArgumentDecoder* arguments)
2584 RefPtr<APIObject> userData;
2585 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2586 if (!arguments->decode(messageDecoder))
2589 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
2591 m_uiClient.mouseDidMoveOverElement(this, hitTestResultData, modifiers, userData.get());
2594 void WebPageProxy::unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& url, const String& pluginsPageURL)
2596 MESSAGE_CHECK_URL(url);
2597 MESSAGE_CHECK_URL(pluginsPageURL);
2599 WKPluginUnavailabilityReason pluginUnavailabilityReason = static_cast<WKPluginUnavailabilityReason>(opaquePluginUnavailabilityReason);
2600 m_uiClient.unavailablePluginButtonClicked(this, pluginUnavailabilityReason, mimeType, url, pluginsPageURL);
2603 void WebPageProxy::setToolbarsAreVisible(bool toolbarsAreVisible)
2605 m_uiClient.setToolbarsAreVisible(this, toolbarsAreVisible);
2608 void WebPageProxy::getToolbarsAreVisible(bool& toolbarsAreVisible)
2610 toolbarsAreVisible = m_uiClient.toolbarsAreVisible(this);
2613 void WebPageProxy::setMenuBarIsVisible(bool menuBarIsVisible)
2615 m_uiClient.setMenuBarIsVisible(this, menuBarIsVisible);
2618 void WebPageProxy::getMenuBarIsVisible(bool& menuBarIsVisible)
2620 menuBarIsVisible = m_uiClient.menuBarIsVisible(this);
2623 void WebPageProxy::setStatusBarIsVisible(bool statusBarIsVisible)
2625 m_uiClient.setStatusBarIsVisible(this, statusBarIsVisible);
2628 void WebPageProxy::getStatusBarIsVisible(bool& statusBarIsVisible)
2630 statusBarIsVisible = m_uiClient.statusBarIsVisible(this);
2633 void WebPageProxy::setIsResizable(bool isResizable)
2635 m_uiClient.setIsResizable(this, isResizable);
2638 void WebPageProxy::getIsResizable(bool& isResizable)
2640 isResizable = m_uiClient.isResizable(this);
2643 void WebPageProxy::setWindowFrame(const FloatRect& newWindowFrame)
2645 m_uiClient.setWindowFrame(this, m_pageClient->convertToDeviceSpace(newWindowFrame));
2648 void WebPageProxy::getWindowFrame(FloatRect& newWindowFrame)
2650 newWindowFrame = m_pageClient->convertToUserSpace(m_uiClient.windowFrame(this));
2653 void WebPageProxy::screenToWindow(const IntPoint& screenPoint, IntPoint& windowPoint)
2655 windowPoint = m_pageClient->screenToWindow(screenPoint);
2658 void WebPageProxy::windowToScreen(const IntRect& viewRect, IntRect& result)
2660 result = m_pageClient->windowToScreen(viewRect);
2663 void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose)
2665 WebFrameProxy* frame = process()->webFrame(frameID);
2666 MESSAGE_CHECK(frame);
2668 // Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer.
2669 process()->responsivenessTimer()->stop();
2671 shouldClose = m_uiClient.runBeforeUnloadConfirmPanel(this, message, frame);
2674 #if USE(TILED_BACKING_STORE)
2675 void WebPageProxy::pageDidRequestScroll(const IntPoint& point)
2677 m_pageClient->pageDidRequestScroll(point);
2681 void WebPageProxy::didChangeViewportProperties(const ViewportAttributes& attr)
2683 m_pageClient->didChangeViewportProperties(attr);
2686 void WebPageProxy::pageDidScroll()
2688 m_uiClient.pageDidScroll(this);
2689 #if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD)
2690 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
2694 void WebPageProxy::runOpenPanel(uint64_t frameID, const FileChooserSettings& settings)
2696 if (m_openPanelResultListener) {
2697 m_openPanelResultListener->invalidate();
2698 m_openPanelResultListener = 0;
2701 WebFrameProxy* frame = process()->webFrame(frameID);
2702 MESSAGE_CHECK(frame);
2704 RefPtr<WebOpenPanelParameters> parameters = WebOpenPanelParameters::create(settings);
2705 m_openPanelResultListener = WebOpenPanelResultListenerProxy::create(this);
2707 // Since runOpenPanel() can spin a nested run loop we need to turn off the responsiveness timer.
2708 process()->responsivenessTimer()->stop();
2710 if (!m_uiClient.runOpenPanel(this, frame, parameters.get(), m_openPanelResultListener.get()))
2711 didCancelForOpenPanel();
2714 void WebPageProxy::printFrame(uint64_t frameID)
2716 ASSERT(!m_isPerformingDOMPrintOperation);
2717 m_isPerformingDOMPrintOperation = true;
2719 WebFrameProxy* frame = process()->webFrame(frameID);
2720 MESSAGE_CHECK(frame);
2722 m_uiClient.printFrame(this, frame);
2724 endPrinting(); // Send a message synchronously while m_isPerformingDOMPrintOperation is still true.
2725 m_isPerformingDOMPrintOperation = false;
2728 void WebPageProxy::printMainFrame()
2730 printFrame(m_mainFrame->frameID());
2733 #if ENABLE(TIZEN_REGISTER_PROTOCOL_HANDLER)
2734 void WebPageProxy::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title)
2736 m_pageClient->registerProtocolHandler(scheme, baseURL, url, title);
2740 #if ENABLE(TIZEN_REGISTER_CONTENT_HANDLER)
2741 void WebPageProxy::registerContentHandler(const String& mimeType, const String& baseURL, const String& url, const String& title)
2743 m_pageClient->registerContentHandler(mimeType, baseURL, url, title);
2747 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
2748 void WebPageProxy::getStandaloneStatus(bool& standalone)
2750 standalone = m_pageClient->getStandaloneStatus();
2753 void WebPageProxy::getWebAppCapable(PassRefPtr<BooleanCallback> prpCallback)
2755 RefPtr<BooleanCallback> callback = prpCallback;
2757 callback->invalidate();
2761 uint64_t callbackID = callback->callbackID();
2762 m_booleanCallbacks.set(callbackID, callback.get());
2763 process()->send(Messages::WebPage::GetWebAppCapable(callbackID), m_pageID);
2766 void WebPageProxy::didGetWebAppCapable(const bool capable, uint64_t callbackID)
2768 RefPtr<BooleanCallback> callback = m_booleanCallbacks.take(callbackID);
2770 // FIXME: Log error or assert.
2771 // this can validly happen if a load invalidated the callback, though
2775 m_booleanCallbacks.remove(callbackID);
2776 callback->performCallbackWithReturnValue(WebBoolean::create(capable).leakRef());
2779 void WebPageProxy::getWebAppIconURL(PassRefPtr<StringCallback> prpCallback)
2781 RefPtr<StringCallback> callback = prpCallback;
2783 callback->invalidate();
2787 uint64_t callbackID = callback->callbackID();
2788 m_stringCallbacks.set(callbackID, callback.get());
2789 process()->send(Messages::WebPage::GetWebAppIconURL(callbackID), m_pageID);
2792 void WebPageProxy::didGetWebAppIconURL(const String& iconURL, uint64_t callbackID)
2794 RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackID);
2796 // FIXME: Log error or assert.
2797 // this can validly happen if a load invalidated the callback, though
2801 m_stringCallbacks.remove(callbackID);
2802 callback->performCallbackWithReturnValue(iconURL.impl());
2806 void WebPageProxy::setMediaVolume(float volume)
2808 if (volume == m_mediaVolume)
2811 m_mediaVolume = volume;
2816 process()->send(Messages::WebPage::SetMediaVolume(volume), m_pageID);
2820 void WebPageProxy::didChangeContentsSize(const IntSize& size)
2822 m_pageClient->didChangeContentsSize(size);
2825 void WebPageProxy::didFindZoomableArea(const IntPoint& target, const IntRect& area)
2827 m_pageClient->didFindZoomableArea(target, area);
2830 void WebPageProxy::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
2835 process()->send(Messages::WebPage::FindZoomableAreaForPoint(point, area), m_pageID);
2838 void WebPageProxy::didReceiveMessageFromNavigatorQtObject(const String& contents)
2840 m_pageClient->didReceiveMessageFromNavigatorQtObject(contents);
2843 void WebPageProxy::handleDownloadRequest(DownloadProxy* download)
2845 m_pageClient->handleDownloadRequest(download);
2848 void WebPageProxy::authenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password)
2850 m_pageClient->handleAuthenticationRequiredRequest(hostname, realm, prefilledUsername, username, password);
2853 void WebPageProxy::proxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password)
2855 m_pageClient->handleProxyAuthenticationRequiredRequest(hostname, port, prefilledUsername, username, password);
2858 void WebPageProxy::certificateVerificationRequest(const String& hostname, bool& ignoreErrors)
2860 m_pageClient->handleCertificateVerificationRequest(hostname, ignoreErrors);
2862 #endif // PLATFORM(QT).
2865 void WebPageProxy::didFindZoomableArea(const IntPoint& target, const IntRect& area)
2867 m_pageClient->didFindZoomableArea(target, area);
2870 void WebPageProxy::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
2875 process()->send(Messages::WebPage::FindZoomableAreaForPoint(point, area), m_pageID);
2877 #endif // #if OS(TIZEN)
2879 #if ENABLE(TOUCH_EVENTS)
2880 void WebPageProxy::needTouchEvents(bool needTouchEvents)
2882 m_needTouchEvents = needTouchEvents;
2886 #if ENABLE(INPUT_TYPE_COLOR)
2887 void WebPageProxy::showColorChooser(const WebCore::Color& initialColor)
2889 ASSERT(!m_colorChooser);
2891 m_colorChooser = m_pageClient->createColorChooserProxy(this, initialColor);
2894 void WebPageProxy::setColorChooserColor(const WebCore::Color& color)
2896 ASSERT(m_colorChooser);
2898 m_colorChooser->setSelectedColor(color);
2901 void WebPageProxy::endColorChooser()
2903 ASSERT(m_colorChooser);
2905 m_colorChooser->endChooser();
2908 void WebPageProxy::didChooseColor(const WebCore::Color& color)
2913 process()->send(Messages::WebPage::DidChooseColor(color), m_pageID);
2916 void WebPageProxy::didEndColorChooser()
2921 ASSERT(m_colorChooser);
2923 #if !ENABLE(TIZEN_INPUT_COLOR_PICKER) // prevent crash when the color chooser closed
2924 m_colorChooser->invalidate();
2926 m_colorChooser = nullptr;
2928 process()->send(Messages::WebPage::DidEndColorChooser(), m_pageID);
2932 void WebPageProxy::didDraw()
2934 m_uiClient.didDraw(this);
2939 #if ENABLE(INSPECTOR)
2941 WebInspectorProxy* WebPageProxy::inspector()
2943 if (isClosed() || !isValid())
2946 m_inspector = WebInspectorProxy::create(this);
2947 return m_inspector.get();
2952 #if ENABLE(FULLSCREEN_API)
2953 WebFullScreenManagerProxy* WebPageProxy::fullScreenManager()
2955 if (!m_fullScreenManager)
2956 m_fullScreenManager = WebFullScreenManagerProxy::create(this);
2957 return m_fullScreenManager.get();
2963 void WebPageProxy::backForwardAddItem(uint64_t itemID)
2965 m_backForwardList->addItem(process()->webBackForwardItem(itemID));
2968 void WebPageProxy::backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle& sandboxExtensionHandle)
2970 WebBackForwardListItem* item = process()->webBackForwardItem(itemID);
2974 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), item->url()), sandboxExtensionHandle);
2975 if (createdExtension)
2976 process()->willAcquireUniversalFileReadSandboxExtension();
2977 m_backForwardList->goToItem(item);
2980 void WebPageProxy::backForwardItemAtIndex(int32_t index, uint64_t& itemID)
2982 WebBackForwardListItem* item = m_backForwardList->itemAtIndex(index);
2983 itemID = item ? item->itemID() : 0;
2986 void WebPageProxy::backForwardBackListCount(int32_t& count)
2988 count = m_backForwardList->backListCount();
2991 void WebPageProxy::backForwardForwardListCount(int32_t& count)
2993 count = m_backForwardList->forwardListCount();
2996 void WebPageProxy::editorStateChanged(const EditorState& editorState)
2999 bool couldChangeSecureInputState = m_editorState.isInPasswordField != editorState.isInPasswordField || m_editorState.selectionIsNone;
3002 m_editorState = editorState;
3005 m_pageClient->updateTextInputState(couldChangeSecureInputState);
3007 m_pageClient->updateTextInputState();
3010 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
3011 m_pageClient->updateTextSelection();
3017 void WebPageProxy::registerEditCommandForUndo(uint64_t commandID, uint32_t editAction)
3019 registerEditCommand(WebEditCommandProxy::create(commandID, static_cast<EditAction>(editAction), this), Undo);
3022 void WebPageProxy::canUndoRedo(uint32_t action, bool& result)
3024 result = m_pageClient->canUndoRedo(static_cast<UndoOrRedo>(action));
3027 void WebPageProxy::executeUndoRedo(uint32_t action, bool& result)
3029 m_pageClient->executeUndoRedo(static_cast<UndoOrRedo>(action));
3033 void WebPageProxy::clearAllEditCommands()
3035 m_pageClient->clearAllEditCommands();
3038 void WebPageProxy::didCountStringMatches(const String& string, uint32_t matchCount)
3040 m_findClient.didCountStringMatches(this, string, matchCount);
3043 void WebPageProxy::setFindIndicator(const FloatRect& selectionRectInWindowCoordinates, const Vector<FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut, bool animate)
3045 RefPtr<FindIndicator> findIndicator = FindIndicator::create(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, contentImageScaleFactor, contentImageHandle);
3046 m_pageClient->setFindIndicator(findIndicator.release(), fadeOut, animate);
3049 void WebPageProxy::didFindString(const String& string, uint32_t matchCount)
3051 m_findClient.didFindString(this, string, matchCount);
3054 void WebPageProxy::didFailToFindString(const String& string)
3056 m_findClient.didFailToFindString(this, string);
3059 void WebPageProxy::valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex)
3061 process()->send(Messages::WebPage::DidChangeSelectedIndexForActivePopupMenu(newSelectedIndex), m_pageID);
3064 void WebPageProxy::setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index)
3066 process()->send(Messages::WebPage::SetTextForActivePopupMenu(index), m_pageID);
3069 NativeWebMouseEvent* WebPageProxy::currentlyProcessedMouseDownEvent()
3071 return m_currentlyProcessedMouseDownEvent.get();
3075 void WebPageProxy::failedToShowPopupMenu()
3077 process()->send(Messages::WebPage::FailedToShowPopupMenu(), m_pageID);
3081 void WebPageProxy::showPopupMenu(const IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData& data)
3083 if (m_activePopupMenu) {
3084 m_activePopupMenu->hidePopupMenu();
3085 m_activePopupMenu->invalidate();
3086 m_activePopupMenu = 0;
3089 m_activePopupMenu = m_pageClient->createPopupMenuProxy(this);
3091 // Since showPopupMenu() can spin a nested run loop we need to turn off the responsiveness timer.
3092 process()->responsivenessTimer()->stop();
3094 RefPtr<WebPopupMenuProxy> protectedActivePopupMenu = m_activePopupMenu;
3096 protectedActivePopupMenu->showPopupMenu(rect, static_cast<TextDirection>(textDirection), m_pageScaleFactor, items, data, selectedIndex);
3098 protectedActivePopupMenu->invalidate();
3100 protectedActivePopupMenu = 0;
3103 void WebPageProxy::hidePopupMenu()
3105 if (!m_activePopupMenu)
3108 m_activePopupMenu->hidePopupMenu();
3109 m_activePopupMenu->invalidate();
3110 m_activePopupMenu = 0;
3113 #if ENABLE(CONTEXT_MENUS)
3114 void WebPageProxy::showContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::ArgumentDecoder* arguments)
3116 internalShowContextMenu(menuLocation, hitTestResultData, proposedItems, arguments);
3118 // No matter the result of internalShowContextMenu, always notify the WebProcess that the menu is hidden so it starts handling mouse events again.
3119 process()->send(Messages::WebPage::ContextMenuHidden(), m_pageID);
3120 #if ENABLE(TOUCH_EVENTS) && ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
3121 // Cancel touch event when ContextMenu is shown.
3122 m_pageClient->cancelTouchEvent();
3126 void WebPageProxy::internalShowContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::ArgumentDecoder* arguments)
3128 RefPtr<APIObject> userData;
3129 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
3130 if (!arguments->decode(messageDecoder))
3133 m_activeContextMenuHitTestResultData = hitTestResultData;
3135 if (m_activeContextMenu) {
3136 m_activeContextMenu->hideContextMenu();
3137 m_activeContextMenu = 0;
3140 m_activeContextMenu = m_pageClient->createContextMenuProxy(this);
3142 // Since showContextMenu() can spin a nested run loop we need to turn off the responsiveness timer.
3143 process()->responsivenessTimer()->stop();
3145 // Give the PageContextMenuClient one last swipe at changing the menu.
3146 Vector<WebContextMenuItemData> items;
3147 if (!m_contextMenuClient.getContextMenuFromProposedMenu(this, proposedItems, items, hitTestResultData, userData.get()))
3148 m_activeContextMenu->showContextMenu(menuLocation, proposedItems);
3150 m_activeContextMenu->showContextMenu(menuLocation, items);
3152 m_contextMenuClient.contextMenuDismissed(this);
3155 void WebPageProxy::contextMenuItemSelected(const WebContextMenuItemData& item)
3157 // Application custom items don't need to round-trip through to WebCore in the WebProcess.
3158 if (item.action() >= ContextMenuItemBaseApplicationTag) {
3159 m_contextMenuClient.customContextMenuItemSelected(this, item);
3160 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
3161 m_pageClient->setIsTextSelectionMode(false);
3166 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
3167 if (item.action() == ContextMenuItemTagPaste)
3168 m_pageClient->setIsTextSelectionMode(false);
3172 if (item.action() == ContextMenuItemTagSmartCopyPaste) {
3173 setSmartInsertDeleteEnabled(!isSmartInsertDeleteEnabled());
3176 if (item.action() == ContextMenuItemTagSmartQuotes) {
3177 TextChecker::setAutomaticQuoteSubstitutionEnabled(!TextChecker::state().isAutomaticQuoteSubstitutionEnabled);
3178 process()->updateTextCheckerState();
3181 if (item.action() == ContextMenuItemTagSmartDashes) {
3182 TextChecker::setAutomaticDashSubstitutionEnabled(!TextChecker::state().isAutomaticDashSubstitutionEnabled);
3183 process()->updateTextCheckerState();
3186 if (item.action() == ContextMenuItemTagSmartLinks) {
3187 TextChecker::setAutomaticLinkDetectionEnabled(!TextChecker::state().isAutomaticLinkDetectionEnabled);
3188 process()->updateTextCheckerState();
3191 if (item.action() == ContextMenuItemTagTextReplacement) {
3192 TextChecker::setAutomaticTextReplacementEnabled(!TextChecker::state().isAutomaticTextReplacementEnabled);
3193 process()->updateTextCheckerState();
3196 if (item.action() == ContextMenuItemTagCorrectSpellingAutomatically) {
3197 TextChecker::setAutomaticSpellingCorrectionEnabled(!TextChecker::state().isAutomaticSpellingCorrectionEnabled);
3198 process()->updateTextCheckerState();
3201 if (item.action() == ContextMenuItemTagShowSubstitutions) {
3202 TextChecker::toggleSubstitutionsPanelIsShowing();
3206 if (item.action() == ContextMenuItemTagDownloadImageToDisk) {
3207 m_process->context()->download(this, KURL(KURL(), m_activeContextMenuHitTestResultData.absoluteImageURL));
3210 if (item.action() == ContextMenuItemTagDownloadLinkToDisk) {
3211 m_process->context()->download(this, KURL(KURL(), m_activeContextMenuHitTestResultData.absoluteLinkURL));
3214 if (item.action() == ContextMenuItemTagCheckSpellingWhileTyping) {
3215 TextChecker::setContinuousSpellCheckingEnabled(!TextChecker::state().isContinuousSpellCheckingEnabled);
3216 process()->updateTextCheckerState();
3219 if (item.action() == ContextMenuItemTagCheckGrammarWithSpelling) {
3220 TextChecker::setGrammarCheckingEnabled(!TextChecker::state().isGrammarCheckingEnabled);
3221 process()->updateTextCheckerState();
3224 if (item.action() == ContextMenuItemTagShowSpellingPanel) {
3225 if (!TextChecker::spellingUIIsShowing())
3226 advanceToNextMisspelling(true);
3227 TextChecker::toggleSpellingUIIsShowing();
3230 if (item.action() == ContextMenuItemTagLearnSpelling || item.action() == ContextMenuItemTagIgnoreSpelling)
3231 ++m_pendingLearnOrIgnoreWordMessageCount;
3233 #if ENABLE(TIZEN_WEBKIT_PASTEBOARD)
3234 if (item.action() == ContextMenuItemTagPaste) {
3235 // process paste after getting data from clipboard.
3236 pasteWithClipboard();
3241 #if ENABLE(CONTEXT_MENUS)
3242 process()->send(Messages::WebPage::DidSelectItemFromActiveContextMenu(item), m_pageID);
3245 #endif // ENABLE(CONTEXT_MENUS)
3247 void WebPageProxy::didChooseFilesForOpenPanel(const Vector<String>& fileURLs)
3252 #if ENABLE(WEB_PROCESS_SANDBOX)
3253 // FIXME: The sandbox extensions should be sent with the DidChooseFilesForOpenPanel message. This
3254 // is gated on a way of passing SandboxExtension::Handles in a Vector.
3255 for (size_t i = 0; i < fileURLs.size(); ++i) {
3256 SandboxExtension::Handle sandboxExtensionHandle;
3257 SandboxExtension::createHandle(fileURLs[i], SandboxExtension::ReadOnly, sandboxExtensionHandle);
3258 process()->send(Messages::WebPage::ExtendSandboxForFileFromOpenPanel(sandboxExtensionHandle), m_pageID);
3262 process()->send(Messages::WebPage::DidChooseFilesForOpenPanel(fileURLs), m_pageID);
3264 m_openPanelResultListener->invalidate();
3265 m_openPanelResultListener = 0;
3268 void WebPageProxy::didCancelForOpenPanel()
3273 process()->send(Messages::WebPage::DidCancelForOpenPanel(), m_pageID);
3275 m_openPanelResultListener->invalidate();
3276 m_openPanelResultListener = 0;
3279 void WebPageProxy::advanceToNextMisspelling(bool startBeforeSelection) const
3281 process()->send(Messages::WebPage::AdvanceToNextMisspelling(startBeforeSelection), m_pageID);
3284 void WebPageProxy::changeSpellingToWord(const String& word) const
3289 process()->send(Messages::WebPage::ChangeSpellingToWord(word), m_pageID);
3292 void WebPageProxy::registerEditCommand(PassRefPtr<WebEditCommandProxy> commandProxy, UndoOrRedo undoOrRedo)
3294 m_pageClient->registerEditCommand(commandProxy, undoOrRedo);
3297 void WebPageProxy::addEditCommand(WebEditCommandProxy* command)
3299 m_editCommandSet.add(command);
3302 void WebPageProxy::removeEditCommand(WebEditCommandProxy* command)
3304 m_editCommandSet.remove(command);
3308 process()->send(Messages::WebPage::DidRemoveEditCommand(command->commandID()), m_pageID);
3311 bool WebPageProxy::isValidEditCommand(WebEditCommandProxy* command)
3313 return m_editCommandSet.find(command) != m_editCommandSet.end();
3316 int64_t WebPageProxy::spellDocumentTag()
3318 if (!m_hasSpellDocumentTag) {
3319 m_spellDocumentTag = TextChecker::uniqueSpellDocumentTag(this);
3320 m_hasSpellDocumentTag = true;
3323 return m_spellDocumentTag;
3326 #if USE(UNIFIED_TEXT_CHECKING)
3327 void WebPageProxy::checkTextOfParagraph(const String& text, uint64_t checkingTypes, Vector<TextCheckingResult>& results)
3329 results = TextChecker::checkTextOfParagraph(spellDocumentTag(), text.characters(), text.length(), checkingTypes);
3333 void WebPageProxy::checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength)
3335 TextChecker::checkSpellingOfString(spellDocumentTag(), text.characters(), text.length(), misspellingLocation, misspellingLength);
3338 void WebPageProxy::checkGrammarOfString(const String& text, Vector<GrammarDetail>& grammarDetails, int32_t& badGrammarLocation, int32_t& badGrammarLength)
3340 TextChecker::checkGrammarOfString(spellDocumentTag(), text.characters(), text.length(), grammarDetails, badGrammarLocation, badGrammarLength);
3343 void WebPageProxy::spellingUIIsShowing(bool& isShowing)
3345 isShowing = TextChecker::spellingUIIsShowing();
3348 void WebPageProxy::updateSpellingUIWithMisspelledWord(const String& misspelledWord)
3350 TextChecker::updateSpellingUIWithMisspelledWord(spellDocumentTag(), misspelledWord);
3353 void WebPageProxy::updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const GrammarDetail& grammarDetail)
3355 TextChecker::updateSpellingUIWithGrammarString(spellDocumentTag(), badGrammarPhrase, grammarDetail);
3358 void WebPageProxy::getGuessesForWord(const String& word, const String& context, Vector<String>& guesses)
3360 TextChecker::getGuessesForWord(spellDocumentTag(), word, context, guesses);
3363 void WebPageProxy::learnWord(const String& word)
3365 MESSAGE_CHECK(m_pendingLearnOrIgnoreWordMessageCount);
3366 --m_pendingLearnOrIgnoreWordMessageCount;
3368 TextChecker::learnWord(spellDocumentTag(), word);
3371 void WebPageProxy::ignoreWord(const String& word)
3373 MESSAGE_CHECK(m_pendingLearnOrIgnoreWordMessageCount);
3374 --m_pendingLearnOrIgnoreWordMessageCount;
3376 TextChecker::ignoreWord(spellDocumentTag(), word);
3381 void WebPageProxy::setFocus(bool focused)
3384 m_uiClient.focus(this);
3386 m_uiClient.unfocus(this);
3389 void WebPageProxy::takeFocus(uint32_t direction)
3391 m_uiClient.takeFocus(this, (static_cast<FocusDirection>(direction) == FocusDirectionForward) ? kWKFocusDirectionForward : kWKFocusDirectionBackward);
3394 void WebPageProxy::setToolTip(const String& toolTip)
3396 String oldToolTip = m_toolTip;
3397 m_toolTip = toolTip;
3398 m_pageClient->toolTipChanged(oldToolTip, m_toolTip);
3401 void WebPageProxy::setCursor(const WebCore::Cursor& cursor)
3403 m_pageClient->setCursor(cursor);
3406 void WebPageProxy::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
3408 m_pageClient->setCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves);
3411 void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
3413 WebEvent::Type type = static_cast<WebEvent::Type>(opaqueType);
3416 case WebEvent::NoType:
3417 case WebEvent::MouseMove:
3420 case WebEvent::MouseDown:
3421 case WebEvent::MouseUp:
3422 case WebEvent::Wheel:
3423 case WebEvent::KeyDown:
3424 case WebEvent::KeyUp:
3425 case WebEvent::RawKeyDown:
3426 case WebEvent::Char:
3427 #if ENABLE(GESTURE_EVENTS)
3428 case WebEvent::GestureScrollBegin:
3429 case WebEvent::GestureScrollEnd:
3430 case WebEvent::GestureSingleTap:
3432 #if ENABLE(TOUCH_EVENTS)
3433 case WebEvent::TouchStart:
3434 case WebEvent::TouchMove:
3435 case WebEvent::TouchEnd:
3436 case WebEvent::TouchCancel:
3438 process()->responsivenessTimer()->stop();
3443 case WebEvent::NoType:
3445 case WebEvent::MouseMove:
3446 m_processingMouseMoveEvent = false;
3447 if (m_nextMouseMoveEvent) {
3448 handleMouseEvent(*m_nextMouseMoveEvent);
3449 m_nextMouseMoveEvent = nullptr;
3452 case WebEvent::MouseDown:
3454 #if ENABLE(GESTURE_EVENTS)
3455 case WebEvent::GestureScrollBegin:
3456 case WebEvent::GestureScrollEnd:
3457 case WebEvent::GestureSingleTap: {
3458 WebGestureEvent event = m_gestureEventQueue.first();
3459 MESSAGE_CHECK(type == event.type());
3461 m_gestureEventQueue.removeFirst();
3462 m_pageClient->doneWithGestureEvent(event, handled);
3466 case WebEvent::MouseUp:
3467 m_currentlyProcessedMouseDownEvent = nullptr;
3470 case WebEvent::Wheel: {
3471 ASSERT(!m_currentlyProcessedWheelEvents.isEmpty());
3473 OwnPtr<Vector<NativeWebWheelEvent> > oldestCoalescedEvent = m_currentlyProcessedWheelEvents.takeFirst();
3475 // FIXME: Dispatch additional events to the didNotHandleWheelEvent client function.
3476 if (!handled && m_uiClient.implementsDidNotHandleWheelEvent())
3477 m_uiClient.didNotHandleWheelEvent(this, oldestCoalescedEvent->last());
3479 if (!m_wheelEventQueue.isEmpty())
3480 processNextQueuedWheelEvent();
3484 case WebEvent::KeyDown:
3485 case WebEvent::KeyUp:
3486 case WebEvent::RawKeyDown:
3487 case WebEvent::Char: {
3488 LOG(KeyHandling, "WebPageProxy::didReceiveEvent: %s", webKeyboardEventTypeString(type));
3490 NativeWebKeyboardEvent event = m_keyEventQueue.first();
3491 MESSAGE_CHECK(type == event.type());
3493 m_keyEventQueue.removeFirst();
3495 m_pageClient->doneWithKeyEvent(event, handled);
3500 if (m_uiClient.implementsDidNotHandleKeyEvent())
3501 m_uiClient.didNotHandleKeyEvent(this, event);
3504 ::TranslateMessage(event.nativeEvent());
3508 #if ENABLE(TOUCH_EVENTS)
3509 case WebEvent::TouchStart:
3510 case WebEvent::TouchMove:
3511 case WebEvent::TouchEnd:
3512 case WebEvent::TouchCancel: {
3513 QueuedTouchEvents queuedEvents = m_touchEventQueue.first();
3514 MESSAGE_CHECK(type == queuedEvents.forwardedEvent.type());
3515 m_touchEventQueue.removeFirst();
3517 m_pageClient->doneWithTouchEvent(queuedEvents.forwardedEvent, handled);
3518 for (size_t i = 0; i < queuedEvents.deferredTouchEvents.size(); ++i) {
3519 bool isEventHandled = false;
3520 m_pageClient->doneWithTouchEvent(queuedEvents.deferredTouchEvents.at(i), isEventHandled);
3528 void WebPageProxy::stopResponsivenessTimer()
3530 process()->responsivenessTimer()->stop();
3533 void WebPageProxy::voidCallback(uint64_t callbackID)
3535 RefPtr<VoidCallback> callback = m_voidCallbacks.take(callbackID);
3537 // FIXME: Log error or assert.
3541 callback->performCallback();
3544 void WebPageProxy::dataCallback(const CoreIPC::DataReference& dataReference, uint64_t callbackID)
3546 RefPtr<DataCallback> callback = m_dataCallbacks.take(callbackID);
3548 // FIXME: Log error or assert.
3552 callback->performCallbackWithReturnValue(WebData::create(dataReference.data(), dataReference.size()).get());
3555 void WebPageProxy::stringCallback(const String& resultString, uint64_t callbackID)
3557 RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackID);
3559 // FIXME: Log error or assert.
3560 // this can validly happen if a load invalidated the callback, though
3564 m_loadDependentStringCallbackIDs.remove(callbackID);
3566 callback->performCallbackWithReturnValue(resultString.impl());
3569 void WebPageProxy::scriptValueCallback(const CoreIPC::DataReference& dataReference, uint64_t callbackID)
3571 RefPtr<ScriptValueCallback> callback = m_scriptValueCallbacks.take(callbackID);
3573 // FIXME: Log error or assert.
3577 Vector<uint8_t> data;
3578 data.reserveInitialCapacity(dataReference.size());
3579 data.append(dataReference.data(), dataReference.size());
3581 callback->performCallbackWithReturnValue(data.size() ? WebSerializedScriptValue::adopt(data).get() : 0);
3584 void WebPageProxy::computedPagesCallback(const Vector<IntRect>& pageRects, double totalScaleFactorForPrinting, uint64_t callbackID)
3586 RefPtr<ComputedPagesCallback> callback = m_computedPagesCallbacks.take(callbackID);
3588 // FIXME: Log error or assert.
3592 callback->performCallbackWithReturnValue(pageRects, totalScaleFactorForPrinting);
3595 void WebPageProxy::validateCommandCallback(const String& commandName, bool isEnabled, int state, uint64_t callbackID)
3597 RefPtr<ValidateCommandCallback> callback = m_validateCommandCallbacks.take(callbackID);
3599 // FIXME: Log error or assert.
3603 callback->performCallbackWithReturnValue(commandName.impl(), isEnabled, state);
3607 void WebPageProxy::printFinishedCallback(const ResourceError& printError, uint64_t callbackID)
3609 RefPtr<PrintFinishedCallback> callback = m_printFinishedCallbacks.take(callbackID);
3611 // FIXME: Log error or assert.
3615 RefPtr<WebError> error = WebError::create(printError);
3616 callback->performCallbackWithReturnValue(error.get());
3620 void WebPageProxy::focusedFrameChanged(uint64_t frameID)
3627 WebFrameProxy* frame = process()->webFrame(frameID);
3628 MESSAGE_CHECK(frame);
3630 m_focusedFrame = frame;
3633 void WebPageProxy::frameSetLargestFrameChanged(uint64_t frameID)
3636 m_frameSetLargestFrame = 0;
3640 WebFrameProxy* frame = process()->webFrame(frameID);
3641 MESSAGE_CHECK(frame);
3643 m_frameSetLargestFrame = frame;
3646 void WebPageProxy::processDidBecomeUnresponsive()
3651 updateBackingStoreDiscardableState();
3653 m_loaderClient.processDidBecomeUnresponsive(this);
3656 void WebPageProxy::interactionOccurredWhileProcessUnresponsive()
3661 m_loaderClient.interactionOccurredWhileProcessUnresponsive(this);
3664 void WebPageProxy::processDidBecomeResponsive()
3669 updateBackingStoreDiscardableState();
3671 m_loaderClient.processDidBecomeResponsive(this);
3674 void WebPageProxy::processDidCrash()
3676 ASSERT(m_pageClient);
3679 m_isPageSuspended = false;
3682 m_urlAtProcessExit = m_mainFrame->url();
3683 m_loadStateAtProcessExit = m_mainFrame->loadState();
3686 m_mainFrame = nullptr;
3687 m_drawingArea = nullptr;
3689 #if ENABLE(INSPECTOR)
3691 m_inspector->invalidate();
3692 m_inspector = nullptr;
3696 #if ENABLE(FULLSCREEN_API)
3697 if (m_fullScreenManager) {
3698 m_fullScreenManager->invalidate();
3699 m_fullScreenManager = nullptr;
3703 if (m_openPanelResultListener) {
3704 m_openPanelResultListener->invalidate();
3705 m_openPanelResultListener = nullptr;
3708 #if ENABLE(INPUT_TYPE_COLOR)
3709 if (m_colorChooser) {
3710 m_colorChooser->invalidate();
3711 m_colorChooser = nullptr;
3715 #if ENABLE(GEOLOCATION)
3716 m_geolocationPermissionRequestManager.invalidateRequests();
3719 m_notificationPermissionRequestManager.invalidateRequests();
3721 m_toolTip = String();
3723 m_mainFrameHasHorizontalScrollbar = false;
3724 m_mainFrameHasVerticalScrollbar = false;
3726 m_mainFrameIsPinnedToLeftSide = false;
3727 m_mainFrameIsPinnedToRightSide = false;
3729 m_visibleScrollerThumbRect = IntRect();
3731 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
3732 invalidateCallbackMap(m_booleanCallbacks);
3734 invalidateCallbackMap(m_voidCallbacks);
3735 invalidateCallbackMap(m_dataCallbacks);
3736 invalidateCallbackMap(m_stringCallbacks);
3737 m_loadDependentStringCallbackIDs.clear();
3738 invalidateCallbackMap(m_scriptValueCallbacks);
3739 invalidateCallbackMap(m_computedPagesCallbacks);
3740 invalidateCallbackMap(m_validateCommandCallbacks);
3742 invalidateCallbackMap(m_printFinishedCallbacks);
3745 Vector<WebEditCommandProxy*> editCommandVector;
3746 copyToVector(m_editCommandSet, editCommandVector);
3747 m_editCommandSet.clear();
3748 for (size_t i = 0, size = editCommandVector.size(); i < size; ++i)
3749 editCommandVector[i]->invalidate();
3750 m_pageClient->clearAllEditCommands();
3752 m_activePopupMenu = 0;
3754 m_estimatedProgress = 0.0;
3756 m_pendingLearnOrIgnoreWordMessageCount = 0;
3758 m_pageClient->processDidCrash();
3759 m_loaderClient.processDidCrash(this);
3762 // If the call out to the loader client didn't cause the web process to be relaunched,
3763 // we'll call setNeedsDisplay on the view so that we won't have the old contents showing.
3764 // If the call did cause the web process to be relaunched, we'll keep the old page contents showing
3765 // until the new web process has painted its contents.
3766 setViewNeedsDisplay(IntRect(IntPoint(), viewSize()));
3769 // Can't expect DidReceiveEvent notifications from a crashed web process.
3770 m_keyEventQueue.clear();
3772 m_wheelEventQueue.clear();
3773 m_currentlyProcessedWheelEvents.clear();
3775 m_nextMouseMoveEvent = nullptr;
3776 m_currentlyProcessedMouseDownEvent = nullptr;
3778 m_processingMouseMoveEvent = false;
3780 #if ENABLE(TOUCH_EVENTS)
3781 m_needTouchEvents = false;
3782 m_touchEventQueue.clear();
3785 #if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD)
3786 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
3787 m_pageClient->dismissDictionaryLookupPanel();
3791 WebPageCreationParameters WebPageProxy::creationParameters() const
3793 WebPageCreationParameters parameters;
3795 parameters.viewSize = m_pageClient->viewSize();
3796 parameters.isActive = m_pageClient->isViewWindowActive();
3797 parameters.isFocused = m_pageClient->isViewFocused();
3798 parameters.isVisible = m_pageClient->isViewVisible();
3799 parameters.isInWindow = m_pageClient->isViewInWindow();
3800 parameters.drawingAreaType = m_drawingArea->type();
3801 parameters.store = m_pageGroup->preferences()->store();
3802 parameters.pageGroupData = m_pageGroup->data();
3803 parameters.drawsBackground = m_drawsBackground;
3804 parameters.drawsTransparentBackground = m_drawsTransparentBackground;
3805 parameters.areMemoryCacheClientCallsEnabled = m_areMemoryCacheClientCallsEnabled;
3806 parameters.useFixedLayout = m_useFixedLayout;
3807 parameters.fixedLayoutSize = m_fixedLayoutSize;
3808 parameters.paginationMode = m_paginationMode;
3809 parameters.paginationBehavesLikeColumns = m_paginationBehavesLikeColumns;
3810 parameters.pageLength = m_pageLength;
3811 parameters.gapBetweenPages = m_gapBetweenPages;
3812 parameters.userAgent = userAgent();
3813 parameters.sessionState = SessionState(m_backForwardList->entries(), m_backForwardList->currentIndex());
3814 parameters.highestUsedBackForwardItemID = WebBackForwardListItem::highedUsedItemID();
3815 parameters.canRunBeforeUnloadConfirmPanel = m_uiClient.canRunBeforeUnloadConfirmPanel();
3816 parameters.canRunModal = m_uiClient.canRunModal();
3817 parameters.deviceScaleFactor = m_intrinsicDeviceScaleFactor;
3818 parameters.mediaVolume = m_mediaVolume;
3821 parameters.isSmartInsertDeleteEnabled = m_isSmartInsertDeleteEnabled;
3822 parameters.layerHostingMode = m_layerHostingMode;
3826 parameters.nativeWindow = m_pageClient->nativeWindow();
3831 #if USE(ACCELERATED_COMPOSITING)
3832 void WebPageProxy::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
3834 m_pageClient->enterAcceleratedCompositingMode(layerTreeContext);
3837 void WebPageProxy::exitAcceleratedCompositingMode()
3839 m_pageClient->exitAcceleratedCompositingMode();
3842 void WebPageProxy::updateAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
3844 m_pageClient->updateAcceleratedCompositingMode(layerTreeContext);
3846 #endif // USE(ACCELERATED_COMPOSITING)
3848 void WebPageProxy::backForwardClear()
3850 m_backForwardList->clear();
3853 void WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const ProtectionSpace& coreProtectionSpace, bool& canAuthenticate)
3855 WebFrameProxy* frame = process()->webFrame(frameID);
3856 MESSAGE_CHECK(frame);
3858 RefPtr<WebProtectionSpace> protectionSpace = WebProtectionSpace::create(coreProtectionSpace);
3860 canAuthenticate = m_loaderClient.canAuthenticateAgainstProtectionSpaceInFrame(this, frame, protectionSpace.get());
3863 void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const AuthenticationChallenge& coreChallenge, uint64_t challengeID)
3865 WebFrameProxy* frame = process()->webFrame(frameID);
3866 MESSAGE_CHECK(frame);
3868 RefPtr<AuthenticationChallengeProxy> authenticationChallenge = AuthenticationChallengeProxy::create(coreChallenge, challengeID, process());
3870 m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get());
3873 void WebPageProxy::exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, uint64_t& newQuota)
3875 WebFrameProxy* frame = process()->webFrame(frameID);
3876 MESSAGE_CHECK(frame);
3878 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
3880 newQuota = m_uiClient.exceededDatabaseQuota(this, frame, origin.get(), databaseName, displayName, currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage);
3883 void WebPageProxy::requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier)
3885 WebFrameProxy* frame = process()->webFrame(frameID);
3886 MESSAGE_CHECK(frame);
3888 // FIXME: Geolocation should probably be using toString() as its string representation instead of databaseIdentifier().
3889 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
3890 RefPtr<GeolocationPermissionRequestProxy> request = m_geolocationPermissionRequestManager.createRequest(geolocationID);
3892 if (!m_uiClient.decidePolicyForGeolocationPermissionRequest(this, frame, origin.get(), request.get()))
3896 void WebPageProxy::requestNotificationPermission(uint64_t requestID, const String& originString)
3898 if (!isRequestIDValid(requestID))
3901 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromString(originString);
3902 RefPtr<NotificationPermissionRequest> request = m_notificationPermissionRequestManager.createRequest(requestID);
3904 if (!m_uiClient.decidePolicyForNotificationPermissionRequest(this, origin.get(), request.get()))
3908 void WebPageProxy::showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID)
3910 m_process->context()->notificationManagerProxy()->show(this, title, body, iconURL, tag, originString, notificationID);
3913 #if ENABLE(TIZEN_MEDIA_STREAM)
3914 void WebPageProxy::requestUserMediaPermission(uint64_t requestID)
3916 if (!isRequestIDValid(requestID))
3919 RefPtr<UserMediaPermissionRequest> request = m_userMediaPermissionRequestManager.createRequest(requestID);
3921 if (!m_tizenClient.decidePolicyForUserMediaPermissionRequest(this, request.get()))
3926 float WebPageProxy::headerHeight(WebFrameProxy* frame)
3928 if (frame->isDisplayingPDFDocument())
3930 return m_uiClient.headerHeight(this, frame);
3933 float WebPageProxy::footerHeight(WebFrameProxy* frame)
3935 if (frame->isDisplayingPDFDocument())
3937 return m_uiClient.footerHeight(this, frame);
3940 void WebPageProxy::drawHeader(WebFrameProxy* frame, const FloatRect& rect)
3942 if (frame->isDisplayingPDFDocument())
3944 m_uiClient.drawHeader(this, frame, rect);
3947 void WebPageProxy::drawFooter(WebFrameProxy* frame, const FloatRect& rect)
3949 if (frame->isDisplayingPDFDocument())
3951 m_uiClient.drawFooter(this, frame, rect);
3954 void WebPageProxy::runModal()
3956 // Since runModal() can (and probably will) spin a nested run loop we need to turn off the responsiveness timer.
3957 process()->responsivenessTimer()->stop();
3959 m_uiClient.runModal(this);
3962 void WebPageProxy::notifyScrollerThumbIsVisibleInRect(const IntRect& scrollerThumb)
3964 m_visibleScrollerThumbRect = scrollerThumb;
3967 void WebPageProxy::recommendedScrollbarStyleDidChange(int32_t newStyle)
3970 m_pageClient->recommendedScrollbarStyleDidChange(newStyle);
3974 void WebPageProxy::didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar)
3976 m_mainFrameHasHorizontalScrollbar = hasHorizontalScrollbar;
3977 m_mainFrameHasVerticalScrollbar = hasVerticalScrollbar;
3979 m_pageClient->didChangeScrollbarsForMainFrame();
3982 void WebPageProxy::didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide)
3984 m_mainFrameIsPinnedToLeftSide = pinnedToLeftSide;
3985 m_mainFrameIsPinnedToRightSide = pinnedToRightSide;
3988 void WebPageProxy::didChangePageCount(unsigned pageCount)
3990 m_pageCount = pageCount;
3993 void WebPageProxy::didFailToInitializePlugin(const String& mimeType)
3995 m_loaderClient.didFailToInitializePlugin(this, mimeType);
3998 void WebPageProxy::didBlockInsecurePluginVersion(const String& mimeType, const String& urlString)
4000 String pluginIdentifier;
4001 String pluginVersion;
4002 String newMimeType = mimeType;
4005 PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL(KURL(), urlString));
4007 pluginIdentifier = plugin.bundleIdentifier;
4008 pluginVersion = plugin.versionString;
4011 m_loaderClient.didBlockInsecurePluginVersion(this, newMimeType, pluginIdentifier, pluginVersion);
4014 bool WebPageProxy::willHandleHorizontalScrollEvents() const
4016 return !m_canShortCircuitHorizontalWheelEvents;
4019 void WebPageProxy::didFinishLoadingDataForCustomRepresentation(const String& suggestedFilename, const CoreIPC::DataReference& dataReference)
4021 m_pageClient->didFinishLoadingDataForCustomRepresentation(suggestedFilename, dataReference);
4024 void WebPageProxy::backForwardRemovedItem(uint64_t itemID)
4026 process()->send(Messages::WebPage::DidRemoveBackForwardItem(itemID), m_pageID);
4029 void WebPageProxy::beginPrinting(WebFrameProxy* frame, const PrintInfo& printInfo)
4031 if (m_isInPrintingMode)
4034 m_isInPrintingMode = true;
4035 process()->send(Messages::WebPage::BeginPrinting(frame->frameID(), printInfo), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4038 void WebPageProxy::endPrinting()
4040 if (!m_isInPrintingMode)
4043 m_isInPrintingMode = false;
4044 process()->send(Messages::WebPage::EndPrinting(), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4047 void WebPageProxy::computePagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<ComputedPagesCallback> prpCallback)
4049 RefPtr<ComputedPagesCallback> callback = prpCallback;
4051 callback->invalidate();
4055 uint64_t callbackID = callback->callbackID();
4056 m_computedPagesCallbacks.set(callbackID, callback.get());
4057 m_isInPrintingMode = true;
4058 process()->send(Messages::WebPage::ComputePagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4061 #if PLATFORM(MAC) || PLATFORM(WIN)
4062 void WebPageProxy::drawRectToPDF(WebFrameProxy* frame, const PrintInfo& printInfo, const IntRect& rect, PassRefPtr<DataCallback> prpCallback)
4064 RefPtr<DataCallback> callback = prpCallback;
4066 callback->invalidate();
4070 uint64_t callbackID = callback->callbackID();
4071 m_dataCallbacks.set(callbackID, callback.get());
4072 process()->send(Messages::WebPage::DrawRectToPDF(frame->frameID(), printInfo, rect, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4075 void WebPageProxy::drawPagesToPDF(WebFrameProxy* frame, const PrintInfo& printInfo, uint32_t first, uint32_t count, PassRefPtr<DataCallback> prpCallback)
4077 RefPtr<DataCallback> callback = prpCallback;
4079 callback->invalidate();
4083 uint64_t callbackID = callback->callbackID();
4084 m_dataCallbacks.set(callbackID, callback.get());
4085 process()->send(Messages::WebPage::DrawPagesToPDF(frame->frameID(), printInfo, first, count, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4088 void WebPageProxy::drawPagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<PrintFinishedCallback> didPrintCallback)
4090 RefPtr<PrintFinishedCallback> callback = didPrintCallback;
4092 callback->invalidate();
4096 uint64_t callbackID = callback->callbackID();
4097 m_printFinishedCallbacks.set(callbackID, callback.get());
4098 m_isInPrintingMode = true;
4099 process()->send(Messages::WebPage::DrawPagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4103 void WebPageProxy::flashBackingStoreUpdates(const Vector<IntRect>& updateRects)
4105 m_pageClient->flashBackingStoreUpdates(updateRects);
4108 void WebPageProxy::updateBackingStoreDiscardableState()
4114 if (!process()->responsivenessTimer()->isResponsive())
4115 isDiscardable = false;
4117 isDiscardable = !m_pageClient->isViewWindowActive() || !isViewVisible();
4119 m_drawingArea->setBackingStoreIsDiscardable(isDiscardable);
4122 Color WebPageProxy::viewUpdatesFlashColor()
4124 return Color(0, 200, 255);
4127 Color WebPageProxy::backingStoreUpdatesFlashColor()
4129 return Color(200, 0, 255);
4132 void WebPageProxy::saveDataToFileInDownloadsFolder(const String& suggestedFilename, const String& mimeType, const String& originatingURLString, WebData* data)
4134 m_uiClient.saveDataToFileInDownloadsFolder(this, suggestedFilename, mimeType, originatingURLString, data);
4137 void WebPageProxy::linkClicked(const String& url, const WebMouseEvent& event)
4139 process()->send(Messages::WebPage::LinkClicked(url, event), m_pageID, 0);
4144 void WebPageProxy::substitutionsPanelIsShowing(bool& isShowing)
4146 isShowing = TextChecker::substitutionsPanelIsShowing();
4149 #if !defined(BUILDING_ON_SNOW_LEOPARD)
4150 void WebPageProxy::showCorrectionPanel(int32_t panelType, const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings)
4152 m_pageClient->showCorrectionPanel((AlternativeTextType)panelType, boundingBoxOfReplacedString, replacedString, replacementString, alternativeReplacementStrings);
4155 void WebPageProxy::dismissCorrectionPanel(int32_t reason)
4157 m_pageClient->dismissCorrectionPanel((ReasonForDismissingAlternativeText)reason);
4160 void WebPageProxy::dismissCorrectionPanelSoon(int32_t reason, String& result)
4162 result = m_pageClient->dismissCorrectionPanelSoon((ReasonForDismissingAlternativeText)reason);
4165 void WebPageProxy::recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString)
4167 m_pageClient->recordAutocorrectionResponse((AutocorrectionResponseType)responseType, replacedString, replacementString);
4169 #endif // !defined(BUILDING_ON_SNOW_LEOPARD)
4171 void WebPageProxy::handleAlternativeTextUIResult(const String& result)
4173 #if !defined(BUILDING_ON_SNOW_LEOPARD)
4175 process()->send(Messages::WebPage::HandleAlternativeTextUIResult(result), m_pageID, 0);
4178 #endif // PLATFORM(MAC)
4180 #if ENABLE(TIZEN_PAGE_VISIBILITY_API)
4181 void WebPageProxy::setPageVisibility(WebCore::PageVisibilityState pageVisibilityState, bool isInitialState)
4183 process()->send(Messages::WebPage::SetVisibilityState(static_cast<uint32_t>(pageVisibilityState), isInitialState), m_pageID);
4187 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
4188 void WebPageProxy::updateLayoutAndScaleIfNeeded()
4190 m_pageClient->updateLayoutAndScaleIfNeeded();
4194 #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
4195 void WebPageProxy::decidePolicyForCertificateError(bool isTrusted, const String& url, const String& certificate, int error, bool& canContinue)
4197 canContinue = m_tizenClient.decidePolicyForCertificateError(this, isTrusted, url, certificate, error);
4201 } // namespace WebKit