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"
37 #include "ImmutableArray.h"
39 #include "MessageID.h"
40 #include "NativeWebKeyboardEvent.h"
41 #include "NativeWebMouseEvent.h"
42 #include "NativeWebWheelEvent.h"
43 #include "NotificationPermissionRequest.h"
44 #include "NotificationPermissionRequestManager.h"
45 #include "PageClient.h"
46 #include "PrintInfo.h"
47 #include "SessionState.h"
48 #include "StringPairVector.h"
49 #include "TextChecker.h"
50 #include "TextCheckerState.h"
51 #include "WKContextPrivate.h"
52 #include "WebBackForwardList.h"
53 #include "WebBackForwardListItem.h"
54 #include "WebCertificateInfo.h"
55 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
56 #include "WebColorPickerResultListenerProxy.h"
58 #include "WebContext.h"
59 #include "WebContextMenuProxy.h"
60 #include "WebContextUserMessageCoders.h"
61 #include "WebCoreArgumentCoders.h"
63 #include "WebEditCommandProxy.h"
65 #include "WebFormSubmissionListenerProxy.h"
66 #include "WebFramePolicyListenerProxy.h"
67 #include "WebFullScreenManagerProxy.h"
68 #include "WebInspectorProxy.h"
69 #include "WebNotificationManagerProxy.h"
70 #include "WebOpenPanelResultListenerProxy.h"
71 #include "WebPageCreationParameters.h"
72 #include "WebPageGroup.h"
73 #include "WebPageGroupData.h"
74 #include "WebPageMessages.h"
75 #include "WebPopupItem.h"
76 #include "WebPopupMenuProxy.h"
77 #include "WebPreferences.h"
78 #include "WebProcessMessages.h"
79 #include "WebProcessProxy.h"
80 #include "WebProtectionSpace.h"
81 #include "WebSecurityOrigin.h"
82 #include "WebURLRequest.h"
83 #include <WebCore/DragController.h>
84 #include <WebCore/DragData.h>
85 #include <WebCore/DragSession.h>
86 #include <WebCore/FloatRect.h>
87 #include <WebCore/FocusDirection.h>
88 #include <WebCore/MIMETypeRegistry.h>
89 #include <WebCore/TextCheckerClient.h>
90 #include <WebCore/WindowFeatures.h>
93 #if ENABLE(WEB_INTENTS)
94 #include "IntentData.h"
95 #include "IntentServiceInfo.h"
96 #include "WebIntentData.h"
97 #include "WebIntentServiceInfo.h"
100 #if USE(UI_SIDE_COMPOSITING)
101 #include "LayerTreeCoordinatorProxyMessages.h"
105 #include "ArgumentCodersQt.h"
109 #include "ArgumentCodersGtk.h"
113 #include "WebSoupRequestManagerProxy.h"
116 #if ENABLE(TIZEN_DRAG_SUPPORT)
117 #include "ArgumentCodersTizen.h"
121 #include <wtf/RefCountedLeakCounter.h>
124 #if ENABLE(TIZEN_ISF_PORT) || ENABLE(TIZEN_GESTURE)
125 #include "EwkViewImpl.h"
126 #include "InputMethodContextEfl.h"
129 #if ENABLE(TIZEN_VIEWPORT_META_TAG)
130 #include <WebCore/EflScreenUtilities.h>
133 // This controls what strategy we use for mouse wheel coalescing.
134 #define MERGE_WHEEL_EVENTS 1
136 #define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, m_process->connection())
137 #define MESSAGE_CHECK_URL(url) MESSAGE_CHECK_BASE(m_process->checkURLReceivedFromWebProcess(url), m_process->connection())
139 using namespace WebCore;
141 // Represents the number of wheel events we can hold in the queue before we start pushing them preemptively.
142 static const unsigned wheelEventQueueSizeThreshold = 10;
146 WKPageDebugPaintFlags WebPageProxy::s_debugPaintFlags = 0;
148 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, webPageProxyCounter, ("WebPageProxy"));
151 static const char* webKeyboardEventTypeString(WebEvent::Type type)
154 case WebEvent::KeyDown:
157 case WebEvent::KeyUp:
160 case WebEvent::RawKeyDown:
167 ASSERT_NOT_REACHED();
171 #endif // !LOG_DISABLED
173 PassRefPtr<WebPageProxy> WebPageProxy::create(PageClient* pageClient, PassRefPtr<WebProcessProxy> process, WebPageGroup* pageGroup, uint64_t pageID)
175 return adoptRef(new WebPageProxy(pageClient, process, pageGroup, pageID));
178 WebPageProxy::WebPageProxy(PageClient* pageClient, PassRefPtr<WebProcessProxy> process, WebPageGroup* pageGroup, uint64_t pageID)
179 : m_pageClient(pageClient)
181 , m_pageGroup(pageGroup)
183 , m_userAgent(standardUserAgent())
184 , m_geolocationPermissionRequestManager(this)
185 , m_notificationPermissionRequestManager(this)
186 #if ENABLE(TIZEN_MEDIA_STREAM)
187 , m_userMediaPermissionRequestManager(this)
189 , m_estimatedProgress(0)
190 , m_isInWindow(m_pageClient->isViewInWindow())
191 , m_isVisible(m_pageClient->isViewVisible())
192 , m_backForwardList(WebBackForwardList::create(this))
193 , m_loadStateAtProcessExit(WebFrameProxy::LoadStateFinished)
194 , m_textZoomFactor(1)
195 , m_pageZoomFactor(1)
196 , m_pageScaleFactor(1)
197 , m_intrinsicDeviceScaleFactor(getMobileDPI() / 160)
198 , m_customDeviceScaleFactor(0)
199 #if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
200 , m_layerHostingMode(LayerHostingModeInWindowServer)
202 , m_layerHostingMode(LayerHostingModeDefault)
204 , m_drawsBackground(true)
205 , m_drawsTransparentBackground(false)
206 , m_areMemoryCacheClientCallsEnabled(true)
207 , m_useFixedLayout(false)
208 , m_paginationMode(Page::Pagination::Unpaginated)
209 , m_paginationBehavesLikeColumns(false)
211 , m_gapBetweenPages(0)
214 , m_canRunModal(false)
215 , m_isInPrintingMode(false)
216 , m_isPerformingDOMPrintOperation(false)
217 , m_inDecidePolicyForResponse(false)
218 , m_syncMimeTypePolicyActionIsValid(false)
219 , m_syncMimeTypePolicyAction(PolicyUse)
220 , m_syncMimeTypePolicyDownloadID(0)
221 , m_inDecidePolicyForNavigationAction(false)
222 , m_syncNavigationActionPolicyActionIsValid(false)
223 , m_syncNavigationActionPolicyAction(PolicyUse)
224 , m_syncNavigationActionPolicyDownloadID(0)
225 , m_processingMouseMoveEvent(false)
226 #if ENABLE(TOUCH_EVENTS)
227 , m_needTouchEvents(false)
229 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
230 , m_askOverflow(true)
233 , m_isPageSuspended(false)
235 , m_isSmartInsertDeleteEnabled(TextChecker::isSmartInsertDeleteEnabled())
237 , m_spellDocumentTag(0)
238 , m_hasSpellDocumentTag(false)
239 , m_pendingLearnOrIgnoreWordMessageCount(0)
240 , m_mainFrameHasCustomRepresentation(false)
241 , m_mainFrameHasHorizontalScrollbar(false)
242 , m_mainFrameHasVerticalScrollbar(false)
243 , m_canShortCircuitHorizontalWheelEvents(true)
244 , m_mainFrameIsPinnedToLeftSide(false)
245 , m_mainFrameIsPinnedToRightSide(false)
247 , m_renderTreeSize(0)
248 , m_shouldSendEventsSynchronously(false)
249 , m_suppressVisibilityUpdates(false)
251 #if ENABLE(PAGE_VISIBILITY_API)
252 , m_visibilityState(PageVisibilityStateVisible)
254 #if ENABLE(TIZEN_REDUCE_KEY_LAGGING)
255 , m_pageContentResumeTimer(0)
257 #if ENABLE(TIZEN_ISF_PORT)
258 , m_didCancelCompositionFromWebProcess(false)
260 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
261 , m_contentSuspendedByInspector(false)
263 #if ENABLE(TIZEN_FOCUS_UI)
264 , m_spatialNavigationEnabled(false)
268 webPageProxyCounter.increment();
271 WebContext::statistics().wkPageCount++;
273 m_pageGroup->addPage(this);
276 WebPageProxy::~WebPageProxy()
281 WebContext::statistics().wkPageCount--;
283 if (m_hasSpellDocumentTag)
284 TextChecker::closeSpellDocumentWithTag(m_spellDocumentTag);
286 m_pageGroup->removePage(this);
289 webPageProxyCounter.decrement();
291 #if ENABLE(TIZEN_REDUCE_KEY_LAGGING)
292 if (m_pageContentResumeTimer)
293 ecore_timer_del(m_pageContentResumeTimer);
297 WebProcessProxy* WebPageProxy::process() const
299 return m_process.get();
302 PlatformProcessIdentifier WebPageProxy::processIdentifier() const
307 return m_process->processIdentifier();
310 bool WebPageProxy::isValid()
312 // A page that has been explicitly closed is never valid.
319 void WebPageProxy::initializeLoaderClient(const WKPageLoaderClient* loadClient)
321 m_loaderClient.initialize(loadClient);
326 process()->send(Messages::WebPage::SetWillGoToBackForwardItemCallbackEnabled(loadClient->version > 0), m_pageID);
329 void WebPageProxy::initializePolicyClient(const WKPagePolicyClient* policyClient)
331 m_policyClient.initialize(policyClient);
334 void WebPageProxy::initializeFormClient(const WKPageFormClient* formClient)
336 m_formClient.initialize(formClient);
339 void WebPageProxy::initializeResourceLoadClient(const WKPageResourceLoadClient* client)
341 m_resourceLoadClient.initialize(client);
344 void WebPageProxy::initializeUIClient(const WKPageUIClient* client)
349 m_uiClient.initialize(client);
351 process()->send(Messages::WebPage::SetCanRunBeforeUnloadConfirmPanel(m_uiClient.canRunBeforeUnloadConfirmPanel()), m_pageID);
352 setCanRunModal(m_uiClient.canRunModal());
355 void WebPageProxy::initializeFindClient(const WKPageFindClient* client)
357 m_findClient.initialize(client);
360 void WebPageProxy::initializeFindMatchesClient(const WKPageFindMatchesClient* client)
362 m_findMatchesClient.initialize(client);
365 #if ENABLE(CONTEXT_MENUS)
366 void WebPageProxy::initializeContextMenuClient(const WKPageContextMenuClient* client)
368 m_contextMenuClient.initialize(client);
372 void WebPageProxy::reattachToWebProcess()
378 m_process = m_process->context()->relaunchProcessIfNecessary();
379 process()->addExistingWebPage(this, m_pageID);
383 m_pageClient->didRelaunchProcess();
384 m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
387 void WebPageProxy::reattachToWebProcessWithItem(WebBackForwardListItem* item)
389 if (item && item != m_backForwardList->currentItem())
390 m_backForwardList->goToItem(item);
392 reattachToWebProcess();
397 process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
398 process()->responsivenessTimer()->start();
401 void WebPageProxy::initializeWebPage()
405 BackForwardListItemVector items = m_backForwardList->entries();
406 for (size_t i = 0; i < items.size(); ++i)
407 process()->registerNewWebBackForwardListItem(items[i].get());
409 m_drawingArea = m_pageClient->createDrawingAreaProxy();
410 ASSERT(m_drawingArea);
412 #if ENABLE(INSPECTOR_SERVER)
413 if (m_pageGroup->preferences()->developerExtrasEnabled())
414 inspector()->enableRemoteInspection();
417 process()->send(Messages::WebProcess::CreateWebPage(m_pageID, creationParameters()), 0);
419 #if ENABLE(PAGE_VISIBILITY_API)
420 process()->send(Messages::WebPage::SetVisibilityState(m_visibilityState, /* isInitialState */ true), m_pageID);
424 void WebPageProxy::close()
431 m_backForwardList->pageClosed();
432 m_pageClient->pageClosed();
434 process()->disconnectFramesFromPage(this);
437 #if ENABLE(INSPECTOR)
439 m_inspector->invalidate();
444 #if ENABLE(FULLSCREEN_API)
445 if (m_fullScreenManager) {
446 m_fullScreenManager->invalidate();
447 m_fullScreenManager = 0;
451 if (m_openPanelResultListener) {
452 m_openPanelResultListener->invalidate();
453 m_openPanelResultListener = 0;
456 #if ENABLE(INPUT_TYPE_COLOR)
457 if (m_colorChooser) {
458 m_colorChooser->invalidate();
459 m_colorChooser = nullptr;
462 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
463 if (m_colorPickerResultListener) {
464 m_colorPickerResultListener->invalidate();
465 m_colorPickerResultListener = nullptr;
470 #if ENABLE(GEOLOCATION)
471 m_geolocationPermissionRequestManager.invalidateRequests();
474 m_notificationPermissionRequestManager.invalidateRequests();
475 #if ENABLE(TIZEN_MEDIA_STREAM)
476 m_userMediaPermissionRequestManager.invalidateRequests();
479 m_toolTip = String();
481 m_mainFrameHasHorizontalScrollbar = false;
482 m_mainFrameHasVerticalScrollbar = false;
484 m_mainFrameIsPinnedToLeftSide = false;
485 m_mainFrameIsPinnedToRightSide = false;
487 m_visibleScrollerThumbRect = IntRect();
489 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
490 invalidateCallbackMap(m_booleanCallbacks);
491 invalidateCallbackMap(m_dictionaryCallbacks);
493 invalidateCallbackMap(m_voidCallbacks);
494 invalidateCallbackMap(m_dataCallbacks);
495 invalidateCallbackMap(m_stringCallbacks);
496 m_loadDependentStringCallbackIDs.clear();
497 invalidateCallbackMap(m_scriptValueCallbacks);
498 invalidateCallbackMap(m_computedPagesCallbacks);
500 invalidateCallbackMap(m_printFinishedCallbacks);
503 Vector<WebEditCommandProxy*> editCommandVector;
504 copyToVector(m_editCommandSet, editCommandVector);
505 m_editCommandSet.clear();
506 for (size_t i = 0, size = editCommandVector.size(); i < size; ++i)
507 editCommandVector[i]->invalidate();
509 m_activePopupMenu = 0;
511 m_estimatedProgress = 0.0;
513 m_loaderClient.initialize(0);
514 m_policyClient.initialize(0);
515 m_uiClient.initialize(0);
517 m_drawingArea = nullptr;
519 process()->send(Messages::WebPage::Close(), m_pageID);
520 process()->removeWebPage(m_pageID);
523 bool WebPageProxy::tryClose()
528 process()->send(Messages::WebPage::TryClose(), m_pageID);
529 process()->responsivenessTimer()->start();
533 bool WebPageProxy::maybeInitializeSandboxExtensionHandle(const KURL& url, SandboxExtension::Handle& sandboxExtensionHandle)
535 if (!url.isLocalFile())
538 #if ENABLE(INSPECTOR)
539 // Don't give the inspector full access to the file system.
540 if (WebInspectorProxy::isInspectorPage(this))
544 SandboxExtension::createHandle("/", SandboxExtension::ReadOnly, sandboxExtensionHandle);
548 void WebPageProxy::loadURL(const String& url)
550 setPendingAPIRequestURL(url);
553 reattachToWebProcess();
555 SandboxExtension::Handle sandboxExtensionHandle;
556 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), url), sandboxExtensionHandle);
557 if (createdExtension)
558 process()->willAcquireUniversalFileReadSandboxExtension();
559 process()->send(Messages::WebPage::LoadURL(url, sandboxExtensionHandle), m_pageID);
560 process()->responsivenessTimer()->start();
563 void WebPageProxy::loadURLRequest(WebURLRequest* urlRequest)
565 setPendingAPIRequestURL(urlRequest->resourceRequest().url());
568 reattachToWebProcess();
570 SandboxExtension::Handle sandboxExtensionHandle;
571 bool createdExtension = maybeInitializeSandboxExtensionHandle(urlRequest->resourceRequest().url(), sandboxExtensionHandle);
572 if (createdExtension)
573 process()->willAcquireUniversalFileReadSandboxExtension();
574 process()->send(Messages::WebPage::LoadURLRequest(urlRequest->resourceRequest(), sandboxExtensionHandle), m_pageID);
575 process()->responsivenessTimer()->start();
578 void WebPageProxy::loadHTMLString(const String& htmlString, const String& baseURL)
581 reattachToWebProcess();
583 process()->assumeReadAccessToBaseURL(baseURL);
584 process()->send(Messages::WebPage::LoadHTMLString(htmlString, baseURL), m_pageID);
585 process()->responsivenessTimer()->start();
588 void WebPageProxy::loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL)
591 reattachToWebProcess();
594 m_mainFrame->setUnreachableURL(unreachableURL);
596 process()->assumeReadAccessToBaseURL(baseURL);
597 process()->send(Messages::WebPage::LoadAlternateHTMLString(htmlString, baseURL, unreachableURL), m_pageID);
598 process()->responsivenessTimer()->start();
601 void WebPageProxy::loadPlainTextString(const String& string)
604 reattachToWebProcess();
606 process()->send(Messages::WebPage::LoadPlainTextString(string), m_pageID);
607 process()->responsivenessTimer()->start();
610 void WebPageProxy::loadWebArchiveData(const WebData* webArchiveData)
613 reattachToWebProcess();
615 process()->send(Messages::WebPage::LoadWebArchiveData(webArchiveData->dataReference()), m_pageID);
616 process()->responsivenessTimer()->start();
620 void WebPageProxy::loadContentsbyMimeType(const WebData* contents, const String& mimeType, const String& encoding, const String& baseURL)
623 reattachToWebProcess();
625 process()->assumeReadAccessToBaseURL(baseURL);
626 #if ENABLE(TIZEN_UNIVERSAL_FILE_READ_ACCESS)
627 SandboxExtension::Handle sandboxExtensionHandleEmail;
628 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), baseURL), sandboxExtensionHandleEmail);
629 if (createdExtension)
630 process()->willAcquireUniversalFileReadSandboxExtension();
632 process()->send(Messages::WebPage::LoadContentsbyMimeType(contents->dataReference(), mimeType, encoding, baseURL), m_pageID);
633 process()->responsivenessTimer()->start();
637 void WebPageProxy::stopLoading()
642 process()->send(Messages::WebPage::StopLoading(), m_pageID);
643 process()->responsivenessTimer()->start();
646 void WebPageProxy::reload(bool reloadFromOrigin)
648 SandboxExtension::Handle sandboxExtensionHandle;
650 if (m_backForwardList->currentItem()) {
651 String url = m_backForwardList->currentItem()->url();
652 setPendingAPIRequestURL(url);
654 // We may not have an extension yet if back/forward list was reinstated after a WebProcess crash or a browser relaunch
655 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), url), sandboxExtensionHandle);
656 if (createdExtension)
657 process()->willAcquireUniversalFileReadSandboxExtension();
661 reattachToWebProcessWithItem(m_backForwardList->currentItem());
665 process()->send(Messages::WebPage::Reload(reloadFromOrigin, sandboxExtensionHandle), m_pageID);
666 process()->responsivenessTimer()->start();
669 void WebPageProxy::goForward()
671 if (isValid() && !canGoForward())
674 WebBackForwardListItem* forwardItem = m_backForwardList->forwardItem();
678 setPendingAPIRequestURL(forwardItem->url());
681 reattachToWebProcessWithItem(forwardItem);
685 process()->send(Messages::WebPage::GoForward(forwardItem->itemID()), m_pageID);
686 process()->responsivenessTimer()->start();
689 bool WebPageProxy::canGoForward() const
691 return m_backForwardList->forwardItem();
694 void WebPageProxy::goBack()
696 if (isValid() && !canGoBack())
699 WebBackForwardListItem* backItem = m_backForwardList->backItem();
703 setPendingAPIRequestURL(backItem->url());
706 reattachToWebProcessWithItem(backItem);
710 process()->send(Messages::WebPage::GoBack(backItem->itemID()), m_pageID);
711 process()->responsivenessTimer()->start();
714 bool WebPageProxy::canGoBack() const
716 return m_backForwardList->backItem();
719 void WebPageProxy::goToBackForwardItem(WebBackForwardListItem* item)
722 reattachToWebProcessWithItem(item);
726 setPendingAPIRequestURL(item->url());
728 process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
729 process()->responsivenessTimer()->start();
732 void WebPageProxy::tryRestoreScrollPosition()
737 process()->send(Messages::WebPage::TryRestoreScrollPosition(), m_pageID);
740 void WebPageProxy::didChangeBackForwardList(WebBackForwardListItem* added, Vector<RefPtr<APIObject> >* removed)
742 m_loaderClient.didChangeBackForwardList(this, added, removed);
745 void WebPageProxy::shouldGoToBackForwardListItem(uint64_t itemID, bool& shouldGoToBackForwardItem)
747 WebBackForwardListItem* item = process()->webBackForwardItem(itemID);
748 shouldGoToBackForwardItem = item && m_loaderClient.shouldGoToBackForwardListItem(this, item);
751 void WebPageProxy::willGoToBackForwardListItem(uint64_t itemID, CoreIPC::ArgumentDecoder* arguments)
753 RefPtr<APIObject> userData;
754 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
755 if (!arguments->decode(messageDecoder))
758 if (WebBackForwardListItem* item = process()->webBackForwardItem(itemID))
759 m_loaderClient.willGoToBackForwardListItem(this, item, userData.get());
762 String WebPageProxy::activeURL() const
764 // If there is a currently pending url, it is the active URL,
765 // even when there's no main frame yet, as it might be the
766 // first API request.
767 if (!m_pendingAPIRequestURL.isNull())
768 return m_pendingAPIRequestURL;
773 if (!m_mainFrame->unreachableURL().isEmpty())
774 return m_mainFrame->unreachableURL();
776 switch (m_mainFrame->loadState()) {
777 case WebFrameProxy::LoadStateProvisional:
778 return m_mainFrame->provisionalURL();
779 case WebFrameProxy::LoadStateCommitted:
780 case WebFrameProxy::LoadStateFinished:
781 return m_mainFrame->url();
784 ASSERT_NOT_REACHED();
788 String WebPageProxy::provisionalURL() const
792 return m_mainFrame->provisionalURL();
795 String WebPageProxy::committedURL() const
800 return m_mainFrame->url();
803 bool WebPageProxy::canShowMIMEType(const String& mimeType) const
805 if (MIMETypeRegistry::canShowMIMEType(mimeType))
808 String newMimeType = mimeType;
809 PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL());
810 if (!plugin.path.isNull() && m_pageGroup->preferences()->pluginsEnabled())
816 void WebPageProxy::setDrawsBackground(bool drawsBackground)
818 if (m_drawsBackground == drawsBackground)
821 m_drawsBackground = drawsBackground;
824 process()->send(Messages::WebPage::SetDrawsBackground(drawsBackground), m_pageID);
827 void WebPageProxy::setDrawsTransparentBackground(bool drawsTransparentBackground)
829 if (m_drawsTransparentBackground == drawsTransparentBackground)
832 m_drawsTransparentBackground = drawsTransparentBackground;
835 process()->send(Messages::WebPage::SetDrawsTransparentBackground(drawsTransparentBackground), m_pageID);
838 void WebPageProxy::viewWillStartLiveResize()
842 process()->send(Messages::WebPage::ViewWillStartLiveResize(), m_pageID);
845 void WebPageProxy::viewWillEndLiveResize()
849 process()->send(Messages::WebPage::ViewWillEndLiveResize(), m_pageID);
852 void WebPageProxy::setViewNeedsDisplay(const IntRect& rect)
854 m_pageClient->setViewNeedsDisplay(rect);
857 void WebPageProxy::displayView()
859 m_pageClient->displayView();
862 void WebPageProxy::scrollView(const IntRect& scrollRect, const IntSize& scrollOffset)
864 m_pageClient->scrollView(scrollRect, scrollOffset);
867 void WebPageProxy::viewStateDidChange(ViewStateFlags flags)
872 if (flags & ViewIsFocused)
873 process()->send(Messages::WebPage::SetFocused(m_pageClient->isViewFocused()), m_pageID);
875 if (flags & ViewWindowIsActive)
876 process()->send(Messages::WebPage::SetActive(m_pageClient->isViewWindowActive()), m_pageID);
878 if (flags & ViewIsVisible) {
879 bool isVisible = m_pageClient->isViewVisible();
880 if (isVisible != m_isVisible) {
881 m_isVisible = isVisible;
882 m_drawingArea->visibilityDidChange();
885 // If we've started the responsiveness timer as part of telling the web process to update the backing store
886 // state, it might not send back a reply (since it won't paint anything if the web page is hidden) so we
887 // stop the unresponsiveness timer here.
888 process()->responsivenessTimer()->stop();
893 if (flags & ViewIsInWindow) {
894 bool isInWindow = m_pageClient->isViewInWindow();
895 if (m_isInWindow != isInWindow) {
896 m_isInWindow = isInWindow;
897 process()->send(Messages::WebPage::SetIsInWindow(isInWindow), m_pageID);
901 LayerHostingMode layerHostingMode = m_pageClient->viewLayerHostingMode();
902 if (m_layerHostingMode != layerHostingMode) {
903 m_layerHostingMode = layerHostingMode;
904 m_drawingArea->layerHostingModeDidChange();
909 #if ENABLE(PAGE_VISIBILITY_API)
910 PageVisibilityState visibilityState = PageVisibilityStateHidden;
912 if (m_pageClient->isViewVisible())
913 visibilityState = PageVisibilityStateVisible;
915 if (visibilityState != m_visibilityState) {
916 m_visibilityState = visibilityState;
917 process()->send(Messages::WebPage::SetVisibilityState(visibilityState, false), m_pageID);
921 updateBackingStoreDiscardableState();
924 IntSize WebPageProxy::viewSize() const
926 return m_pageClient->viewSize();
929 void WebPageProxy::setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent& keyboardEvent)
933 process()->send(Messages::WebPage::SetInitialFocus(forward, isKeyboardEventValid, keyboardEvent), m_pageID);
936 void WebPageProxy::setWindowResizerSize(const IntSize& windowResizerSize)
940 process()->send(Messages::WebPage::SetWindowResizerSize(windowResizerSize), m_pageID);
943 void WebPageProxy::clearSelection()
947 process()->send(Messages::WebPage::ClearSelection(), m_pageID);
950 void WebPageProxy::validateCommand(const String& commandName, PassRefPtr<ValidateCommandCallback> callback)
953 callback->invalidate();
957 uint64_t callbackID = callback->callbackID();
958 m_validateCommandCallbacks.set(callbackID, callback.get());
959 process()->send(Messages::WebPage::ValidateCommand(commandName, callbackID), m_pageID);
962 void WebPageProxy::setMaintainsInactiveSelection(bool newValue)
964 m_maintainsInactiveSelection = newValue;
967 void WebPageProxy::executeEditCommand(const String& commandName)
972 DEFINE_STATIC_LOCAL(String, ignoreSpellingCommandName, ("ignoreSpelling"));
973 if (commandName == ignoreSpellingCommandName)
974 ++m_pendingLearnOrIgnoreWordMessageCount;
976 process()->send(Messages::WebPage::ExecuteEditCommand(commandName), m_pageID);
979 #if USE(TILED_BACKING_STORE)
980 void WebPageProxy::setViewportSize(const IntSize& size)
985 process()->send(Messages::WebPage::SetViewportSize(size), m_pageID);
989 #if ENABLE(DRAG_SUPPORT)
990 void WebPageProxy::dragEntered(DragData* dragData, const String& dragStorageName)
992 SandboxExtension::Handle sandboxExtensionHandle;
993 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
994 performDragControllerAction(DragControllerActionEntered, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
997 void WebPageProxy::dragUpdated(DragData* dragData, const String& dragStorageName)
999 SandboxExtension::Handle sandboxExtensionHandle;
1000 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
1001 performDragControllerAction(DragControllerActionUpdated, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
1004 void WebPageProxy::dragExited(DragData* dragData, const String& dragStorageName)
1006 SandboxExtension::Handle sandboxExtensionHandle;
1007 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
1008 performDragControllerAction(DragControllerActionExited, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
1011 #if ENABLE(TIZEN_DRAG_SUPPORT)
1012 void WebPageProxy::performDrag(DragData* dragData, const String& dragStorageName)
1014 void WebPageProxy::performDrag(DragData* dragData, const String& dragStorageName, const SandboxExtension::Handle& sandboxExtensionHandle, const SandboxExtension::HandleArray& sandboxExtensionsForUpload)
1017 #if ENABLE(TIZEN_DRAG_SUPPORT)
1018 TIZEN_LOGI("dragData (%p)", dragData);
1019 SandboxExtension::Handle sandboxExtensionHandle;
1020 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
1021 performDragControllerAction(DragControllerActionPerformDrag, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
1023 performDragControllerAction(DragControllerActionPerformDrag, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionsForUpload);
1027 void WebPageProxy::performDragControllerAction(DragControllerAction action, DragData* dragData, const String& dragStorageName, const SandboxExtension::Handle& sandboxExtensionHandle, const SandboxExtension::HandleArray& sandboxExtensionsForUpload)
1032 // FIXME: We should pass the drag data map only on DragEnter.
1033 process()->send(Messages::WebPage::PerformDragControllerAction(action, dragData->clientPosition(), dragData->globalPosition(),
1034 dragData->draggingSourceOperationMask(), dragData->dragDataMap(), dragData->flags()), m_pageID);
1035 #elif PLATFORM(QT) || PLATFORM(GTK) || ENABLE(TIZEN_DRAG_SUPPORT)
1036 process()->send(Messages::WebPage::PerformDragControllerAction(action, *dragData), m_pageID);
1038 process()->send(Messages::WebPage::PerformDragControllerAction(action, dragData->clientPosition(), dragData->globalPosition(), dragData->draggingSourceOperationMask(), dragStorageName, dragData->flags(), sandboxExtensionHandle, sandboxExtensionsForUpload), m_pageID);
1042 void WebPageProxy::didPerformDragControllerAction(WebCore::DragSession dragSession)
1044 m_currentDragSession = dragSession;
1047 #if PLATFORM(QT) || PLATFORM(GTK) || ENABLE(TIZEN_DRAG_SUPPORT)
1048 void WebPageProxy::startDrag(const DragData& dragData, const ShareableBitmap::Handle& dragImageHandle)
1050 TIZEN_LOGI("dragData (%p)", dragData);
1051 RefPtr<ShareableBitmap> dragImage = 0;
1052 if (!dragImageHandle.isNull()) {
1053 dragImage = ShareableBitmap::create(dragImageHandle);
1058 m_pageClient->startDrag(dragData, dragImage.release());
1062 void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& globalPosition, uint64_t operation)
1064 TIZEN_LOGI("clientPosition (%p)", clientPosition);
1067 process()->send(Messages::WebPage::DragEnded(clientPosition, globalPosition, operation), m_pageID);
1069 #endif // ENABLE(DRAG_SUPPORT)
1071 void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event)
1076 // NOTE: This does not start the responsiveness timer because mouse move should not indicate interaction.
1077 if (event.type() != WebEvent::MouseMove)
1078 process()->responsivenessTimer()->start();
1080 if (m_processingMouseMoveEvent) {
1081 m_nextMouseMoveEvent = adoptPtr(new NativeWebMouseEvent(event));
1085 m_processingMouseMoveEvent = true;
1088 // <https://bugs.webkit.org/show_bug.cgi?id=57904> We need to keep track of the mouse down event in the case where we
1089 // display a popup menu for select elements. When the user changes the selected item,
1090 // we fake a mouse up event by using this stored down event. This event gets cleared
1091 // when the mouse up message is received from WebProcess.
1092 if (event.type() == WebEvent::MouseDown)
1093 m_currentlyProcessedMouseDownEvent = adoptPtr(new NativeWebMouseEvent(event));
1095 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
1096 // We have to hide text-selection's context menu when other area is clicked.
1097 // In case of normal context menu, it is hided by elm_ctxpopup's logic.
1098 if (event.type() == WebEvent::MouseDown)
1102 if (m_shouldSendEventsSynchronously) {
1103 bool handled = false;
1104 process()->sendSync(Messages::WebPage::MouseEventSyncForTesting(event), Messages::WebPage::MouseEventSyncForTesting::Reply(handled), m_pageID);
1105 didReceiveEvent(event.type(), handled);
1107 process()->send(Messages::WebPage::MouseEvent(event), m_pageID);
1110 #if MERGE_WHEEL_EVENTS
1111 static bool canCoalesce(const WebWheelEvent& a, const WebWheelEvent& b)
1113 if (a.position() != b.position())
1115 if (a.globalPosition() != b.globalPosition())
1117 if (a.modifiers() != b.modifiers())
1119 if (a.granularity() != b.granularity())
1122 if (a.phase() != b.phase())
1124 if (a.momentumPhase() != b.momentumPhase())
1126 if (a.hasPreciseScrollingDeltas() != b.hasPreciseScrollingDeltas())
1133 static WebWheelEvent coalesce(const WebWheelEvent& a, const WebWheelEvent& b)
1135 ASSERT(canCoalesce(a, b));
1137 FloatSize mergedDelta = a.delta() + b.delta();
1138 FloatSize mergedWheelTicks = a.wheelTicks() + b.wheelTicks();
1141 FloatSize mergedUnacceleratedScrollingDelta = a.unacceleratedScrollingDelta() + b.unacceleratedScrollingDelta();
1143 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());
1145 return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.modifiers(), b.timestamp());
1148 #endif // MERGE_WHEEL_EVENTS
1150 static WebWheelEvent coalescedWheelEvent(Deque<NativeWebWheelEvent>& queue, Vector<NativeWebWheelEvent>& coalescedEvents)
1152 ASSERT(!queue.isEmpty());
1153 ASSERT(coalescedEvents.isEmpty());
1155 #if MERGE_WHEEL_EVENTS
1156 NativeWebWheelEvent firstEvent = queue.takeFirst();
1157 coalescedEvents.append(firstEvent);
1159 WebWheelEvent event = firstEvent;
1160 while (!queue.isEmpty() && canCoalesce(event, queue.first())) {
1161 NativeWebWheelEvent firstEvent = queue.takeFirst();
1162 coalescedEvents.append(firstEvent);
1163 event = coalesce(event, firstEvent);
1168 while (!queue.isEmpty())
1169 coalescedEvents.append(queue.takeFirst());
1170 return coalescedEvents.last();
1174 void WebPageProxy::handleWheelEvent(const NativeWebWheelEvent& event)
1179 if (!m_currentlyProcessedWheelEvents.isEmpty()) {
1180 m_wheelEventQueue.append(event);
1181 if (m_wheelEventQueue.size() < wheelEventQueueSizeThreshold)
1183 // The queue has too many wheel events, so push a new event.
1186 if (!m_wheelEventQueue.isEmpty()) {
1187 processNextQueuedWheelEvent();
1191 OwnPtr<Vector<NativeWebWheelEvent> > coalescedWheelEvent = adoptPtr(new Vector<NativeWebWheelEvent>);
1192 coalescedWheelEvent->append(event);
1193 m_currentlyProcessedWheelEvents.append(coalescedWheelEvent.release());
1194 sendWheelEvent(event);
1197 void WebPageProxy::processNextQueuedWheelEvent()
1199 OwnPtr<Vector<NativeWebWheelEvent> > nextCoalescedEvent = adoptPtr(new Vector<NativeWebWheelEvent>);
1200 WebWheelEvent nextWheelEvent = coalescedWheelEvent(m_wheelEventQueue, *nextCoalescedEvent.get());
1201 m_currentlyProcessedWheelEvents.append(nextCoalescedEvent.release());
1202 sendWheelEvent(nextWheelEvent);
1205 void WebPageProxy::sendWheelEvent(const WebWheelEvent& event)
1207 process()->responsivenessTimer()->start();
1209 if (m_shouldSendEventsSynchronously) {
1210 bool handled = false;
1211 process()->sendSync(Messages::WebPage::WheelEventSyncForTesting(event), Messages::WebPage::WheelEventSyncForTesting::Reply(handled), m_pageID);
1212 didReceiveEvent(event.type(), handled);
1216 process()->send(Messages::EventDispatcher::WheelEvent(m_pageID, event, canGoBack(), canGoForward()), 0);
1219 void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event)
1224 LOG(KeyHandling, "WebPageProxy::handleKeyboardEvent: %s", webKeyboardEventTypeString(event.type()));
1226 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1227 if (!isWaitingForJavaScriptPopupReply()) {
1228 m_keyEventQueue.append(event);
1230 process()->responsivenessTimer()->start();
1231 if (m_shouldSendEventsSynchronously) {
1232 bool handled = false;
1233 process()->sendSync(Messages::WebPage::KeyEventSyncForTesting(event), Messages::WebPage::KeyEventSyncForTesting::Reply(handled), m_pageID);
1234 didReceiveEvent(event.type(), handled);
1236 process()->send(Messages::WebPage::KeyEvent(event), m_pageID);
1238 if (m_keyEventQueue.isEmpty()) {
1239 bool handled = false;
1240 m_pageClient->doneWithKeyEvent(event, handled);
1242 QueuedUIEvents<NativeWebKeyboardEvent>& lastEvent = m_keyEventQueue.last();
1243 lastEvent.deferredEvents.append(event);
1247 m_keyEventQueue.append(event);
1249 process()->responsivenessTimer()->start();
1250 if (m_shouldSendEventsSynchronously) {
1251 bool handled = false;
1252 process()->sendSync(Messages::WebPage::KeyEventSyncForTesting(event), Messages::WebPage::KeyEventSyncForTesting::Reply(handled), m_pageID);
1253 didReceiveEvent(event.type(), handled);
1254 } else if (m_keyEventQueue.size() == 1) // Otherwise, sent from DidReceiveEvent message handler.
1255 process()->send(Messages::WebPage::KeyEvent(event), m_pageID);
1259 #if ENABLE(GESTURE_EVENTS)
1260 void WebPageProxy::handleGestureEvent(const WebGestureEvent& event)
1265 #if ENABLE(TIZEN_ISF_PORT) || ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
1266 if (event.type() == WebEvent::GestureSingleTap) {
1267 #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
1268 FocusRing* focusRing = ewkViewGetFocusRing(viewWidget());
1270 IntPoint tapPosition = EwkViewImpl::fromEvasObject(viewWidget())->transformToScene().mapPoint(event.position());
1271 focusRing->requestToShow(tapPosition, true);
1275 #if ENABLE(TIZEN_ISF_PORT)
1276 InputMethodContextEfl* inputMethodContext = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->inputMethodContext();
1277 if (inputMethodContext)
1278 inputMethodContext->resetIMFContext();
1283 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1284 if (!isWaitingForJavaScriptPopupReply()) {
1285 m_gestureEventQueue.append(event);
1287 process()->responsivenessTimer()->start();
1288 process()->send(Messages::EventDispatcher::GestureEvent(m_pageID, event), 0);
1290 if (m_gestureEventQueue.isEmpty()) {
1291 bool isEventHandled = false;
1292 m_pageClient->doneWithGestureEvent(event, isEventHandled);
1294 QueuedUIEvents<WebGestureEvent>& lastEvent = m_gestureEventQueue.last();
1295 lastEvent.deferredEvents.append(event);
1299 m_gestureEventQueue.append(event);
1301 process()->responsivenessTimer()->start();
1302 process()->send(Messages::EventDispatcher::GestureEvent(m_pageID, event), 0);
1307 #if ENABLE(TOUCH_EVENTS)
1309 void WebPageProxy::handlePotentialActivation(const IntPoint& touchPoint, const IntSize& touchArea)
1311 process()->send(Messages::WebPage::HighlightPotentialActivation(touchPoint, touchArea), m_pageID);
1315 void WebPageProxy::handleTouchEvent(const NativeWebTouchEvent& event)
1317 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
1318 if (!isValid() || isContentSuspendedByInspector())
1324 // If the page is suspended, which should be the case during panning, pinching
1325 // and animation on the page itself (kinetic scrolling, tap to zoom) etc, then
1326 // we do not send any of the events to the page even if is has listeners.
1327 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1328 if (m_needTouchEvents && !m_isPageSuspended && !isWaitingForJavaScriptPopupReply()) {
1330 if (m_needTouchEvents && !m_isPageSuspended) {
1333 // Do not send the TouchMove event if last TouchMove is not processed yet.
1334 // TouchMove event will be sent too many times without below codes,
1335 // and it will affect Web Applications' performance.
1336 if (event.type() == WebEvent::TouchMove
1337 && !m_touchEventQueue.isEmpty()
1338 && m_touchEventQueue.last().forwardedEvent.type() == event.type())
1341 m_touchEventQueue.append(event);
1342 process()->responsivenessTimer()->start();
1343 if (m_shouldSendEventsSynchronously) {
1344 bool handled = false;
1345 process()->sendSync(Messages::WebPage::TouchEventSyncForTesting(event), Messages::WebPage::TouchEventSyncForTesting::Reply(handled), m_pageID);
1346 didReceiveEvent(event.type(), handled);
1348 process()->send(Messages::WebPage::TouchEvent(event), m_pageID);
1350 if (m_touchEventQueue.isEmpty()) {
1351 bool isEventHandled = false;
1352 m_pageClient->doneWithTouchEvent(event, isEventHandled);
1354 // We attach the incoming events to the newest queued event so that all
1355 // the events are delivered in the correct order when the event is dequed.
1356 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1357 QueuedUIEvents<NativeWebTouchEvent>& lastEvent = m_touchEventQueue.last();
1358 lastEvent.deferredEvents.append(event);
1360 QueuedTouchEvents& lastEvent = m_touchEventQueue.last();
1361 lastEvent.deferredTouchEvents.append(event);
1368 #if ENABLE(SCREEN_ORIENTATION_SUPPORT) && ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT)
1369 void WebPageProxy::lockOrientation(int willLockOrientation, bool& result)
1371 result = m_pageClient->lockOrientation(willLockOrientation);
1373 void WebPageProxy::unlockOrientation()
1375 m_pageClient->unlockOrientation();
1379 void WebPageProxy::scrollBy(ScrollDirection direction, ScrollGranularity granularity)
1384 process()->send(Messages::WebPage::ScrollBy(direction, granularity), m_pageID);
1387 void WebPageProxy::centerSelectionInVisibleArea()
1392 process()->send(Messages::WebPage::CenterSelectionInVisibleArea(), m_pageID);
1395 #if ENABLE(TIZEN_DOWNLOAD_ATTRIBUTE)
1396 void WebPageProxy::startDownload(const ResourceRequest& request, const String& /*suggestedName*/)
1398 // FIXME: suggestedName need to be passed to provide a suggested destination file name
1399 m_process->context()->download(this, request);
1403 void WebPageProxy::receivedPolicyDecision(PolicyAction action, WebFrameProxy* frame, uint64_t listenerID)
1408 if (action == PolicyIgnore)
1409 clearPendingAPIRequestURL();
1411 uint64_t downloadID = 0;
1412 if (action == PolicyDownload) {
1413 // Create a download proxy.
1414 DownloadProxy* download = m_process->context()->createDownloadProxy();
1415 downloadID = download->downloadID();
1416 #if PLATFORM(QT) || PLATFORM(EFL)
1417 // Our design does not suppport downloads without a WebPage.
1418 handleDownloadRequest(download);
1422 // If we received a policy decision while in decidePolicyForResponse the decision will
1423 // be sent back to the web process by decidePolicyForResponse.
1424 if (m_inDecidePolicyForResponse) {
1425 m_syncMimeTypePolicyActionIsValid = true;
1426 m_syncMimeTypePolicyAction = action;
1427 m_syncMimeTypePolicyDownloadID = downloadID;
1431 // If we received a policy decision while in decidePolicyForNavigationAction the decision will
1432 // be sent back to the web process by decidePolicyForNavigationAction.
1433 if (m_inDecidePolicyForNavigationAction) {
1434 m_syncNavigationActionPolicyActionIsValid = true;
1435 m_syncNavigationActionPolicyAction = action;
1436 m_syncNavigationActionPolicyDownloadID = downloadID;
1440 process()->send(Messages::WebPage::DidReceivePolicyDecision(frame->frameID(), listenerID, action, downloadID), m_pageID);
1443 String WebPageProxy::pageTitle() const
1445 // Return the null string if there is no main frame (e.g. nothing has been loaded in the page yet, WebProcess has
1446 // crashed, page has been closed).
1450 return m_mainFrame->title();
1453 void WebPageProxy::setUserAgent(const String& userAgent)
1455 if (m_userAgent == userAgent)
1457 m_userAgent = userAgent;
1461 process()->send(Messages::WebPage::SetUserAgent(m_userAgent), m_pageID);
1464 void WebPageProxy::setApplicationNameForUserAgent(const String& applicationName)
1466 if (m_applicationNameForUserAgent == applicationName)
1469 m_applicationNameForUserAgent = applicationName;
1470 if (!m_customUserAgent.isEmpty())
1473 setUserAgent(standardUserAgent(m_applicationNameForUserAgent));
1476 void WebPageProxy::setCustomUserAgent(const String& customUserAgent)
1478 if (m_customUserAgent == customUserAgent)
1481 m_customUserAgent = customUserAgent;
1483 if (m_customUserAgent.isEmpty()) {
1484 setUserAgent(standardUserAgent(m_applicationNameForUserAgent));
1488 setUserAgent(m_customUserAgent);
1491 void WebPageProxy::resumeActiveDOMObjectsAndAnimations()
1493 if (!isValid() || !m_isPageSuspended)
1496 m_isPageSuspended = false;
1498 process()->send(Messages::WebPage::ResumeActiveDOMObjectsAndAnimations(), m_pageID);
1501 void WebPageProxy::suspendActiveDOMObjectsAndAnimations()
1503 if (!isValid() || m_isPageSuspended)
1506 m_isPageSuspended = true;
1508 process()->send(Messages::WebPage::SuspendActiveDOMObjectsAndAnimations(), m_pageID);
1511 bool WebPageProxy::supportsTextEncoding() const
1513 return !m_mainFrameHasCustomRepresentation && m_mainFrame && !m_mainFrame->isDisplayingStandaloneImageDocument();
1516 void WebPageProxy::setCustomTextEncodingName(const String& encodingName)
1518 if (m_customTextEncodingName == encodingName)
1520 m_customTextEncodingName = encodingName;
1524 process()->send(Messages::WebPage::SetCustomTextEncodingName(encodingName), m_pageID);
1527 void WebPageProxy::terminateProcess()
1529 // NOTE: This uses a check of m_isValid rather than calling isValid() since
1530 // we want this to run even for pages being closed or that already closed.
1534 process()->terminate();
1537 #if !USE(CF) || defined(BUILDING_QT__)
1538 PassRefPtr<WebData> WebPageProxy::sessionStateData(WebPageProxySessionStateFilterCallback, void* context) const
1540 // FIXME: Return session state data for saving Page state.
1544 void WebPageProxy::restoreFromSessionStateData(WebData*)
1546 // FIXME: Restore the Page from the passed in session state data.
1550 bool WebPageProxy::supportsTextZoom() const
1552 if (m_mainFrameHasCustomRepresentation)
1555 // FIXME: This should also return false for standalone media and plug-in documents.
1556 if (!m_mainFrame || m_mainFrame->isDisplayingStandaloneImageDocument())
1562 void WebPageProxy::setTextZoomFactor(double zoomFactor)
1567 if (m_mainFrameHasCustomRepresentation)
1570 if (m_textZoomFactor == zoomFactor)
1573 m_textZoomFactor = zoomFactor;
1574 process()->send(Messages::WebPage::SetTextZoomFactor(m_textZoomFactor), m_pageID);
1577 double WebPageProxy::pageZoomFactor() const
1579 return m_mainFrameHasCustomRepresentation ? m_pageClient->customRepresentationZoomFactor() : m_pageZoomFactor;
1582 void WebPageProxy::setPageZoomFactor(double zoomFactor)
1587 if (m_mainFrameHasCustomRepresentation) {
1588 m_pageClient->setCustomRepresentationZoomFactor(zoomFactor);
1592 if (m_pageZoomFactor == zoomFactor)
1595 m_pageZoomFactor = zoomFactor;
1596 process()->send(Messages::WebPage::SetPageZoomFactor(m_pageZoomFactor), m_pageID);
1599 void WebPageProxy::setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor)
1604 if (m_mainFrameHasCustomRepresentation) {
1605 m_pageClient->setCustomRepresentationZoomFactor(pageZoomFactor);
1609 if (m_pageZoomFactor == pageZoomFactor && m_textZoomFactor == textZoomFactor)
1612 m_pageZoomFactor = pageZoomFactor;
1613 m_textZoomFactor = textZoomFactor;
1614 process()->send(Messages::WebPage::SetPageAndTextZoomFactors(m_pageZoomFactor, m_textZoomFactor), m_pageID);
1617 void WebPageProxy::scalePage(double scale, const IntPoint& origin)
1622 process()->send(Messages::WebPage::ScalePage(scale, origin), m_pageID);
1625 void WebPageProxy::setIntrinsicDeviceScaleFactor(float scaleFactor)
1627 if (m_intrinsicDeviceScaleFactor == scaleFactor)
1630 m_intrinsicDeviceScaleFactor = scaleFactor;
1633 m_drawingArea->deviceScaleFactorDidChange();
1636 void WebPageProxy::windowScreenDidChange(PlatformDisplayID displayID)
1641 process()->send(Messages::WebPage::WindowScreenDidChange(displayID), m_pageID);
1644 float WebPageProxy::deviceScaleFactor() const
1646 if (m_customDeviceScaleFactor)
1647 return m_customDeviceScaleFactor;
1648 return m_intrinsicDeviceScaleFactor;
1651 void WebPageProxy::setCustomDeviceScaleFactor(float customScaleFactor)
1656 if (m_customDeviceScaleFactor == customScaleFactor)
1659 float oldScaleFactor = deviceScaleFactor();
1661 m_customDeviceScaleFactor = customScaleFactor;
1663 if (deviceScaleFactor() != oldScaleFactor)
1664 m_drawingArea->deviceScaleFactorDidChange();
1667 void WebPageProxy::setUseFixedLayout(bool fixed)
1672 // This check is fine as the value is initialized in the web
1673 // process as part of the creation parameters.
1674 if (fixed == m_useFixedLayout)
1677 m_useFixedLayout = fixed;
1679 m_fixedLayoutSize = IntSize();
1680 process()->send(Messages::WebPage::SetUseFixedLayout(fixed), m_pageID);
1683 void WebPageProxy::setFixedLayoutSize(const IntSize& size)
1688 if (size == m_fixedLayoutSize)
1691 m_fixedLayoutSize = size;
1692 process()->send(Messages::WebPage::SetFixedLayoutSize(size), m_pageID);
1695 void WebPageProxy::setPaginationMode(WebCore::Page::Pagination::Mode mode)
1697 if (mode == m_paginationMode)
1700 m_paginationMode = mode;
1704 process()->send(Messages::WebPage::SetPaginationMode(mode), m_pageID);
1707 void WebPageProxy::setPaginationBehavesLikeColumns(bool behavesLikeColumns)
1709 if (behavesLikeColumns == m_paginationBehavesLikeColumns)
1712 m_paginationBehavesLikeColumns = behavesLikeColumns;
1716 process()->send(Messages::WebPage::SetPaginationBehavesLikeColumns(behavesLikeColumns), m_pageID);
1719 void WebPageProxy::setPageLength(double pageLength)
1721 if (pageLength == m_pageLength)
1724 m_pageLength = pageLength;
1728 process()->send(Messages::WebPage::SetPageLength(pageLength), m_pageID);
1731 void WebPageProxy::setGapBetweenPages(double gap)
1733 if (gap == m_gapBetweenPages)
1736 m_gapBetweenPages = gap;
1740 process()->send(Messages::WebPage::SetGapBetweenPages(gap), m_pageID);
1743 void WebPageProxy::pageScaleFactorDidChange(double scaleFactor)
1745 m_pageScaleFactor = scaleFactor;
1746 m_pageClient->pageScaleFactorDidChange();
1749 void WebPageProxy::setMemoryCacheClientCallsEnabled(bool memoryCacheClientCallsEnabled)
1754 if (m_areMemoryCacheClientCallsEnabled == memoryCacheClientCallsEnabled)
1757 m_areMemoryCacheClientCallsEnabled = memoryCacheClientCallsEnabled;
1758 process()->send(Messages::WebPage::SetMemoryCacheMessagesEnabled(memoryCacheClientCallsEnabled), m_pageID);
1761 void WebPageProxy::findStringMatches(const String& string, FindOptions options, unsigned maxMatchCount)
1763 if (string.isEmpty()) {
1764 didFindStringMatches(string, Vector<Vector<WebCore::IntRect> > (), 0);
1768 m_process->send(Messages::WebPage::FindStringMatches(string, options, maxMatchCount), m_pageID);
1771 void WebPageProxy::findString(const String& string, FindOptions options, unsigned maxMatchCount)
1773 if (m_mainFrameHasCustomRepresentation)
1774 m_pageClient->findStringInCustomRepresentation(string, options, maxMatchCount);
1776 process()->send(Messages::WebPage::FindString(string, options, maxMatchCount), m_pageID);
1779 void WebPageProxy::getImageForFindMatch(int32_t matchIndex)
1781 m_process->send(Messages::WebPage::GetImageForFindMatch(matchIndex), m_pageID);
1784 void WebPageProxy::selectFindMatch(int32_t matchIndex)
1786 m_process->send(Messages::WebPage::SelectFindMatch(matchIndex), m_pageID);
1789 void WebPageProxy::hideFindUI()
1791 process()->send(Messages::WebPage::HideFindUI(), m_pageID);
1794 void WebPageProxy::countStringMatches(const String& string, FindOptions options, unsigned maxMatchCount)
1796 if (m_mainFrameHasCustomRepresentation) {
1797 m_pageClient->countStringMatchesInCustomRepresentation(string, options, maxMatchCount);
1804 process()->send(Messages::WebPage::CountStringMatches(string, options, maxMatchCount), m_pageID);
1807 void WebPageProxy::runJavaScriptInMainFrame(const String& script, PassRefPtr<ScriptValueCallback> prpCallback)
1809 RefPtr<ScriptValueCallback> callback = prpCallback;
1811 callback->invalidate();
1815 uint64_t callbackID = callback->callbackID();
1816 m_scriptValueCallbacks.set(callbackID, callback.get());
1817 process()->send(Messages::WebPage::RunJavaScriptInMainFrame(script, callbackID), m_pageID);
1820 void WebPageProxy::getRenderTreeExternalRepresentation(PassRefPtr<StringCallback> prpCallback)
1822 RefPtr<StringCallback> callback = prpCallback;
1824 callback->invalidate();
1828 uint64_t callbackID = callback->callbackID();
1829 m_stringCallbacks.set(callbackID, callback.get());
1830 process()->send(Messages::WebPage::GetRenderTreeExternalRepresentation(callbackID), m_pageID);
1833 void WebPageProxy::getSourceForFrame(WebFrameProxy* frame, PassRefPtr<StringCallback> prpCallback)
1835 RefPtr<StringCallback> callback = prpCallback;
1837 callback->invalidate();
1841 uint64_t callbackID = callback->callbackID();
1842 m_loadDependentStringCallbackIDs.add(callbackID);
1843 m_stringCallbacks.set(callbackID, callback.get());
1844 process()->send(Messages::WebPage::GetSourceForFrame(frame->frameID(), callbackID), m_pageID);
1847 #if ENABLE(WEB_INTENTS)
1848 void WebPageProxy::deliverIntentToFrame(WebFrameProxy* frame, WebIntentData* webIntentData)
1853 process()->send(Messages::WebPage::DeliverIntentToFrame(frame->frameID(), webIntentData->store()), m_pageID);
1857 void WebPageProxy::getContentsAsString(PassRefPtr<StringCallback> prpCallback)
1859 RefPtr<StringCallback> callback = prpCallback;
1861 callback->invalidate();
1865 uint64_t callbackID = callback->callbackID();
1866 m_loadDependentStringCallbackIDs.add(callbackID);
1867 m_stringCallbacks.set(callbackID, callback.get());
1868 process()->send(Messages::WebPage::GetContentsAsString(callbackID), m_pageID);
1872 void WebPageProxy::getContentsAsMHTMLData(PassRefPtr<DataCallback> prpCallback, bool useBinaryEncoding)
1874 RefPtr<DataCallback> callback = prpCallback;
1876 callback->invalidate();
1880 uint64_t callbackID = callback->callbackID();
1881 m_dataCallbacks.set(callbackID, callback.get());
1882 process()->send(Messages::WebPage::GetContentsAsMHTMLData(callbackID, useBinaryEncoding), m_pageID);
1886 void WebPageProxy::getSelectionOrContentsAsString(PassRefPtr<StringCallback> prpCallback)
1888 RefPtr<StringCallback> callback = prpCallback;
1890 callback->invalidate();
1894 uint64_t callbackID = callback->callbackID();
1895 m_stringCallbacks.set(callbackID, callback.get());
1896 process()->send(Messages::WebPage::GetSelectionOrContentsAsString(callbackID), m_pageID);
1899 void WebPageProxy::getMainResourceDataOfFrame(WebFrameProxy* frame, PassRefPtr<DataCallback> prpCallback)
1901 RefPtr<DataCallback> callback = prpCallback;
1903 callback->invalidate();
1907 uint64_t callbackID = callback->callbackID();
1908 m_dataCallbacks.set(callbackID, callback.get());
1909 process()->send(Messages::WebPage::GetMainResourceDataOfFrame(frame->frameID(), callbackID), m_pageID);
1912 void WebPageProxy::getResourceDataFromFrame(WebFrameProxy* frame, WebURL* resourceURL, PassRefPtr<DataCallback> prpCallback)
1914 RefPtr<DataCallback> callback = prpCallback;
1916 callback->invalidate();
1920 uint64_t callbackID = callback->callbackID();
1921 m_dataCallbacks.set(callbackID, callback.get());
1922 process()->send(Messages::WebPage::GetResourceDataFromFrame(frame->frameID(), resourceURL->string(), callbackID), m_pageID);
1925 void WebPageProxy::getWebArchiveOfFrame(WebFrameProxy* frame, PassRefPtr<DataCallback> prpCallback)
1927 RefPtr<DataCallback> callback = prpCallback;
1929 callback->invalidate();
1933 uint64_t callbackID = callback->callbackID();
1934 m_dataCallbacks.set(callbackID, callback.get());
1935 process()->send(Messages::WebPage::GetWebArchiveOfFrame(frame->frameID(), callbackID), m_pageID);
1938 void WebPageProxy::forceRepaint(PassRefPtr<VoidCallback> prpCallback)
1940 RefPtr<VoidCallback> callback = prpCallback;
1942 callback->invalidate();
1946 uint64_t callbackID = callback->callbackID();
1947 m_voidCallbacks.set(callbackID, callback.get());
1948 m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
1949 process()->send(Messages::WebPage::ForceRepaint(callbackID), m_pageID);
1952 void WebPageProxy::preferencesDidChange()
1957 #if ENABLE(INSPECTOR_SERVER)
1958 if (m_pageGroup->preferences()->developerExtrasEnabled())
1959 inspector()->enableRemoteInspection();
1962 // FIXME: It probably makes more sense to send individual preference changes.
1963 // However, WebKitTestRunner depends on getting a preference change notification
1964 // even if nothing changed in UI process, so that overrides get removed.
1966 // Preferences need to be updated during synchronous printing to make "print backgrounds" preference work when toggled from a print dialog checkbox.
1967 process()->send(Messages::WebPage::PreferencesDidChange(pageGroup()->preferences()->store()), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
1970 void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
1972 if (messageID.is<CoreIPC::MessageClassDrawingAreaProxy>()) {
1973 m_drawingArea->didReceiveDrawingAreaProxyMessage(connection, messageID, arguments);
1977 #if USE(UI_SIDE_COMPOSITING)
1978 if (messageID.is<CoreIPC::MessageClassLayerTreeCoordinatorProxy>()) {
1979 m_drawingArea->didReceiveLayerTreeCoordinatorProxyMessage(connection, messageID, arguments);
1984 #if ENABLE(INSPECTOR)
1985 if (messageID.is<CoreIPC::MessageClassWebInspectorProxy>()) {
1986 if (WebInspectorProxy* inspector = this->inspector())
1987 inspector->didReceiveWebInspectorProxyMessage(connection, messageID, arguments);
1992 #if ENABLE(FULLSCREEN_API)
1993 if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) {
1994 fullScreenManager()->didReceiveMessage(connection, messageID, arguments);
1999 didReceiveWebPageProxyMessage(connection, messageID, arguments);
2002 void WebPageProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
2004 #if ENABLE(INSPECTOR)
2005 if (messageID.is<CoreIPC::MessageClassWebInspectorProxy>()) {
2006 if (WebInspectorProxy* inspector = this->inspector())
2007 inspector->didReceiveSyncWebInspectorProxyMessage(connection, messageID, arguments, reply);
2012 #if ENABLE(FULLSCREEN_API)
2013 if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) {
2014 fullScreenManager()->didReceiveSyncMessage(connection, messageID, arguments, reply);
2019 // FIXME: Do something with reply.
2020 didReceiveSyncWebPageProxyMessage(connection, messageID, arguments, reply);
2023 void WebPageProxy::didCreateMainFrame(uint64_t frameID)
2025 MESSAGE_CHECK(!m_mainFrame);
2026 MESSAGE_CHECK(process()->canCreateFrame(frameID));
2028 m_mainFrame = WebFrameProxy::create(this, frameID);
2030 // Add the frame to the process wide map.
2031 process()->frameCreated(frameID, m_mainFrame.get());
2034 void WebPageProxy::didCreateSubframe(uint64_t frameID, uint64_t parentFrameID)
2036 MESSAGE_CHECK(m_mainFrame);
2038 WebFrameProxy* parentFrame = process()->webFrame(parentFrameID);
2039 MESSAGE_CHECK(parentFrame);
2040 MESSAGE_CHECK(parentFrame->isDescendantOf(m_mainFrame.get()));
2042 MESSAGE_CHECK(process()->canCreateFrame(frameID));
2044 RefPtr<WebFrameProxy> subFrame = WebFrameProxy::create(this, frameID);
2046 // Add the frame to the process wide map.
2047 process()->frameCreated(frameID, subFrame.get());
2049 // Insert the frame into the frame hierarchy.
2050 parentFrame->appendChild(subFrame.get());
2053 static bool isDisconnectedFrame(WebFrameProxy* frame)
2055 return !frame->page() || !frame->page()->mainFrame() || !frame->isDescendantOf(frame->page()->mainFrame());
2058 void WebPageProxy::didSaveFrameToPageCache(uint64_t frameID)
2060 MESSAGE_CHECK(m_mainFrame);
2062 WebFrameProxy* subframe = process()->webFrame(frameID);
2063 MESSAGE_CHECK(subframe);
2065 if (isDisconnectedFrame(subframe))
2068 MESSAGE_CHECK(subframe->isDescendantOf(m_mainFrame.get()));
2070 subframe->didRemoveFromHierarchy();
2073 void WebPageProxy::didRestoreFrameFromPageCache(uint64_t frameID, uint64_t parentFrameID)
2075 MESSAGE_CHECK(m_mainFrame);
2077 WebFrameProxy* subframe = process()->webFrame(frameID);
2078 MESSAGE_CHECK(subframe);
2079 MESSAGE_CHECK(!subframe->parentFrame());
2080 MESSAGE_CHECK(subframe->page() == m_mainFrame->page());
2082 WebFrameProxy* parentFrame = process()->webFrame(parentFrameID);
2083 MESSAGE_CHECK(parentFrame);
2084 MESSAGE_CHECK(parentFrame->isDescendantOf(m_mainFrame.get()));
2086 // Insert the frame into the frame hierarchy.
2087 parentFrame->appendChild(subframe);
2091 // Always start progress at initialProgressValue. This helps provide feedback as
2092 // soon as a load starts.
2094 static const double initialProgressValue = 0.1;
2096 double WebPageProxy::estimatedProgress() const
2098 if (!pendingAPIRequestURL().isNull())
2099 return initialProgressValue;
2100 return m_estimatedProgress;
2103 void WebPageProxy::didStartProgress()
2105 m_estimatedProgress = initialProgressValue;
2107 m_loaderClient.didStartProgress(this);
2110 void WebPageProxy::didChangeProgress(double value)
2112 m_estimatedProgress = value;
2114 m_loaderClient.didChangeProgress(this);
2117 void WebPageProxy::didFinishProgress()
2119 m_estimatedProgress = 1.0;
2121 m_loaderClient.didFinishProgress(this);
2124 #if ENABLE(WEB_INTENTS_TAG)
2125 void WebPageProxy::registerIntentServiceForFrame(uint64_t frameID, const IntentServiceInfo& serviceInfo, CoreIPC::ArgumentDecoder* arguments)
2127 RefPtr<APIObject> userData;
2128 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2129 if (!arguments->decode(messageDecoder))
2132 WebFrameProxy* frame = process()->webFrame(frameID);
2133 MESSAGE_CHECK(frame);
2135 RefPtr<WebIntentServiceInfo> webIntentServiceInfo = WebIntentServiceInfo::create(serviceInfo);
2136 m_loaderClient.registerIntentServiceForFrame(this, frame, webIntentServiceInfo.get(), userData.get());
2140 void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::ArgumentDecoder* arguments)
2142 clearPendingAPIRequestURL();
2144 RefPtr<APIObject> userData;
2145 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2146 if (!arguments->decode(messageDecoder))
2149 WebFrameProxy* frame = process()->webFrame(frameID);
2150 MESSAGE_CHECK(frame);
2151 MESSAGE_CHECK_URL(url);
2153 frame->setUnreachableURL(unreachableURL);
2155 frame->didStartProvisionalLoad(url);
2156 m_loaderClient.didStartProvisionalLoadForFrame(this, frame, userData.get());
2159 void WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, const String& url, CoreIPC::ArgumentDecoder* arguments)
2161 RefPtr<APIObject> userData;
2162 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2163 if (!arguments->decode(messageDecoder))
2166 WebFrameProxy* frame = process()->webFrame(frameID);
2167 MESSAGE_CHECK(frame);
2168 MESSAGE_CHECK_URL(url);
2170 frame->didReceiveServerRedirectForProvisionalLoad(url);
2172 m_loaderClient.didReceiveServerRedirectForProvisionalLoadForFrame(this, frame, userData.get());
2175 void WebPageProxy::didFailProvisionalLoadForFrame(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
2177 RefPtr<APIObject> userData;
2178 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2179 if (!arguments->decode(messageDecoder))
2182 WebFrameProxy* frame = process()->webFrame(frameID);
2183 MESSAGE_CHECK(frame);
2185 frame->didFailProvisionalLoad();
2187 m_loaderClient.didFailProvisionalLoadWithErrorForFrame(this, frame, error, userData.get());
2190 void WebPageProxy::clearLoadDependentCallbacks()
2192 Vector<uint64_t> callbackIDsCopy;
2193 copyToVector(m_loadDependentStringCallbackIDs, callbackIDsCopy);
2194 m_loadDependentStringCallbackIDs.clear();
2196 for (size_t i = 0; i < callbackIDsCopy.size(); ++i) {
2197 RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackIDsCopy[i]);
2199 callback->invalidate();
2203 void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, const PlatformCertificateInfo& certificateInfo, CoreIPC::ArgumentDecoder* arguments)
2205 RefPtr<APIObject> userData;
2206 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2207 if (!arguments->decode(messageDecoder))
2210 WebFrameProxy* frame = process()->webFrame(frameID);
2211 MESSAGE_CHECK(frame);
2214 // FIXME (bug 59111): didCommitLoadForFrame comes too late when restoring a page from b/f cache, making us disable secure event mode in password fields.
2215 // FIXME (bug 59121): A load going on in one frame shouldn't affect typing in sibling frames.
2216 m_pageClient->resetTextInputState();
2217 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
2218 // FIXME: Should this be moved inside resetTextInputState()?
2219 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
2220 m_pageClient->dismissDictionaryLookupPanel();
2224 clearLoadDependentCallbacks();
2226 frame->didCommitLoad(mimeType, certificateInfo);
2228 if (frame->isMainFrame()) {
2229 m_mainFrameHasCustomRepresentation = frameHasCustomRepresentation;
2231 if (m_mainFrameHasCustomRepresentation) {
2232 // Always assume that the main frame is pinned here, since the custom representation view will handle
2233 // any wheel events and dispatch them to the WKView when necessary.
2234 m_mainFrameIsPinnedToLeftSide = true;
2235 m_mainFrameIsPinnedToRightSide = true;
2237 m_pageClient->didCommitLoadForMainFrame(frameHasCustomRepresentation);
2240 m_loaderClient.didCommitLoadForFrame(this, frame, userData.get());
2243 void WebPageProxy::didFinishDocumentLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2245 RefPtr<APIObject> userData;
2246 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2247 if (!arguments->decode(messageDecoder))
2250 WebFrameProxy* frame = process()->webFrame(frameID);
2251 MESSAGE_CHECK(frame);
2253 m_loaderClient.didFinishDocumentLoadForFrame(this, frame, userData.get());
2256 #if ENABLE(TIZEN_NATIVE_MEMORY_SNAPSHOT)
2257 const char* isMemorySnapshot = getenv("TIZEN_MEMORY_SNAPSHOT");
2259 void WebPageProxy::didFinishLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2261 RefPtr<APIObject> userData;
2262 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2263 if (!arguments->decode(messageDecoder))
2266 WebFrameProxy* frame = process()->webFrame(frameID);
2267 MESSAGE_CHECK(frame);
2269 frame->didFinishLoad();
2271 m_loaderClient.didFinishLoadForFrame(this, frame, userData.get());
2272 #if ENABLE(TIZEN_NATIVE_MEMORY_SNAPSHOT)
2273 if (isMemorySnapshot && isMemorySnapshot[0] != '0')
2274 dumpMemorySnapshot();
2278 void WebPageProxy::didFailLoadForFrame(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
2280 RefPtr<APIObject> userData;
2281 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2282 if (!arguments->decode(messageDecoder))
2285 WebFrameProxy* frame = process()->webFrame(frameID);
2286 MESSAGE_CHECK(frame);
2288 clearLoadDependentCallbacks();
2290 frame->didFailLoad();
2292 m_loaderClient.didFailLoadWithErrorForFrame(this, frame, error, userData.get());
2295 void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t opaqueSameDocumentNavigationType, const String& url, CoreIPC::ArgumentDecoder* arguments)
2297 RefPtr<APIObject> userData;
2298 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2299 if (!arguments->decode(messageDecoder))
2302 WebFrameProxy* frame = process()->webFrame(frameID);
2303 MESSAGE_CHECK(frame);
2304 MESSAGE_CHECK_URL(url);
2306 clearPendingAPIRequestURL();
2307 frame->didSameDocumentNavigation(url);
2309 m_loaderClient.didSameDocumentNavigationForFrame(this, frame, static_cast<SameDocumentNavigationType>(opaqueSameDocumentNavigationType), userData.get());
2312 void WebPageProxy::didReceiveTitleForFrame(uint64_t frameID, const String& title, CoreIPC::ArgumentDecoder* arguments)
2314 RefPtr<APIObject> userData;
2315 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2316 if (!arguments->decode(messageDecoder))
2319 WebFrameProxy* frame = process()->webFrame(frameID);
2320 MESSAGE_CHECK(frame);
2322 frame->didChangeTitle(title);
2324 m_loaderClient.didReceiveTitleForFrame(this, title, frame, userData.get());
2327 void WebPageProxy::didFirstLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2329 RefPtr<APIObject> userData;
2330 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2331 if (!arguments->decode(messageDecoder))
2334 WebFrameProxy* frame = process()->webFrame(frameID);
2335 MESSAGE_CHECK(frame);
2337 m_loaderClient.didFirstLayoutForFrame(this, frame, userData.get());
2340 void WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2342 RefPtr<APIObject> userData;
2343 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2344 if (!arguments->decode(messageDecoder))
2347 WebFrameProxy* frame = process()->webFrame(frameID);
2348 MESSAGE_CHECK(frame);
2351 if (frame->isMainFrame())
2352 m_pageClient->didFirstVisuallyNonEmptyLayoutForMainFrame();
2355 m_loaderClient.didFirstVisuallyNonEmptyLayoutForFrame(this, frame, userData.get());
2358 void WebPageProxy::didNewFirstVisuallyNonEmptyLayout(CoreIPC::ArgumentDecoder* arguments)
2360 RefPtr<APIObject> userData;
2361 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2362 if (!arguments->decode(messageDecoder))
2365 m_loaderClient.didNewFirstVisuallyNonEmptyLayout(this, userData.get());
2368 void WebPageProxy::didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2370 RefPtr<APIObject> userData;
2371 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2372 if (!arguments->decode(messageDecoder))
2375 WebFrameProxy* frame = process()->webFrame(frameID);
2376 MESSAGE_CHECK(frame);
2378 frame->didRemoveFromHierarchy();
2380 m_loaderClient.didRemoveFrameFromHierarchy(this, frame, userData.get());
2383 void WebPageProxy::didDisplayInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2385 RefPtr<APIObject> userData;
2386 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2387 if (!arguments->decode(messageDecoder))
2390 WebFrameProxy* frame = process()->webFrame(frameID);
2391 MESSAGE_CHECK(frame);
2393 m_loaderClient.didDisplayInsecureContentForFrame(this, frame, userData.get());
2396 void WebPageProxy::didRunInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2398 RefPtr<APIObject> userData;
2399 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2400 if (!arguments->decode(messageDecoder))
2403 WebFrameProxy* frame = process()->webFrame(frameID);
2404 MESSAGE_CHECK(frame);
2406 m_loaderClient.didRunInsecureContentForFrame(this, frame, userData.get());
2409 void WebPageProxy::didDetectXSSForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2411 RefPtr<APIObject> userData;
2412 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2413 if (!arguments->decode(messageDecoder))
2416 WebFrameProxy* frame = process()->webFrame(frameID);
2417 MESSAGE_CHECK(frame);
2419 m_loaderClient.didDetectXSSForFrame(this, frame, userData.get());
2422 #if ENABLE(WEB_INTENTS)
2423 void WebPageProxy::didReceiveIntentForFrame(uint64_t frameID, const IntentData& intentData, CoreIPC::ArgumentDecoder* arguments)
2425 RefPtr<APIObject> userData;
2426 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2427 if (!arguments->decode(messageDecoder))
2430 WebFrameProxy* frame = process()->webFrame(frameID);
2431 MESSAGE_CHECK(frame);
2433 RefPtr<WebIntentData> webIntentData = WebIntentData::create(intentData);
2434 m_loaderClient.didReceiveIntentForFrame(this, frame, webIntentData.get(), userData.get());
2438 void WebPageProxy::frameDidBecomeFrameSet(uint64_t frameID, bool value)
2440 WebFrameProxy* frame = process()->webFrame(frameID);
2441 MESSAGE_CHECK(frame);
2443 frame->setIsFrameSet(value);
2444 if (frame->isMainFrame())
2445 m_frameSetLargestFrame = value ? m_mainFrame : 0;
2449 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)
2451 RefPtr<APIObject> userData;
2452 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2453 if (!arguments->decode(messageDecoder))
2456 if (request.url() != pendingAPIRequestURL())
2457 clearPendingAPIRequestURL();
2459 WebFrameProxy* frame = process()->webFrame(frameID);
2460 MESSAGE_CHECK(frame);
2461 MESSAGE_CHECK_URL(request.url());
2463 NavigationType navigationType = static_cast<NavigationType>(opaqueNavigationType);
2464 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
2465 WebMouseEvent::Button mouseButton = static_cast<WebMouseEvent::Button>(opaqueMouseButton);
2467 RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
2469 ASSERT(!m_inDecidePolicyForNavigationAction);
2471 m_inDecidePolicyForNavigationAction = true;
2472 m_syncNavigationActionPolicyActionIsValid = false;
2474 if (!m_policyClient.decidePolicyForNavigationAction(this, frame, navigationType, modifiers, mouseButton, request, listener.get(), userData.get()))
2477 m_inDecidePolicyForNavigationAction = false;
2479 // Check if we received a policy decision already. If we did, we can just pass it back.
2480 receivedPolicyAction = m_syncNavigationActionPolicyActionIsValid;
2481 if (m_syncNavigationActionPolicyActionIsValid) {
2482 policyAction = m_syncNavigationActionPolicyAction;
2483 downloadID = m_syncNavigationActionPolicyDownloadID;
2487 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)
2489 RefPtr<APIObject> userData;
2490 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2491 if (!arguments->decode(messageDecoder))
2494 WebFrameProxy* frame = process()->webFrame(frameID);
2495 MESSAGE_CHECK(frame);
2496 MESSAGE_CHECK_URL(request.url());
2498 NavigationType navigationType = static_cast<NavigationType>(opaqueNavigationType);
2499 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
2500 WebMouseEvent::Button mouseButton = static_cast<WebMouseEvent::Button>(opaqueMouseButton);
2502 RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
2503 if (!m_policyClient.decidePolicyForNewWindowAction(this, frame, navigationType, modifiers, mouseButton, request, frameName, listener.get(), userData.get()))
2507 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)
2509 RefPtr<APIObject> userData;
2510 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2511 if (!arguments->decode(messageDecoder))
2514 WebFrameProxy* frame = process()->webFrame(frameID);
2515 MESSAGE_CHECK(frame);
2516 MESSAGE_CHECK_URL(request.url());
2517 MESSAGE_CHECK_URL(response.url());
2519 RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
2521 ASSERT(!m_inDecidePolicyForResponse);
2523 m_inDecidePolicyForResponse = true;
2524 m_syncMimeTypePolicyActionIsValid = false;
2526 if (!m_policyClient.decidePolicyForResponse(this, frame, response, request, listener.get(), userData.get()))
2529 m_inDecidePolicyForResponse = false;
2531 // Check if we received a policy decision already. If we did, we can just pass it back.
2532 receivedPolicyAction = m_syncMimeTypePolicyActionIsValid;
2533 if (m_syncMimeTypePolicyActionIsValid) {
2534 policyAction = m_syncMimeTypePolicyAction;
2535 downloadID = m_syncMimeTypePolicyDownloadID;
2539 void WebPageProxy::unableToImplementPolicy(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
2541 RefPtr<APIObject> userData;
2542 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2543 if (!arguments->decode(messageDecoder))
2546 WebFrameProxy* frame = process()->webFrame(frameID);
2547 MESSAGE_CHECK(frame);
2549 m_policyClient.unableToImplementPolicy(this, frame, error, userData.get());
2554 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
2555 void WebPageProxy::willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const StringPairVector& textFieldValues, bool containsPasswordData, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments)
2557 void WebPageProxy::willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const StringPairVector& textFieldValues, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments)
2560 RefPtr<APIObject> userData;
2561 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2562 if (!arguments->decode(messageDecoder))
2565 WebFrameProxy* frame = process()->webFrame(frameID);
2566 MESSAGE_CHECK(frame);
2568 WebFrameProxy* sourceFrame = process()->webFrame(sourceFrameID);
2569 MESSAGE_CHECK(sourceFrame);
2571 RefPtr<WebFormSubmissionListenerProxy> listener = frame->setUpFormSubmissionListenerProxy(listenerID);
2572 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
2573 if (!m_formClient.willSubmitForm(this, frame, sourceFrame, textFieldValues.stringPairVector(), containsPasswordData, userData.get(), listener.get()))
2575 if (!m_formClient.willSubmitForm(this, frame, sourceFrame, textFieldValues.stringPairVector(), userData.get(), listener.get()))
2577 listener->continueSubmission();
2580 // ResourceLoad Client
2582 void WebPageProxy::didInitiateLoadForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceRequest& request, bool pageIsProvisionallyLoading)
2584 WebFrameProxy* frame = process()->webFrame(frameID);
2585 MESSAGE_CHECK(frame);
2586 MESSAGE_CHECK_URL(request.url());
2588 m_resourceLoadClient.didInitiateLoadForResource(this, frame, resourceIdentifier, request, pageIsProvisionallyLoading);
2591 void WebPageProxy::didSendRequestForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceRequest& request, const ResourceResponse& redirectResponse)
2593 WebFrameProxy* frame = process()->webFrame(frameID);
2594 MESSAGE_CHECK(frame);
2595 MESSAGE_CHECK_URL(request.url());
2597 m_resourceLoadClient.didSendRequestForResource(this, frame, resourceIdentifier, request, redirectResponse);
2600 void WebPageProxy::didReceiveResponseForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceResponse& response)
2602 WebFrameProxy* frame = process()->webFrame(frameID);
2603 MESSAGE_CHECK(frame);
2604 MESSAGE_CHECK_URL(response.url());
2606 m_resourceLoadClient.didReceiveResponseForResource(this, frame, resourceIdentifier, response);
2609 void WebPageProxy::didReceiveContentLengthForResource(uint64_t frameID, uint64_t resourceIdentifier, uint64_t contentLength)
2611 WebFrameProxy* frame = process()->webFrame(frameID);
2612 MESSAGE_CHECK(frame);
2614 m_resourceLoadClient.didReceiveContentLengthForResource(this, frame, resourceIdentifier, contentLength);
2617 void WebPageProxy::didFinishLoadForResource(uint64_t frameID, uint64_t resourceIdentifier)
2619 WebFrameProxy* frame = process()->webFrame(frameID);
2620 MESSAGE_CHECK(frame);
2622 m_resourceLoadClient.didFinishLoadForResource(this, frame, resourceIdentifier);
2625 void WebPageProxy::didFailLoadForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceError& error)
2627 WebFrameProxy* frame = process()->webFrame(frameID);
2628 MESSAGE_CHECK(frame);
2630 m_resourceLoadClient.didFailLoadForResource(this, frame, resourceIdentifier, error);
2635 void WebPageProxy::createNewPage(const ResourceRequest& request, const WindowFeatures& windowFeatures, uint32_t opaqueModifiers, int32_t opaqueMouseButton, uint64_t& newPageID, WebPageCreationParameters& newPageParameters)
2637 RefPtr<WebPageProxy> newPage = m_uiClient.createNewPage(this, request, windowFeatures, static_cast<WebEvent::Modifiers>(opaqueModifiers), static_cast<WebMouseEvent::Button>(opaqueMouseButton));
2639 newPageID = newPage->pageID();
2640 newPageParameters = newPage->creationParameters();
2645 void WebPageProxy::showPage()
2647 m_uiClient.showPage(this);
2650 void WebPageProxy::closePage(bool stopResponsivenessTimer)
2652 if (stopResponsivenessTimer)
2653 process()->responsivenessTimer()->stop();
2655 m_pageClient->clearAllEditCommands();
2656 m_uiClient.close(this);
2659 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2660 bool WebPageProxy::isWaitingForJavaScriptPopupReply()
2662 #if ENABLE(TIZEN_SUPPORT_BEFORE_UNLOAD_CONFIRM_PANEL)
2663 return m_alertReply || m_confirmReply || m_promptReply || m_beforeUnloadConfirmPanelReply;
2665 return m_alertReply || m_confirmReply || m_promptReply;
2671 void WebPageProxy::runJavaScriptAlert(uint64_t frameID, const String& message, PassRefPtr<Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply> reply)
2673 WebFrameProxy* frame = process()->webFrame(frameID);
2674 MESSAGE_CHECK(frame);
2676 // Since runJavaScriptAlert() can spin a nested run loop we need to turn off the responsiveness timer.
2677 process()->responsivenessTimer()->stop();
2679 m_alertReply = reply;
2680 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
2681 m_uiClient.notifyPopupReplyWaitingState(this, true);
2683 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2684 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2686 if (!m_uiClient.runJavaScriptAlert(this, message, frame))
2687 replyJavaScriptAlert();
2690 void WebPageProxy::runJavaScriptConfirm(uint64_t frameID, const String& message, PassRefPtr<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply> reply)
2692 WebFrameProxy* frame = process()->webFrame(frameID);
2693 MESSAGE_CHECK(frame);
2695 // Since runJavaScriptConfirm() can spin a nested run loop we need to turn off the responsiveness timer.
2696 process()->responsivenessTimer()->stop();
2698 m_confirmReply = reply;
2699 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
2700 m_uiClient.notifyPopupReplyWaitingState(this, true);
2702 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2703 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2705 if (!m_uiClient.runJavaScriptConfirm(this, message, frame))
2706 replyJavaScriptConfirm(false);
2709 void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const String& message, const String& defaultValue, PassRefPtr<Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply> reply)
2711 WebFrameProxy* frame = process()->webFrame(frameID);
2712 MESSAGE_CHECK(frame);
2714 // Since runJavaScriptPrompt() can spin a nested run loop we need to turn off the responsiveness timer.
2715 process()->responsivenessTimer()->stop();
2717 m_promptReply = reply;
2718 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
2719 m_uiClient.notifyPopupReplyWaitingState(this, true);
2721 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2722 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2724 if (!m_uiClient.runJavaScriptPrompt(this, message, defaultValue, frame))
2725 replyJavaScriptPrompt(String());
2728 void WebPageProxy::runJavaScriptAlert(uint64_t frameID, const String& message)
2730 WebFrameProxy* frame = process()->webFrame(frameID);
2731 MESSAGE_CHECK(frame);
2733 // Since runJavaScriptAlert() can spin a nested run loop we need to turn off the responsiveness timer.
2734 process()->responsivenessTimer()->stop();
2736 m_uiClient.runJavaScriptAlert(this, message, frame);
2739 void WebPageProxy::runJavaScriptConfirm(uint64_t frameID, const String& message, bool& result)
2741 WebFrameProxy* frame = process()->webFrame(frameID);
2742 MESSAGE_CHECK(frame);
2744 // Since runJavaScriptConfirm() can spin a nested run loop we need to turn off the responsiveness timer.
2745 process()->responsivenessTimer()->stop();
2747 result = m_uiClient.runJavaScriptConfirm(this, message, frame);
2750 void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const String& message, const String& defaultValue, String& result)
2752 WebFrameProxy* frame = process()->webFrame(frameID);
2753 MESSAGE_CHECK(frame);
2755 // Since runJavaScriptPrompt() can spin a nested run loop we need to turn off the responsiveness timer.
2756 process()->responsivenessTimer()->stop();
2758 result = m_uiClient.runJavaScriptPrompt(this, message, defaultValue, frame);
2762 void WebPageProxy::shouldInterruptJavaScript(bool& result)
2764 // Since shouldInterruptJavaScript() can spin a nested run loop we need to turn off the responsiveness timer.
2765 process()->responsivenessTimer()->stop();
2767 result = m_uiClient.shouldInterruptJavaScript(this);
2770 void WebPageProxy::setStatusText(const String& text)
2772 m_uiClient.setStatusText(this, text);
2775 void WebPageProxy::mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t opaqueModifiers, CoreIPC::ArgumentDecoder* arguments)
2777 RefPtr<APIObject> userData;
2778 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2779 if (!arguments->decode(messageDecoder))
2782 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
2784 m_uiClient.mouseDidMoveOverElement(this, hitTestResultData, modifiers, userData.get());
2787 void WebPageProxy::unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& url, const String& pluginsPageURL)
2789 MESSAGE_CHECK_URL(url);
2790 MESSAGE_CHECK_URL(pluginsPageURL);
2792 WKPluginUnavailabilityReason pluginUnavailabilityReason = static_cast<WKPluginUnavailabilityReason>(opaquePluginUnavailabilityReason);
2793 m_uiClient.unavailablePluginButtonClicked(this, pluginUnavailabilityReason, mimeType, url, pluginsPageURL);
2796 void WebPageProxy::setToolbarsAreVisible(bool toolbarsAreVisible)
2798 m_uiClient.setToolbarsAreVisible(this, toolbarsAreVisible);
2801 void WebPageProxy::getToolbarsAreVisible(bool& toolbarsAreVisible)
2803 toolbarsAreVisible = m_uiClient.toolbarsAreVisible(this);
2806 void WebPageProxy::setMenuBarIsVisible(bool menuBarIsVisible)
2808 m_uiClient.setMenuBarIsVisible(this, menuBarIsVisible);
2811 void WebPageProxy::getMenuBarIsVisible(bool& menuBarIsVisible)
2813 menuBarIsVisible = m_uiClient.menuBarIsVisible(this);
2816 void WebPageProxy::setStatusBarIsVisible(bool statusBarIsVisible)
2818 m_uiClient.setStatusBarIsVisible(this, statusBarIsVisible);
2821 void WebPageProxy::getStatusBarIsVisible(bool& statusBarIsVisible)
2823 statusBarIsVisible = m_uiClient.statusBarIsVisible(this);
2826 void WebPageProxy::setIsResizable(bool isResizable)
2828 m_uiClient.setIsResizable(this, isResizable);
2831 void WebPageProxy::getIsResizable(bool& isResizable)
2833 isResizable = m_uiClient.isResizable(this);
2836 void WebPageProxy::setWindowFrame(const FloatRect& newWindowFrame)
2838 m_uiClient.setWindowFrame(this, m_pageClient->convertToDeviceSpace(newWindowFrame));
2841 void WebPageProxy::getWindowFrame(FloatRect& newWindowFrame)
2843 newWindowFrame = m_pageClient->convertToUserSpace(m_uiClient.windowFrame(this));
2846 void WebPageProxy::screenToWindow(const IntPoint& screenPoint, IntPoint& windowPoint)
2848 windowPoint = m_pageClient->screenToWindow(screenPoint);
2851 void WebPageProxy::windowToScreen(const IntRect& viewRect, IntRect& result)
2853 result = m_pageClient->windowToScreen(viewRect);
2856 #if ENABLE(TIZEN_SUPPORT_BEFORE_UNLOAD_CONFIRM_PANEL)
2857 void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, PassRefPtr<Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply> reply)
2859 WebFrameProxy* frame = process()->webFrame(frameID);
2860 MESSAGE_CHECK(frame);
2862 // Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer.
2863 process()->responsivenessTimer()->stop();
2865 m_beforeUnloadConfirmPanelReply = reply;
2866 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2867 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2869 if (!m_uiClient.runBeforeUnloadConfirmPanel(this, message, frame))
2870 replyBeforeUnloadConfirmPanel(false);
2873 void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose)
2875 WebFrameProxy* frame = process()->webFrame(frameID);
2876 MESSAGE_CHECK(frame);
2878 // Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer.
2879 process()->responsivenessTimer()->stop();
2881 shouldClose = m_uiClient.runBeforeUnloadConfirmPanel(this, message, frame);
2885 #if USE(TILED_BACKING_STORE)
2886 void WebPageProxy::pageDidRequestScroll(const IntPoint& point)
2888 m_pageClient->pageDidRequestScroll(point);
2892 void WebPageProxy::didChangeViewportProperties(const ViewportAttributes& attr)
2894 m_pageClient->didChangeViewportProperties(attr);
2897 void WebPageProxy::pageDidScroll()
2899 m_uiClient.pageDidScroll(this);
2900 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
2901 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
2905 void WebPageProxy::runOpenPanel(uint64_t frameID, const FileChooserSettings& settings)
2907 if (m_openPanelResultListener) {
2908 m_openPanelResultListener->invalidate();
2909 m_openPanelResultListener = 0;
2912 WebFrameProxy* frame = process()->webFrame(frameID);
2913 MESSAGE_CHECK(frame);
2915 RefPtr<WebOpenPanelParameters> parameters = WebOpenPanelParameters::create(settings);
2916 m_openPanelResultListener = WebOpenPanelResultListenerProxy::create(this);
2918 // Since runOpenPanel() can spin a nested run loop we need to turn off the responsiveness timer.
2919 process()->responsivenessTimer()->stop();
2921 if (!m_uiClient.runOpenPanel(this, frame, parameters.get(), m_openPanelResultListener.get()))
2922 didCancelForOpenPanel();
2925 void WebPageProxy::printFrame(uint64_t frameID)
2927 ASSERT(!m_isPerformingDOMPrintOperation);
2928 m_isPerformingDOMPrintOperation = true;
2930 WebFrameProxy* frame = process()->webFrame(frameID);
2931 MESSAGE_CHECK(frame);
2933 m_uiClient.printFrame(this, frame);
2935 endPrinting(); // Send a message synchronously while m_isPerformingDOMPrintOperation is still true.
2936 m_isPerformingDOMPrintOperation = false;
2939 void WebPageProxy::printMainFrame()
2941 printFrame(m_mainFrame->frameID());
2944 #if ENABLE(TIZEN_REGISTER_PROTOCOL_HANDLER)
2945 void WebPageProxy::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title)
2947 m_pageClient->registerProtocolHandler(scheme, baseURL, url, title);
2951 #if ENABLE(TIZEN_CUSTOM_SCHEME_HANDLER)
2952 void WebPageProxy::isProtocolHandlerRegistered(const String& scheme, const String& baseURL, const String& url, unsigned int& result)
2954 result = m_pageClient->isProtocolHandlerRegistered(scheme, baseURL, url);
2956 void WebPageProxy::unregisterProtocolHandler(const String& scheme, const String& baseURL, const String& url)
2958 m_pageClient->unregisterProtocolHandler(scheme, baseURL, url);
2962 #if ENABLE(TIZEN_REGISTER_CONTENT_HANDLER)
2963 void WebPageProxy::registerContentHandler(const String& mimeType, const String& baseURL, const String& url, const String& title)
2965 m_pageClient->registerContentHandler(mimeType, baseURL, url, title);
2968 void WebPageProxy::isContentHandlerRegistered(const String& mimeType, const String& baseURL, const String& url, unsigned int& result)
2970 result = m_pageClient->isContentHandlerRegistered(mimeType, baseURL, url);
2973 void WebPageProxy::unregisterContentHandler(const String& mimeType, const String& baseURL, const String& url)
2975 m_pageClient->unregisterContentHandler(mimeType, baseURL, url);
2979 #if ENABLE(TIZEN_SEARCH_PROVIDER)
2980 void WebPageProxy::addSearchProvider(const String& baseURL, const String& engineURL)
2982 m_pageClient->addSearchProvider(baseURL, engineURL);
2985 void WebPageProxy::isSearchProviderInstalled(const String& baseURL, const String& engineURL, uint64_t& result)
2987 result = m_pageClient->isSearchProviderInstalled(baseURL, engineURL);
2991 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
2992 void WebPageProxy::getStandaloneStatus(bool& standalone)
2994 standalone = m_pageClient->getStandaloneStatus();
2997 void WebPageProxy::getWebAppCapable(PassRefPtr<BooleanCallback> prpCallback)
2999 RefPtr<BooleanCallback> callback = prpCallback;
3001 callback->invalidate();
3005 uint64_t callbackID = callback->callbackID();
3006 m_booleanCallbacks.set(callbackID, callback.get());
3007 process()->send(Messages::WebPage::GetWebAppCapable(callbackID), m_pageID);
3010 void WebPageProxy::didGetWebAppCapable(const bool capable, uint64_t callbackID)
3012 RefPtr<BooleanCallback> callback = m_booleanCallbacks.take(callbackID);
3013 m_booleanCallbacks.remove(callbackID);
3014 callback->performCallbackWithReturnValue(WebBoolean::create(capable).leakRef());
3017 void WebPageProxy::getWebAppIconURL(PassRefPtr<StringCallback> prpCallback)
3019 RefPtr<StringCallback> callback = prpCallback;
3021 callback->invalidate();
3025 uint64_t callbackID = callback->callbackID();
3026 m_stringCallbacks.set(callbackID, callback.get());
3027 process()->send(Messages::WebPage::GetWebAppIconURL(callbackID), m_pageID);
3030 void WebPageProxy::didGetWebAppIconURL(const String& iconURL, uint64_t callbackID)
3032 RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackID);
3034 // FIXME: Log error or assert.
3035 // this can validly happen if a load invalidated the callback, though
3039 m_stringCallbacks.remove(callbackID);
3040 callback->performCallbackWithReturnValue(iconURL.impl());
3043 void WebPageProxy::getWebAppIconURLs(PassRefPtr<DictionaryCallback> prpCallback)
3045 RefPtr<DictionaryCallback> callback = prpCallback;
3047 callback->invalidate();
3051 uint64_t callbackID = callback->callbackID();
3052 m_dictionaryCallbacks.set(callbackID, callback.get());
3053 process()->send(Messages::WebPage::GetWebAppIconURLs(callbackID), m_pageID);
3056 void WebPageProxy::didGetWebAppIconURLs(const StringPairVector& iconURLs, uint64_t callbackID)
3058 RefPtr<DictionaryCallback> callback = m_dictionaryCallbacks.take(callbackID);
3059 ImmutableDictionary::MapType iconURLList;
3060 size_t iconURLCount = iconURLs.stringPairVector().size();
3061 for (size_t i = 0; i < iconURLCount; ++i)
3062 iconURLList.set(iconURLs.stringPairVector()[i].first, WebString::create(iconURLs.stringPairVector()[i].second));
3064 callback->performCallbackWithReturnValue(ImmutableDictionary::adopt(iconURLList).get());
3068 void WebPageProxy::setMediaVolume(float volume)
3070 if (volume == m_mediaVolume)
3073 m_mediaVolume = volume;
3078 process()->send(Messages::WebPage::SetMediaVolume(volume), m_pageID);
3082 void WebPageProxy::didChangeContentsSize(const IntSize& size)
3084 m_pageClient->didChangeContentsSize(size);
3087 void WebPageProxy::didFindZoomableArea(const IntPoint& target, const IntRect& area)
3089 m_pageClient->didFindZoomableArea(target, area);
3092 void WebPageProxy::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
3097 process()->send(Messages::WebPage::FindZoomableAreaForPoint(point, area), m_pageID);
3100 void WebPageProxy::didReceiveMessageFromNavigatorQtObject(const String& contents)
3102 m_pageClient->didReceiveMessageFromNavigatorQtObject(contents);
3105 void WebPageProxy::authenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password)
3107 m_pageClient->handleAuthenticationRequiredRequest(hostname, realm, prefilledUsername, username, password);
3110 void WebPageProxy::proxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password)
3112 m_pageClient->handleProxyAuthenticationRequiredRequest(hostname, port, prefilledUsername, username, password);
3115 void WebPageProxy::certificateVerificationRequest(const String& hostname, bool& ignoreErrors)
3117 m_pageClient->handleCertificateVerificationRequest(hostname, ignoreErrors);
3119 #endif // PLATFORM(QT).
3122 void WebPageProxy::didFindZoomableArea(const IntPoint& target, const IntRect& area)
3124 m_pageClient->didFindZoomableArea(target, area);
3127 void WebPageProxy::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
3132 process()->send(Messages::WebPage::FindZoomableAreaForPoint(point, area), m_pageID);
3134 #endif // #if OS(TIZEN)
3136 #if PLATFORM(QT) || PLATFORM(EFL)
3137 void WebPageProxy::handleDownloadRequest(DownloadProxy* download)
3139 m_pageClient->handleDownloadRequest(download);
3141 #endif // PLATFORM(QT) || PLATFORM(EFL)
3143 #if ENABLE(TOUCH_EVENTS)
3144 void WebPageProxy::needTouchEvents(bool needTouchEvents)
3146 m_needTouchEvents = needTouchEvents;
3147 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
3148 // We don't have to ask overflow if we need touch events,
3149 // because we will check overflow in the web process when touch event is processed.
3150 m_askOverflow = !m_needTouchEvents;
3155 #if ENABLE(INPUT_TYPE_COLOR)
3156 void WebPageProxy::showColorChooser(const WebCore::Color& initialColor)
3158 ASSERT(!m_colorChooser);
3160 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3161 if (m_colorPickerResultListener) {
3162 m_colorPickerResultListener->invalidate();
3163 m_colorPickerResultListener = nullptr;
3166 m_colorPickerResultListener = WebColorPickerResultListenerProxy::create(this);
3167 m_colorChooser = WebColorChooserProxy::create(this);
3169 if (m_uiClient.showColorPicker(this, initialColor.serialized(), m_colorPickerResultListener.get()))
3173 m_colorChooser = m_pageClient->createColorChooserProxy(this, initialColor);
3174 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3175 if (!m_colorChooser)
3176 didEndColorChooser();
3180 void WebPageProxy::setColorChooserColor(const WebCore::Color& color)
3182 ASSERT(m_colorChooser);
3184 m_colorChooser->setSelectedColor(color);
3187 void WebPageProxy::endColorChooser()
3189 ASSERT(m_colorChooser);
3191 m_colorChooser->endChooser();
3194 void WebPageProxy::didChooseColor(const WebCore::Color& color)
3199 process()->send(Messages::WebPage::DidChooseColor(color), m_pageID);
3202 void WebPageProxy::didEndColorChooser()
3207 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3208 if (m_colorChooser) {
3209 m_colorChooser->invalidate();
3210 m_colorChooser = nullptr;
3213 ASSERT(m_colorChooser);
3215 m_colorChooser->invalidate();
3216 m_colorChooser = nullptr;
3219 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3220 m_process->send(Messages::WebPage::DidEndColorChooser(), m_pageID);
3222 m_colorPickerResultListener->invalidate();
3223 m_colorPickerResultListener = nullptr;
3225 m_uiClient.hideColorPicker(this);
3227 process()->send(Messages::WebPage::DidEndColorChooser(), m_pageID);
3232 void WebPageProxy::didDraw()
3234 m_uiClient.didDraw(this);
3239 #if ENABLE(INSPECTOR)
3241 WebInspectorProxy* WebPageProxy::inspector()
3243 if (isClosed() || !isValid())
3246 m_inspector = WebInspectorProxy::create(this);
3247 return m_inspector.get();
3252 #if ENABLE(FULLSCREEN_API)
3253 WebFullScreenManagerProxy* WebPageProxy::fullScreenManager()
3255 if (!m_fullScreenManager)
3256 m_fullScreenManager = WebFullScreenManagerProxy::create(this);
3257 return m_fullScreenManager.get();
3263 void WebPageProxy::backForwardAddItem(uint64_t itemID)
3265 m_backForwardList->addItem(process()->webBackForwardItem(itemID));
3268 void WebPageProxy::backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle& sandboxExtensionHandle)
3270 WebBackForwardListItem* item = process()->webBackForwardItem(itemID);
3274 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), item->url()), sandboxExtensionHandle);
3275 if (createdExtension)
3276 process()->willAcquireUniversalFileReadSandboxExtension();
3277 m_backForwardList->goToItem(item);
3280 void WebPageProxy::backForwardItemAtIndex(int32_t index, uint64_t& itemID)
3282 WebBackForwardListItem* item = m_backForwardList->itemAtIndex(index);
3283 itemID = item ? item->itemID() : 0;
3286 void WebPageProxy::backForwardBackListCount(int32_t& count)
3288 count = m_backForwardList->backListCount();
3291 void WebPageProxy::backForwardForwardListCount(int32_t& count)
3293 count = m_backForwardList->forwardListCount();
3296 void WebPageProxy::editorStateChanged(const EditorState& editorState)
3299 bool couldChangeSecureInputState = m_editorState.isInPasswordField != editorState.isInPasswordField || m_editorState.selectionIsNone;
3302 m_editorState = editorState;
3305 m_pageClient->updateTextInputState(couldChangeSecureInputState);
3306 #elif PLATFORM(QT) || PLATFORM(EFL)
3307 m_pageClient->updateTextInputState();
3313 void WebPageProxy::registerEditCommandForUndo(uint64_t commandID, uint32_t editAction)
3315 registerEditCommand(WebEditCommandProxy::create(commandID, static_cast<EditAction>(editAction), this), Undo);
3318 void WebPageProxy::canUndoRedo(uint32_t action, bool& result)
3320 result = m_pageClient->canUndoRedo(static_cast<UndoOrRedo>(action));
3323 void WebPageProxy::executeUndoRedo(uint32_t action, bool& result)
3325 m_pageClient->executeUndoRedo(static_cast<UndoOrRedo>(action));
3329 void WebPageProxy::clearAllEditCommands()
3331 m_pageClient->clearAllEditCommands();
3334 void WebPageProxy::didCountStringMatches(const String& string, uint32_t matchCount)
3336 m_findClient.didCountStringMatches(this, string, matchCount);
3339 void WebPageProxy::didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex)
3341 m_findMatchesClient.didGetImageForMatchResult(this, WebImage::create(ShareableBitmap::create(contentImageHandle)).get(), matchIndex);
3344 void WebPageProxy::setFindIndicator(const FloatRect& selectionRectInWindowCoordinates, const Vector<FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut, bool animate)
3346 RefPtr<FindIndicator> findIndicator = FindIndicator::create(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, contentImageScaleFactor, contentImageHandle);
3347 m_pageClient->setFindIndicator(findIndicator.release(), fadeOut, animate);
3350 void WebPageProxy::didFindString(const String& string, uint32_t matchCount)
3352 m_findClient.didFindString(this, string, matchCount);
3355 void WebPageProxy::didFindStringMatches(const String& string, Vector<Vector<WebCore::IntRect> > matchRects, int32_t firstIndexAfterSelection)
3357 Vector<RefPtr<APIObject> > matches;
3358 matches.reserveInitialCapacity(matchRects.size());
3360 for (size_t i = 0; i < matchRects.size(); ++i) {
3361 const Vector<WebCore::IntRect>& rects = matchRects[i];
3362 size_t numRects = matchRects[i].size();
3363 Vector<RefPtr<APIObject> > apiRects;
3364 apiRects.reserveInitialCapacity(numRects);
3366 for (size_t i = 0; i < numRects; ++i)
3367 apiRects.uncheckedAppend(WebRect::create(toAPI(rects[i])));
3368 matches.uncheckedAppend(ImmutableArray::adopt(apiRects));
3370 m_findMatchesClient.didFindStringMatches(this, string, ImmutableArray::adopt(matches).get(), firstIndexAfterSelection);
3373 void WebPageProxy::didFailToFindString(const String& string)
3375 m_findClient.didFailToFindString(this, string);
3378 void WebPageProxy::valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex)
3380 process()->send(Messages::WebPage::DidChangeSelectedIndexForActivePopupMenu(newSelectedIndex), m_pageID);
3383 void WebPageProxy::setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index)
3385 process()->send(Messages::WebPage::SetTextForActivePopupMenu(index), m_pageID);
3388 NativeWebMouseEvent* WebPageProxy::currentlyProcessedMouseDownEvent()
3390 return m_currentlyProcessedMouseDownEvent.get();
3394 void WebPageProxy::failedToShowPopupMenu()
3396 process()->send(Messages::WebPage::FailedToShowPopupMenu(), m_pageID);
3400 void WebPageProxy::showPopupMenu(const IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData& data)
3402 if (m_activePopupMenu) {
3403 m_activePopupMenu->hidePopupMenu();
3404 m_activePopupMenu->invalidate();
3405 m_activePopupMenu = 0;
3408 m_activePopupMenu = m_pageClient->createPopupMenuProxy(this);
3410 // Since showPopupMenu() can spin a nested run loop we need to turn off the responsiveness timer.
3411 process()->responsivenessTimer()->stop();
3413 RefPtr<WebPopupMenuProxy> protectedActivePopupMenu = m_activePopupMenu;
3415 protectedActivePopupMenu->showPopupMenu(rect, static_cast<TextDirection>(textDirection), m_pageScaleFactor, items, data, selectedIndex);
3417 // Since Qt and Efl doesn't use a nested mainloop to show the popup and get the answer, we need to keep the client pointer valid.
3418 #if !PLATFORM(QT) && !PLATFORM(EFL)
3419 protectedActivePopupMenu->invalidate();
3421 protectedActivePopupMenu = 0;
3424 void WebPageProxy::hidePopupMenu()
3426 if (!m_activePopupMenu)
3429 m_activePopupMenu->hidePopupMenu();
3430 m_activePopupMenu->invalidate();
3431 m_activePopupMenu = 0;
3434 #if ENABLE(TIZEN_WEBKIT2_POPUP_INTERNAL)
3435 void WebPageProxy::updatePopupMenu(uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex)
3437 if (!m_activePopupMenu)
3440 m_activePopupMenu->updatePopupMenu(static_cast<TextDirection>(textDirection), items, selectedIndex);
3444 #if ENABLE(CONTEXT_MENUS)
3445 void WebPageProxy::showContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::ArgumentDecoder* arguments)
3447 internalShowContextMenu(menuLocation, hitTestResultData, proposedItems, arguments);
3449 // No matter the result of internalShowContextMenu, always notify the WebProcess that the menu is hidden so it starts handling mouse events again.
3450 process()->send(Messages::WebPage::ContextMenuHidden(), m_pageID);
3453 void WebPageProxy::internalShowContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::ArgumentDecoder* arguments)
3455 RefPtr<APIObject> userData;
3456 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
3457 if (!arguments->decode(messageDecoder))
3460 m_activeContextMenuHitTestResultData = hitTestResultData;
3462 if (m_activeContextMenu) {
3463 m_activeContextMenu->hideContextMenu();
3464 m_activeContextMenu = 0;
3467 m_activeContextMenu = m_pageClient->createContextMenuProxy(this);
3469 // Since showContextMenu() can spin a nested run loop we need to turn off the responsiveness timer.
3470 process()->responsivenessTimer()->stop();
3472 // Give the PageContextMenuClient one last swipe at changing the menu.
3473 Vector<WebContextMenuItemData> items;
3474 if (!m_contextMenuClient.getContextMenuFromProposedMenu(this, proposedItems, items, hitTestResultData, userData.get()))
3475 m_activeContextMenu->showContextMenu(menuLocation, proposedItems);
3477 m_activeContextMenu->showContextMenu(menuLocation, items);
3479 m_contextMenuClient.contextMenuDismissed(this);
3482 void WebPageProxy::contextMenuItemSelected(const WebContextMenuItemData& item)
3484 TIZEN_LOGI("selected item : action(%d), title(%s)", item.action(), item.title().utf8().data());
3485 // Application custom items don't need to round-trip through to WebCore in the WebProcess.
3486 if (item.action() >= ContextMenuItemBaseApplicationTag) {
3487 m_contextMenuClient.customContextMenuItemSelected(this, item);
3488 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
3489 m_pageClient->setIsTextSelectionMode(false);
3495 if (item.action() == ContextMenuItemTagSmartCopyPaste) {
3496 setSmartInsertDeleteEnabled(!isSmartInsertDeleteEnabled());
3499 if (item.action() == ContextMenuItemTagSmartQuotes) {
3500 TextChecker::setAutomaticQuoteSubstitutionEnabled(!TextChecker::state().isAutomaticQuoteSubstitutionEnabled);
3501 process()->updateTextCheckerState();
3504 if (item.action() == ContextMenuItemTagSmartDashes) {
3505 TextChecker::setAutomaticDashSubstitutionEnabled(!TextChecker::state().isAutomaticDashSubstitutionEnabled);
3506 process()->updateTextCheckerState();
3509 if (item.action() == ContextMenuItemTagSmartLinks) {
3510 TextChecker::setAutomaticLinkDetectionEnabled(!TextChecker::state().isAutomaticLinkDetectionEnabled);
3511 process()->updateTextCheckerState();
3514 if (item.action() == ContextMenuItemTagTextReplacement) {
3515 TextChecker::setAutomaticTextReplacementEnabled(!TextChecker::state().isAutomaticTextReplacementEnabled);
3516 process()->updateTextCheckerState();
3519 if (item.action() == ContextMenuItemTagCorrectSpellingAutomatically) {
3520 TextChecker::setAutomaticSpellingCorrectionEnabled(!TextChecker::state().isAutomaticSpellingCorrectionEnabled);
3521 process()->updateTextCheckerState();
3524 if (item.action() == ContextMenuItemTagShowSubstitutions) {
3525 TextChecker::toggleSubstitutionsPanelIsShowing();
3529 if (item.action() == ContextMenuItemTagDownloadImageToDisk) {
3530 m_process->context()->download(this, KURL(KURL(), m_activeContextMenuHitTestResultData.absoluteImageURL));
3533 if (item.action() == ContextMenuItemTagDownloadLinkToDisk) {
3534 m_process->context()->download(this, KURL(KURL(), m_activeContextMenuHitTestResultData.absoluteLinkURL));
3537 if (item.action() == ContextMenuItemTagCheckSpellingWhileTyping) {
3538 TextChecker::setContinuousSpellCheckingEnabled(!TextChecker::state().isContinuousSpellCheckingEnabled);
3539 process()->updateTextCheckerState();
3542 if (item.action() == ContextMenuItemTagCheckGrammarWithSpelling) {
3543 TextChecker::setGrammarCheckingEnabled(!TextChecker::state().isGrammarCheckingEnabled);
3544 process()->updateTextCheckerState();
3547 if (item.action() == ContextMenuItemTagShowSpellingPanel) {
3548 if (!TextChecker::spellingUIIsShowing())
3549 advanceToNextMisspelling(true);
3550 TextChecker::toggleSpellingUIIsShowing();
3553 if (item.action() == ContextMenuItemTagLearnSpelling || item.action() == ContextMenuItemTagIgnoreSpelling)
3554 ++m_pendingLearnOrIgnoreWordMessageCount;
3556 #if ENABLE(TIZEN_WEBKIT2_CLIPBOARD_HELPER)
3557 if (item.action() == ContextMenuItemTagPaste) {
3558 pasteContextMenuSelected();
3563 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_TEXT_SELECTION_MODE)
3564 if (item.action() == ContextMenuItemTagTextSelectionMode) {
3565 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
3566 m_pageClient->setIsTextSelectionMode(true);
3569 evas_object_focus_set(viewWidget(), true);
3570 WebCore::IntPoint positionForSelection = m_activeContextMenu->positionForSelection();
3571 bool result = false;
3572 process()->sendSync(Messages::WebPage::SelectLink(positionForSelection), Messages::WebPage::SelectLink::Reply(result), m_pageID);
3573 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
3574 if (result == false)
3575 m_pageClient->setIsTextSelectionMode(false);
3582 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
3583 if (item.action() == ContextMenuItemTagClipboard) {
3584 clipboardContextMenuSelected();
3589 #if ENABLE(CONTEXT_MENUS)
3590 process()->send(Messages::WebPage::DidSelectItemFromActiveContextMenu(item), m_pageID);
3593 #endif // ENABLE(CONTEXT_MENUS)
3595 void WebPageProxy::didChooseFilesForOpenPanel(const Vector<String>& fileURLs)
3600 #if ENABLE(WEB_PROCESS_SANDBOX)
3601 // FIXME: The sandbox extensions should be sent with the DidChooseFilesForOpenPanel message. This
3602 // is gated on a way of passing SandboxExtension::Handles in a Vector.
3603 for (size_t i = 0; i < fileURLs.size(); ++i) {
3604 SandboxExtension::Handle sandboxExtensionHandle;
3605 SandboxExtension::createHandle(fileURLs[i], SandboxExtension::ReadOnly, sandboxExtensionHandle);
3606 process()->send(Messages::WebPage::ExtendSandboxForFileFromOpenPanel(sandboxExtensionHandle), m_pageID);
3610 process()->send(Messages::WebPage::DidChooseFilesForOpenPanel(fileURLs), m_pageID);
3612 m_openPanelResultListener->invalidate();
3613 m_openPanelResultListener = 0;
3616 void WebPageProxy::didCancelForOpenPanel()
3621 process()->send(Messages::WebPage::DidCancelForOpenPanel(), m_pageID);
3623 m_openPanelResultListener->invalidate();
3624 m_openPanelResultListener = 0;
3627 void WebPageProxy::advanceToNextMisspelling(bool startBeforeSelection) const
3629 process()->send(Messages::WebPage::AdvanceToNextMisspelling(startBeforeSelection), m_pageID);
3632 void WebPageProxy::changeSpellingToWord(const String& word) const
3637 process()->send(Messages::WebPage::ChangeSpellingToWord(word), m_pageID);
3640 void WebPageProxy::registerEditCommand(PassRefPtr<WebEditCommandProxy> commandProxy, UndoOrRedo undoOrRedo)
3642 m_pageClient->registerEditCommand(commandProxy, undoOrRedo);
3645 void WebPageProxy::addEditCommand(WebEditCommandProxy* command)
3647 m_editCommandSet.add(command);
3650 void WebPageProxy::removeEditCommand(WebEditCommandProxy* command)
3652 m_editCommandSet.remove(command);
3656 process()->send(Messages::WebPage::DidRemoveEditCommand(command->commandID()), m_pageID);
3659 bool WebPageProxy::isValidEditCommand(WebEditCommandProxy* command)
3661 return m_editCommandSet.find(command) != m_editCommandSet.end();
3664 int64_t WebPageProxy::spellDocumentTag()
3666 if (!m_hasSpellDocumentTag) {
3667 m_spellDocumentTag = TextChecker::uniqueSpellDocumentTag(this);
3668 m_hasSpellDocumentTag = true;
3671 return m_spellDocumentTag;
3674 #if USE(UNIFIED_TEXT_CHECKING)
3675 void WebPageProxy::checkTextOfParagraph(const String& text, uint64_t checkingTypes, Vector<TextCheckingResult>& results)
3677 results = TextChecker::checkTextOfParagraph(spellDocumentTag(), text.characters(), text.length(), checkingTypes);
3681 void WebPageProxy::checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength)
3683 TextChecker::checkSpellingOfString(spellDocumentTag(), text.characters(), text.length(), misspellingLocation, misspellingLength);
3686 void WebPageProxy::checkGrammarOfString(const String& text, Vector<GrammarDetail>& grammarDetails, int32_t& badGrammarLocation, int32_t& badGrammarLength)
3688 TextChecker::checkGrammarOfString(spellDocumentTag(), text.characters(), text.length(), grammarDetails, badGrammarLocation, badGrammarLength);
3691 void WebPageProxy::spellingUIIsShowing(bool& isShowing)
3693 isShowing = TextChecker::spellingUIIsShowing();
3696 void WebPageProxy::updateSpellingUIWithMisspelledWord(const String& misspelledWord)
3698 TextChecker::updateSpellingUIWithMisspelledWord(spellDocumentTag(), misspelledWord);
3701 void WebPageProxy::updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const GrammarDetail& grammarDetail)
3703 TextChecker::updateSpellingUIWithGrammarString(spellDocumentTag(), badGrammarPhrase, grammarDetail);
3706 void WebPageProxy::getGuessesForWord(const String& word, const String& context, Vector<String>& guesses)
3708 TextChecker::getGuessesForWord(spellDocumentTag(), word, context, guesses);
3711 void WebPageProxy::learnWord(const String& word)
3713 MESSAGE_CHECK(m_pendingLearnOrIgnoreWordMessageCount);
3714 --m_pendingLearnOrIgnoreWordMessageCount;
3716 TextChecker::learnWord(spellDocumentTag(), word);
3719 void WebPageProxy::ignoreWord(const String& word)
3721 MESSAGE_CHECK(m_pendingLearnOrIgnoreWordMessageCount);
3722 --m_pendingLearnOrIgnoreWordMessageCount;
3724 TextChecker::ignoreWord(spellDocumentTag(), word);
3729 void WebPageProxy::setFocus(bool focused)
3732 m_uiClient.focus(this);
3734 m_uiClient.unfocus(this);
3737 void WebPageProxy::takeFocus(uint32_t direction)
3739 m_uiClient.takeFocus(this, (static_cast<FocusDirection>(direction) == FocusDirectionForward) ? kWKFocusDirectionForward : kWKFocusDirectionBackward);
3742 void WebPageProxy::setToolTip(const String& toolTip)
3744 String oldToolTip = m_toolTip;
3745 m_toolTip = toolTip;
3746 m_pageClient->toolTipChanged(oldToolTip, m_toolTip);
3749 void WebPageProxy::setCursor(const WebCore::Cursor& cursor)
3751 m_pageClient->setCursor(cursor);
3754 void WebPageProxy::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
3756 m_pageClient->setCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves);
3759 void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
3761 WebEvent::Type type = static_cast<WebEvent::Type>(opaqueType);
3764 case WebEvent::NoType:
3765 case WebEvent::MouseMove:
3768 case WebEvent::MouseDown:
3769 case WebEvent::MouseUp:
3770 case WebEvent::Wheel:
3771 case WebEvent::KeyDown:
3772 case WebEvent::KeyUp:
3773 case WebEvent::RawKeyDown:
3774 case WebEvent::Char:
3775 #if ENABLE(GESTURE_EVENTS)
3776 case WebEvent::GestureScrollBegin:
3777 case WebEvent::GestureScrollEnd:
3778 case WebEvent::GestureSingleTap:
3780 #if ENABLE(TOUCH_EVENTS)
3781 case WebEvent::TouchStart:
3782 case WebEvent::TouchMove:
3783 case WebEvent::TouchEnd:
3784 case WebEvent::TouchCancel:
3786 process()->responsivenessTimer()->stop();
3791 case WebEvent::NoType:
3793 case WebEvent::MouseMove:
3794 m_processingMouseMoveEvent = false;
3795 if (m_nextMouseMoveEvent) {
3796 handleMouseEvent(*m_nextMouseMoveEvent);
3797 m_nextMouseMoveEvent = nullptr;
3800 case WebEvent::MouseDown:
3802 #if ENABLE(GESTURE_EVENTS)
3803 case WebEvent::GestureScrollBegin:
3804 case WebEvent::GestureScrollEnd:
3805 case WebEvent::GestureSingleTap: {
3806 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3807 QueuedUIEvents<WebGestureEvent> queuedEvents = m_gestureEventQueue.first();
3808 MESSAGE_CHECK(type == queuedEvents.forwardedEvent.type());
3809 m_gestureEventQueue.removeFirst();
3811 m_pageClient->doneWithGestureEvent(queuedEvents.forwardedEvent, handled);
3812 for (size_t i = 0; i < queuedEvents.deferredEvents.size(); ++i) {
3813 bool isEventHandled = false;
3814 m_pageClient->doneWithGestureEvent(queuedEvents.deferredEvents.at(i), isEventHandled);
3817 WebGestureEvent event = m_gestureEventQueue.first();
3818 MESSAGE_CHECK(type == event.type());
3820 m_gestureEventQueue.removeFirst();
3821 m_pageClient->doneWithGestureEvent(event, handled);
3824 #if ENABLE(TIZEN_ISF_PORT)
3825 if (m_isVisible && type == WebEvent::GestureSingleTap) {
3826 InputMethodContextEfl* inputMethodContext = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->inputMethodContext();
3827 inputMethodContext->updateTextInputStateByUserAction(true);
3833 case WebEvent::MouseUp:
3834 m_currentlyProcessedMouseDownEvent = nullptr;
3837 case WebEvent::Wheel: {
3838 ASSERT(!m_currentlyProcessedWheelEvents.isEmpty());
3840 OwnPtr<Vector<NativeWebWheelEvent> > oldestCoalescedEvent = m_currentlyProcessedWheelEvents.takeFirst();
3842 // FIXME: Dispatch additional events to the didNotHandleWheelEvent client function.
3843 if (!handled && m_uiClient.implementsDidNotHandleWheelEvent())
3844 m_uiClient.didNotHandleWheelEvent(this, oldestCoalescedEvent->last());
3846 if (!m_wheelEventQueue.isEmpty())
3847 processNextQueuedWheelEvent();
3851 case WebEvent::KeyDown:
3852 case WebEvent::KeyUp:
3853 case WebEvent::RawKeyDown:
3854 case WebEvent::Char: {
3855 LOG(KeyHandling, "WebPageProxy::didReceiveEvent: %s", webKeyboardEventTypeString(type));
3857 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3858 QueuedUIEvents<NativeWebKeyboardEvent> queuedEvents = m_keyEventQueue.first();
3859 NativeWebKeyboardEvent event = queuedEvents.forwardedEvent;
3860 MESSAGE_CHECK(type == event.type());
3861 m_keyEventQueue.removeFirst();
3863 m_pageClient->doneWithKeyEvent(event, handled);
3864 for (size_t i = 0; i < queuedEvents.deferredEvents.size(); ++i) {
3865 bool isEventHandled = false;
3866 m_pageClient->doneWithKeyEvent(queuedEvents.deferredEvents.at(i), isEventHandled);
3869 NativeWebKeyboardEvent event = m_keyEventQueue.first();
3870 MESSAGE_CHECK(type == event.type());
3872 m_keyEventQueue.removeFirst();
3874 if (!m_keyEventQueue.isEmpty())
3875 process()->send(Messages::WebPage::KeyEvent(m_keyEventQueue.first()), m_pageID);
3877 m_pageClient->doneWithKeyEvent(event, handled);
3878 #endif // #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3883 #if ENABLE(TIZEN_ISF_PORT)
3884 InputMethodContextEfl* inputMethodContext = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->inputMethodContext();
3885 if (event.type() == WebEvent::KeyDown && event.keyIdentifier() == "Enter" && inputMethodContext && inputMethodContext->autoCapitalType() == ECORE_IMF_AUTOCAPITAL_TYPE_NONE)
3886 inputMethodContext->hideIMFContext();
3889 if (m_uiClient.implementsDidNotHandleKeyEvent())
3890 m_uiClient.didNotHandleKeyEvent(this, event);
3893 ::TranslateMessage(event.nativeEvent());
3897 #if ENABLE(TOUCH_EVENTS)
3898 case WebEvent::TouchStart:
3899 case WebEvent::TouchMove:
3900 case WebEvent::TouchEnd:
3901 case WebEvent::TouchCancel: {
3902 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3903 QueuedUIEvents<NativeWebTouchEvent> queuedEvents = m_touchEventQueue.first();
3904 MESSAGE_CHECK(type == queuedEvents.forwardedEvent.type());
3905 m_touchEventQueue.removeFirst();
3907 m_pageClient->doneWithTouchEvent(queuedEvents.forwardedEvent, handled);
3908 for (size_t i = 0; i < queuedEvents.deferredEvents.size(); ++i) {
3909 bool isEventHandled = false;
3910 m_pageClient->doneWithTouchEvent(queuedEvents.deferredEvents.at(i), isEventHandled);
3913 QueuedTouchEvents queuedEvents = m_touchEventQueue.first();
3914 MESSAGE_CHECK(type == queuedEvents.forwardedEvent.type());
3915 m_touchEventQueue.removeFirst();
3917 m_pageClient->doneWithTouchEvent(queuedEvents.forwardedEvent, handled);
3918 for (size_t i = 0; i < queuedEvents.deferredTouchEvents.size(); ++i) {
3919 bool isEventHandled = false;
3920 m_pageClient->doneWithTouchEvent(queuedEvents.deferredTouchEvents.at(i), isEventHandled);
3929 void WebPageProxy::stopResponsivenessTimer()
3931 process()->responsivenessTimer()->stop();
3934 void WebPageProxy::voidCallback(uint64_t callbackID)
3936 RefPtr<VoidCallback> callback = m_voidCallbacks.take(callbackID);
3938 // FIXME: Log error or assert.
3942 callback->performCallback();
3945 void WebPageProxy::dataCallback(const CoreIPC::DataReference& dataReference, uint64_t callbackID)
3947 RefPtr<DataCallback> callback = m_dataCallbacks.take(callbackID);
3949 // FIXME: Log error or assert.
3953 callback->performCallbackWithReturnValue(WebData::create(dataReference.data(), dataReference.size()).get());
3956 void WebPageProxy::stringCallback(const String& resultString, uint64_t callbackID)
3958 RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackID);
3960 // FIXME: Log error or assert.
3961 // this can validly happen if a load invalidated the callback, though
3965 m_loadDependentStringCallbackIDs.remove(callbackID);
3967 callback->performCallbackWithReturnValue(resultString.impl());
3970 void WebPageProxy::scriptValueCallback(const CoreIPC::DataReference& dataReference, uint64_t callbackID)
3972 RefPtr<ScriptValueCallback> callback = m_scriptValueCallbacks.take(callbackID);
3974 // FIXME: Log error or assert.
3978 Vector<uint8_t> data;
3979 data.reserveInitialCapacity(dataReference.size());
3980 data.append(dataReference.data(), dataReference.size());
3982 callback->performCallbackWithReturnValue(data.size() ? WebSerializedScriptValue::adopt(data).get() : 0);
3985 void WebPageProxy::computedPagesCallback(const Vector<IntRect>& pageRects, double totalScaleFactorForPrinting, uint64_t callbackID)
3987 RefPtr<ComputedPagesCallback> callback = m_computedPagesCallbacks.take(callbackID);
3989 // FIXME: Log error or assert.
3993 callback->performCallbackWithReturnValue(pageRects, totalScaleFactorForPrinting);
3996 void WebPageProxy::validateCommandCallback(const String& commandName, bool isEnabled, int state, uint64_t callbackID)
3998 RefPtr<ValidateCommandCallback> callback = m_validateCommandCallbacks.take(callbackID);
4000 // FIXME: Log error or assert.
4004 callback->performCallbackWithReturnValue(commandName.impl(), isEnabled, state);
4008 void WebPageProxy::printFinishedCallback(const ResourceError& printError, uint64_t callbackID)
4010 RefPtr<PrintFinishedCallback> callback = m_printFinishedCallbacks.take(callbackID);
4012 // FIXME: Log error or assert.
4016 RefPtr<WebError> error = WebError::create(printError);
4017 callback->performCallbackWithReturnValue(error.get());
4021 void WebPageProxy::focusedFrameChanged(uint64_t frameID)
4028 WebFrameProxy* frame = process()->webFrame(frameID);
4029 MESSAGE_CHECK(frame);
4031 m_focusedFrame = frame;
4034 void WebPageProxy::frameSetLargestFrameChanged(uint64_t frameID)
4037 m_frameSetLargestFrame = 0;
4041 WebFrameProxy* frame = process()->webFrame(frameID);
4042 MESSAGE_CHECK(frame);
4044 m_frameSetLargestFrame = frame;
4047 void WebPageProxy::processDidBecomeUnresponsive()
4052 updateBackingStoreDiscardableState();
4054 m_loaderClient.processDidBecomeUnresponsive(this);
4057 void WebPageProxy::interactionOccurredWhileProcessUnresponsive()
4062 m_loaderClient.interactionOccurredWhileProcessUnresponsive(this);
4065 void WebPageProxy::processDidBecomeResponsive()
4070 updateBackingStoreDiscardableState();
4072 m_loaderClient.processDidBecomeResponsive(this);
4075 void WebPageProxy::processDidCrash()
4077 ASSERT(m_pageClient);
4080 m_isPageSuspended = false;
4083 m_urlAtProcessExit = m_mainFrame->url();
4084 m_loadStateAtProcessExit = m_mainFrame->loadState();
4087 m_mainFrame = nullptr;
4088 m_drawingArea = nullptr;
4090 #if ENABLE(INSPECTOR)
4092 m_inspector->invalidate();
4093 m_inspector = nullptr;
4097 #if ENABLE(FULLSCREEN_API)
4098 if (m_fullScreenManager) {
4099 m_fullScreenManager->invalidate();
4100 m_fullScreenManager = nullptr;
4104 if (m_openPanelResultListener) {
4105 m_openPanelResultListener->invalidate();
4106 m_openPanelResultListener = nullptr;
4109 #if ENABLE(INPUT_TYPE_COLOR)
4110 if (m_colorChooser) {
4111 m_colorChooser->invalidate();
4112 m_colorChooser = nullptr;
4115 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
4116 if (m_colorPickerResultListener) {
4117 m_colorPickerResultListener->invalidate();
4118 m_colorPickerResultListener = nullptr;
4123 #if ENABLE(GEOLOCATION)
4124 m_geolocationPermissionRequestManager.invalidateRequests();
4127 m_notificationPermissionRequestManager.invalidateRequests();
4129 m_toolTip = String();
4131 m_mainFrameHasHorizontalScrollbar = false;
4132 m_mainFrameHasVerticalScrollbar = false;
4134 m_mainFrameIsPinnedToLeftSide = false;
4135 m_mainFrameIsPinnedToRightSide = false;
4137 m_visibleScrollerThumbRect = IntRect();
4139 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
4140 invalidateCallbackMap(m_booleanCallbacks);
4141 invalidateCallbackMap(m_dictionaryCallbacks);
4143 invalidateCallbackMap(m_voidCallbacks);
4144 invalidateCallbackMap(m_dataCallbacks);
4145 invalidateCallbackMap(m_stringCallbacks);
4146 m_loadDependentStringCallbackIDs.clear();
4147 invalidateCallbackMap(m_scriptValueCallbacks);
4148 invalidateCallbackMap(m_computedPagesCallbacks);
4149 invalidateCallbackMap(m_validateCommandCallbacks);
4151 invalidateCallbackMap(m_printFinishedCallbacks);
4154 Vector<WebEditCommandProxy*> editCommandVector;
4155 copyToVector(m_editCommandSet, editCommandVector);
4156 m_editCommandSet.clear();
4157 for (size_t i = 0, size = editCommandVector.size(); i < size; ++i)
4158 editCommandVector[i]->invalidate();
4159 m_pageClient->clearAllEditCommands();
4161 m_activePopupMenu = 0;
4163 m_estimatedProgress = 0.0;
4165 m_pendingLearnOrIgnoreWordMessageCount = 0;
4167 m_pageClient->processDidCrash();
4168 m_loaderClient.processDidCrash(this);
4171 // If the call out to the loader client didn't cause the web process to be relaunched,
4172 // we'll call setNeedsDisplay on the view so that we won't have the old contents showing.
4173 // If the call did cause the web process to be relaunched, we'll keep the old page contents showing
4174 // until the new web process has painted its contents.
4175 setViewNeedsDisplay(IntRect(IntPoint(), viewSize()));
4178 // Can't expect DidReceiveEvent notifications from a crashed web process.
4179 m_keyEventQueue.clear();
4181 m_wheelEventQueue.clear();
4182 m_currentlyProcessedWheelEvents.clear();
4184 m_nextMouseMoveEvent = nullptr;
4185 m_currentlyProcessedMouseDownEvent = nullptr;
4187 m_processingMouseMoveEvent = false;
4189 #if ENABLE(TOUCH_EVENTS)
4190 m_needTouchEvents = false;
4191 m_touchEventQueue.clear();
4194 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4195 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
4196 m_pageClient->dismissDictionaryLookupPanel();
4200 WebPageCreationParameters WebPageProxy::creationParameters() const
4202 WebPageCreationParameters parameters;
4204 parameters.viewSize = m_pageClient->viewSize();
4205 parameters.isActive = m_pageClient->isViewWindowActive();
4206 parameters.isFocused = m_pageClient->isViewFocused();
4207 parameters.isVisible = m_pageClient->isViewVisible();
4208 parameters.isInWindow = m_pageClient->isViewInWindow();
4209 parameters.drawingAreaType = m_drawingArea->type();
4210 parameters.store = m_pageGroup->preferences()->store();
4211 parameters.pageGroupData = m_pageGroup->data();
4212 parameters.drawsBackground = m_drawsBackground;
4213 parameters.drawsTransparentBackground = m_drawsTransparentBackground;
4214 parameters.areMemoryCacheClientCallsEnabled = m_areMemoryCacheClientCallsEnabled;
4215 parameters.useFixedLayout = m_useFixedLayout;
4216 parameters.fixedLayoutSize = m_fixedLayoutSize;
4217 parameters.paginationMode = m_paginationMode;
4218 parameters.paginationBehavesLikeColumns = m_paginationBehavesLikeColumns;
4219 parameters.pageLength = m_pageLength;
4220 parameters.gapBetweenPages = m_gapBetweenPages;
4221 parameters.userAgent = userAgent();
4222 parameters.sessionState = SessionState(m_backForwardList->entries(), m_backForwardList->currentIndex());
4223 parameters.highestUsedBackForwardItemID = WebBackForwardListItem::highedUsedItemID();
4224 parameters.canRunBeforeUnloadConfirmPanel = m_uiClient.canRunBeforeUnloadConfirmPanel();
4225 parameters.canRunModal = m_canRunModal;
4226 parameters.deviceScaleFactor = m_intrinsicDeviceScaleFactor;
4227 parameters.mediaVolume = m_mediaVolume;
4230 parameters.isSmartInsertDeleteEnabled = m_isSmartInsertDeleteEnabled;
4231 parameters.layerHostingMode = m_layerHostingMode;
4232 parameters.colorSpace = m_pageClient->colorSpace();
4236 parameters.nativeWindow = m_pageClient->nativeWindow();
4241 #if USE(ACCELERATED_COMPOSITING)
4242 void WebPageProxy::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
4244 m_pageClient->enterAcceleratedCompositingMode(layerTreeContext);
4247 void WebPageProxy::exitAcceleratedCompositingMode()
4249 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
4250 process()->platformSurfaceTexturePool()->removeAllPlatformSurfaceTextures();
4252 m_pageClient->exitAcceleratedCompositingMode();
4255 void WebPageProxy::updateAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
4257 m_pageClient->updateAcceleratedCompositingMode(layerTreeContext);
4259 #endif // USE(ACCELERATED_COMPOSITING)
4261 void WebPageProxy::backForwardClear()
4263 m_backForwardList->clear();
4266 void WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const ProtectionSpace& coreProtectionSpace, bool& canAuthenticate)
4268 WebFrameProxy* frame = process()->webFrame(frameID);
4269 MESSAGE_CHECK(frame);
4271 RefPtr<WebProtectionSpace> protectionSpace = WebProtectionSpace::create(coreProtectionSpace);
4273 canAuthenticate = m_loaderClient.canAuthenticateAgainstProtectionSpaceInFrame(this, frame, protectionSpace.get());
4276 #if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
4277 void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const AuthenticationChallenge& coreChallenge, uint64_t challengeID, PassRefPtr<Messages::WebPageProxy::DidReceiveAuthenticationChallenge::DelayedReply> reply)
4279 void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const AuthenticationChallenge& coreChallenge, uint64_t challengeID)
4282 WebFrameProxy* frame = process()->webFrame(frameID);
4283 MESSAGE_CHECK(frame);
4285 #if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
4286 RefPtr<AuthenticationChallengeProxy> authenticationChallenge = frame->setUpAuthenticationChallengeProxy(coreChallenge, challengeID, process());
4287 m_AuthReply = reply;
4289 if (!m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get()))
4290 replyReceiveAuthenticationChallengeInFrame(true);
4292 RefPtr<AuthenticationChallengeProxy> authenticationChallenge = AuthenticationChallengeProxy::create(coreChallenge, challengeID, process());
4294 m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get());
4298 #if ENABLE(TIZEN_SQL_DATABASE)
4299 void WebPageProxy::exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& displayName, uint64_t expectedUsage, PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply> allowExceed)
4301 WebFrameProxy* frame = process()->webFrame(frameID);
4302 MESSAGE_CHECK(frame);
4304 // Since exceededDatabaseQuota() can spin a nested run loop we need to turn off the responsiveness timer.
4305 process()->responsivenessTimer()->stop();
4307 m_exceededDatabaseQuotaReply = allowExceed;
4308 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
4309 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
4310 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
4313 if (!m_uiClient.exceededDatabaseQuota(this, frame, origin.get(), displayName, expectedUsage))
4314 replyExceededDatabaseQuota(true);
4317 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)
4319 WebFrameProxy* frame = process()->webFrame(frameID);
4320 MESSAGE_CHECK(frame);
4322 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
4324 newQuota = m_uiClient.exceededDatabaseQuota(this, frame, origin.get(), databaseName, displayName, currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage);
4328 void WebPageProxy::requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier)
4330 WebFrameProxy* frame = process()->webFrame(frameID);
4331 MESSAGE_CHECK(frame);
4333 // FIXME: Geolocation should probably be using toString() as its string representation instead of databaseIdentifier().
4334 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
4335 RefPtr<GeolocationPermissionRequestProxy> request = m_geolocationPermissionRequestManager.createRequest(geolocationID);
4337 if (!m_uiClient.decidePolicyForGeolocationPermissionRequest(this, frame, origin.get(), request.get()))
4341 void WebPageProxy::requestNotificationPermission(uint64_t requestID, const String& originString)
4343 if (!isRequestIDValid(requestID))
4346 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromString(originString);
4347 RefPtr<NotificationPermissionRequest> request = m_notificationPermissionRequestManager.createRequest(requestID);
4349 if (!m_uiClient.decidePolicyForNotificationPermissionRequest(this, origin.get(), request.get()))
4353 void WebPageProxy::showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID)
4355 m_process->context()->notificationManagerProxy()->show(this, title, body, iconURL, tag, originString, notificationID);
4358 #if ENABLE(TIZEN_MEDIA_STREAM)
4359 void WebPageProxy::requestUserMediaPermission(uint64_t requestID)
4361 RefPtr<UserMediaPermissionRequest> request = m_userMediaPermissionRequestManager.createRequest(requestID);
4363 if (!m_tizenClient.decidePolicyForUserMediaPermissionRequest(this, request.get()))
4368 float WebPageProxy::headerHeight(WebFrameProxy* frame)
4370 if (frame->isDisplayingPDFDocument())
4372 return m_uiClient.headerHeight(this, frame);
4375 float WebPageProxy::footerHeight(WebFrameProxy* frame)
4377 if (frame->isDisplayingPDFDocument())
4379 return m_uiClient.footerHeight(this, frame);
4382 void WebPageProxy::drawHeader(WebFrameProxy* frame, const FloatRect& rect)
4384 if (frame->isDisplayingPDFDocument())
4386 m_uiClient.drawHeader(this, frame, rect);
4389 void WebPageProxy::drawFooter(WebFrameProxy* frame, const FloatRect& rect)
4391 if (frame->isDisplayingPDFDocument())
4393 m_uiClient.drawFooter(this, frame, rect);
4396 void WebPageProxy::runModal()
4398 // Since runModal() can (and probably will) spin a nested run loop we need to turn off the responsiveness timer.
4399 process()->responsivenessTimer()->stop();
4401 // Our Connection's run loop might have more messages waiting to be handled after this RunModal message.
4402 // To make sure they are handled inside of the the nested modal run loop we must first signal the Connection's
4403 // run loop so we're guaranteed that it has a chance to wake up.
4404 // See http://webkit.org/b/89590 for more discussion.
4405 process()->connection()->wakeUpRunLoop();
4407 m_uiClient.runModal(this);
4410 void WebPageProxy::notifyScrollerThumbIsVisibleInRect(const IntRect& scrollerThumb)
4412 m_visibleScrollerThumbRect = scrollerThumb;
4415 void WebPageProxy::recommendedScrollbarStyleDidChange(int32_t newStyle)
4418 m_pageClient->recommendedScrollbarStyleDidChange(newStyle);
4422 void WebPageProxy::didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar)
4424 m_mainFrameHasHorizontalScrollbar = hasHorizontalScrollbar;
4425 m_mainFrameHasVerticalScrollbar = hasVerticalScrollbar;
4427 m_pageClient->didChangeScrollbarsForMainFrame();
4430 void WebPageProxy::didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide)
4432 m_mainFrameIsPinnedToLeftSide = pinnedToLeftSide;
4433 m_mainFrameIsPinnedToRightSide = pinnedToRightSide;
4436 void WebPageProxy::didChangePageCount(unsigned pageCount)
4438 m_pageCount = pageCount;
4441 void WebPageProxy::didFailToInitializePlugin(const String& mimeType)
4443 m_loaderClient.didFailToInitializePlugin(this, mimeType);
4446 void WebPageProxy::didBlockInsecurePluginVersion(const String& mimeType, const String& urlString)
4448 String pluginIdentifier;
4449 String pluginVersion;
4450 String newMimeType = mimeType;
4453 PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL(KURL(), urlString));
4455 pluginIdentifier = plugin.bundleIdentifier;
4456 pluginVersion = plugin.versionString;
4459 m_loaderClient.didBlockInsecurePluginVersion(this, newMimeType, pluginIdentifier, pluginVersion);
4462 bool WebPageProxy::willHandleHorizontalScrollEvents() const
4464 return !m_canShortCircuitHorizontalWheelEvents;
4467 void WebPageProxy::didFinishLoadingDataForCustomRepresentation(const String& suggestedFilename, const CoreIPC::DataReference& dataReference)
4469 m_pageClient->didFinishLoadingDataForCustomRepresentation(suggestedFilename, dataReference);
4472 void WebPageProxy::backForwardRemovedItem(uint64_t itemID)
4474 process()->send(Messages::WebPage::DidRemoveBackForwardItem(itemID), m_pageID);
4477 void WebPageProxy::setCanRunModal(bool canRunModal)
4482 // It's only possible to change the state for a WebPage which
4483 // already qualifies for running modal child web pages, otherwise
4484 // there's no other possibility than not allowing it.
4485 m_canRunModal = m_uiClient.canRunModal() && canRunModal;
4486 process()->send(Messages::WebPage::SetCanRunModal(m_canRunModal), m_pageID);
4489 bool WebPageProxy::canRunModal()
4491 return isValid() ? m_canRunModal : false;
4494 void WebPageProxy::beginPrinting(WebFrameProxy* frame, const PrintInfo& printInfo)
4496 if (m_isInPrintingMode)
4499 m_isInPrintingMode = true;
4500 process()->send(Messages::WebPage::BeginPrinting(frame->frameID(), printInfo), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4503 void WebPageProxy::endPrinting()
4505 if (!m_isInPrintingMode)
4508 m_isInPrintingMode = false;
4509 process()->send(Messages::WebPage::EndPrinting(), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4512 void WebPageProxy::computePagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<ComputedPagesCallback> prpCallback)
4514 RefPtr<ComputedPagesCallback> callback = prpCallback;
4516 callback->invalidate();
4520 uint64_t callbackID = callback->callbackID();
4521 m_computedPagesCallbacks.set(callbackID, callback.get());
4522 m_isInPrintingMode = true;
4523 process()->send(Messages::WebPage::ComputePagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4526 #if PLATFORM(MAC) || PLATFORM(WIN)
4527 void WebPageProxy::drawRectToPDF(WebFrameProxy* frame, const PrintInfo& printInfo, const IntRect& rect, PassRefPtr<DataCallback> prpCallback)
4529 RefPtr<DataCallback> callback = prpCallback;
4531 callback->invalidate();
4535 uint64_t callbackID = callback->callbackID();
4536 m_dataCallbacks.set(callbackID, callback.get());
4537 process()->send(Messages::WebPage::DrawRectToPDF(frame->frameID(), printInfo, rect, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4540 void WebPageProxy::drawPagesToPDF(WebFrameProxy* frame, const PrintInfo& printInfo, uint32_t first, uint32_t count, PassRefPtr<DataCallback> prpCallback)
4542 RefPtr<DataCallback> callback = prpCallback;
4544 callback->invalidate();
4548 uint64_t callbackID = callback->callbackID();
4549 m_dataCallbacks.set(callbackID, callback.get());
4550 process()->send(Messages::WebPage::DrawPagesToPDF(frame->frameID(), printInfo, first, count, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4553 void WebPageProxy::drawPagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<PrintFinishedCallback> didPrintCallback)
4555 RefPtr<PrintFinishedCallback> callback = didPrintCallback;
4557 callback->invalidate();
4561 uint64_t callbackID = callback->callbackID();
4562 m_printFinishedCallbacks.set(callbackID, callback.get());
4563 m_isInPrintingMode = true;
4564 process()->send(Messages::WebPage::DrawPagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4568 void WebPageProxy::flashBackingStoreUpdates(const Vector<IntRect>& updateRects)
4570 m_pageClient->flashBackingStoreUpdates(updateRects);
4573 void WebPageProxy::updateBackingStoreDiscardableState()
4579 if (!process()->responsivenessTimer()->isResponsive())
4580 isDiscardable = false;
4582 isDiscardable = !m_pageClient->isViewWindowActive() || !isViewVisible();
4584 m_drawingArea->setBackingStoreIsDiscardable(isDiscardable);
4587 Color WebPageProxy::viewUpdatesFlashColor()
4589 return Color(0, 200, 255);
4592 Color WebPageProxy::backingStoreUpdatesFlashColor()
4594 return Color(200, 0, 255);
4597 void WebPageProxy::saveDataToFileInDownloadsFolder(const String& suggestedFilename, const String& mimeType, const String& originatingURLString, WebData* data)
4599 m_uiClient.saveDataToFileInDownloadsFolder(this, suggestedFilename, mimeType, originatingURLString, data);
4602 void WebPageProxy::linkClicked(const String& url, const WebMouseEvent& event)
4604 process()->send(Messages::WebPage::LinkClicked(url, event), m_pageID, 0);
4609 void WebPageProxy::substitutionsPanelIsShowing(bool& isShowing)
4611 isShowing = TextChecker::substitutionsPanelIsShowing();
4614 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4615 void WebPageProxy::showCorrectionPanel(int32_t panelType, const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings)
4617 m_pageClient->showCorrectionPanel((AlternativeTextType)panelType, boundingBoxOfReplacedString, replacedString, replacementString, alternativeReplacementStrings);
4620 void WebPageProxy::dismissCorrectionPanel(int32_t reason)
4622 m_pageClient->dismissCorrectionPanel((ReasonForDismissingAlternativeText)reason);
4625 void WebPageProxy::dismissCorrectionPanelSoon(int32_t reason, String& result)
4627 result = m_pageClient->dismissCorrectionPanelSoon((ReasonForDismissingAlternativeText)reason);
4630 void WebPageProxy::recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString)
4632 m_pageClient->recordAutocorrectionResponse((AutocorrectionResponseType)responseType, replacedString, replacementString);
4634 #endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4636 void WebPageProxy::handleAlternativeTextUIResult(const String& result)
4638 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4640 process()->send(Messages::WebPage::HandleAlternativeTextUIResult(result), m_pageID, 0);
4644 #if USE(DICTATION_ALTERNATIVES)
4645 void WebPageProxy::showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext)
4647 m_pageClient->showDictationAlternativeUI(boundingBoxOfDictatedText, dictationContext);
4650 void WebPageProxy::dismissDictationAlternativeUI()
4652 m_pageClient->dismissDictationAlternativeUI();
4655 void WebPageProxy::removeDictationAlternatives(uint64_t dictationContext)
4657 m_pageClient->removeDictationAlternatives(dictationContext);
4660 void WebPageProxy::dictationAlternatives(uint64_t dictationContext, Vector<String>& result)
4662 result = m_pageClient->dictationAlternatives(dictationContext);
4666 #endif // PLATFORM(MAC)
4669 void WebPageProxy::didReceiveURIRequest(String uriString, uint64_t requestID)
4671 m_process->context()->soupRequestManagerProxy()->didReceiveURIRequest(uriString, this, requestID);
4675 #if ENABLE(TIZEN_PAGE_VISIBILITY_API)
4676 void WebPageProxy::setPageVisibility(WebCore::PageVisibilityState pageVisibilityState, bool isInitialState)
4678 process()->send(Messages::WebPage::SetVisibilityState(static_cast<uint32_t>(pageVisibilityState), isInitialState), m_pageID);
4682 #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
4683 void WebPageProxy::decidePolicyForCertificateError(const String& url, const String& certificate, int error, PassRefPtr<Messages::WebPageProxy::DecidePolicyForCertificateError::DelayedReply> reply)
4685 m_allowedReply = reply;
4687 if (!m_tizenClient.decidePolicyForCertificateError(this, url, certificate, error))
4688 replyPolicyForCertificateError(true);
4692 #if ENABLE(TIZEN_NATIVE_MEMORY_SNAPSHOT)
4693 void WebPageProxy::dumpMemorySnapshot()
4695 process()->send(Messages::WebPage::DumpMemorySnapshot(), m_pageID);
4699 } // namespace WebKit