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)
265 webPageProxyCounter.increment();
268 WebContext::statistics().wkPageCount++;
270 m_pageGroup->addPage(this);
273 WebPageProxy::~WebPageProxy()
278 WebContext::statistics().wkPageCount--;
280 if (m_hasSpellDocumentTag)
281 TextChecker::closeSpellDocumentWithTag(m_spellDocumentTag);
283 m_pageGroup->removePage(this);
286 webPageProxyCounter.decrement();
288 #if ENABLE(TIZEN_REDUCE_KEY_LAGGING)
289 if (m_pageContentResumeTimer)
290 ecore_timer_del(m_pageContentResumeTimer);
294 WebProcessProxy* WebPageProxy::process() const
296 return m_process.get();
299 PlatformProcessIdentifier WebPageProxy::processIdentifier() const
304 return m_process->processIdentifier();
307 bool WebPageProxy::isValid()
309 // A page that has been explicitly closed is never valid.
316 void WebPageProxy::initializeLoaderClient(const WKPageLoaderClient* loadClient)
318 m_loaderClient.initialize(loadClient);
323 process()->send(Messages::WebPage::SetWillGoToBackForwardItemCallbackEnabled(loadClient->version > 0), m_pageID);
326 void WebPageProxy::initializePolicyClient(const WKPagePolicyClient* policyClient)
328 m_policyClient.initialize(policyClient);
331 void WebPageProxy::initializeFormClient(const WKPageFormClient* formClient)
333 m_formClient.initialize(formClient);
336 void WebPageProxy::initializeResourceLoadClient(const WKPageResourceLoadClient* client)
338 m_resourceLoadClient.initialize(client);
341 void WebPageProxy::initializeUIClient(const WKPageUIClient* client)
346 m_uiClient.initialize(client);
348 process()->send(Messages::WebPage::SetCanRunBeforeUnloadConfirmPanel(m_uiClient.canRunBeforeUnloadConfirmPanel()), m_pageID);
349 setCanRunModal(m_uiClient.canRunModal());
352 void WebPageProxy::initializeFindClient(const WKPageFindClient* client)
354 m_findClient.initialize(client);
357 void WebPageProxy::initializeFindMatchesClient(const WKPageFindMatchesClient* client)
359 m_findMatchesClient.initialize(client);
362 #if ENABLE(CONTEXT_MENUS)
363 void WebPageProxy::initializeContextMenuClient(const WKPageContextMenuClient* client)
365 m_contextMenuClient.initialize(client);
369 void WebPageProxy::reattachToWebProcess()
375 m_process = m_process->context()->relaunchProcessIfNecessary();
376 process()->addExistingWebPage(this, m_pageID);
380 m_pageClient->didRelaunchProcess();
381 m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
384 void WebPageProxy::reattachToWebProcessWithItem(WebBackForwardListItem* item)
386 if (item && item != m_backForwardList->currentItem())
387 m_backForwardList->goToItem(item);
389 reattachToWebProcess();
394 process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
395 process()->responsivenessTimer()->start();
398 void WebPageProxy::initializeWebPage()
402 BackForwardListItemVector items = m_backForwardList->entries();
403 for (size_t i = 0; i < items.size(); ++i)
404 process()->registerNewWebBackForwardListItem(items[i].get());
406 m_drawingArea = m_pageClient->createDrawingAreaProxy();
407 ASSERT(m_drawingArea);
409 #if ENABLE(INSPECTOR_SERVER)
410 if (m_pageGroup->preferences()->developerExtrasEnabled())
411 inspector()->enableRemoteInspection();
414 process()->send(Messages::WebProcess::CreateWebPage(m_pageID, creationParameters()), 0);
416 #if ENABLE(PAGE_VISIBILITY_API)
417 process()->send(Messages::WebPage::SetVisibilityState(m_visibilityState, /* isInitialState */ true), m_pageID);
421 void WebPageProxy::close()
428 m_backForwardList->pageClosed();
429 m_pageClient->pageClosed();
431 process()->disconnectFramesFromPage(this);
434 #if ENABLE(INSPECTOR)
436 m_inspector->invalidate();
441 #if ENABLE(FULLSCREEN_API)
442 if (m_fullScreenManager) {
443 m_fullScreenManager->invalidate();
444 m_fullScreenManager = 0;
448 if (m_openPanelResultListener) {
449 m_openPanelResultListener->invalidate();
450 m_openPanelResultListener = 0;
453 #if ENABLE(INPUT_TYPE_COLOR)
454 if (m_colorChooser) {
455 m_colorChooser->invalidate();
456 m_colorChooser = nullptr;
459 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
460 if (m_colorPickerResultListener) {
461 m_colorPickerResultListener->invalidate();
462 m_colorPickerResultListener = nullptr;
467 #if ENABLE(GEOLOCATION)
468 m_geolocationPermissionRequestManager.invalidateRequests();
471 m_notificationPermissionRequestManager.invalidateRequests();
472 #if ENABLE(TIZEN_MEDIA_STREAM)
473 m_userMediaPermissionRequestManager.invalidateRequests();
476 m_toolTip = String();
478 m_mainFrameHasHorizontalScrollbar = false;
479 m_mainFrameHasVerticalScrollbar = false;
481 m_mainFrameIsPinnedToLeftSide = false;
482 m_mainFrameIsPinnedToRightSide = false;
484 m_visibleScrollerThumbRect = IntRect();
486 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
487 invalidateCallbackMap(m_booleanCallbacks);
488 invalidateCallbackMap(m_dictionaryCallbacks);
490 invalidateCallbackMap(m_voidCallbacks);
491 invalidateCallbackMap(m_dataCallbacks);
492 invalidateCallbackMap(m_stringCallbacks);
493 m_loadDependentStringCallbackIDs.clear();
494 invalidateCallbackMap(m_scriptValueCallbacks);
495 invalidateCallbackMap(m_computedPagesCallbacks);
497 invalidateCallbackMap(m_printFinishedCallbacks);
500 Vector<WebEditCommandProxy*> editCommandVector;
501 copyToVector(m_editCommandSet, editCommandVector);
502 m_editCommandSet.clear();
503 for (size_t i = 0, size = editCommandVector.size(); i < size; ++i)
504 editCommandVector[i]->invalidate();
506 m_activePopupMenu = 0;
508 m_estimatedProgress = 0.0;
510 m_loaderClient.initialize(0);
511 m_policyClient.initialize(0);
512 m_uiClient.initialize(0);
514 m_drawingArea = nullptr;
516 process()->send(Messages::WebPage::Close(), m_pageID);
517 process()->removeWebPage(m_pageID);
520 bool WebPageProxy::tryClose()
525 process()->send(Messages::WebPage::TryClose(), m_pageID);
526 process()->responsivenessTimer()->start();
530 bool WebPageProxy::maybeInitializeSandboxExtensionHandle(const KURL& url, SandboxExtension::Handle& sandboxExtensionHandle)
532 if (!url.isLocalFile())
535 #if ENABLE(INSPECTOR)
536 // Don't give the inspector full access to the file system.
537 if (WebInspectorProxy::isInspectorPage(this))
541 SandboxExtension::createHandle("/", SandboxExtension::ReadOnly, sandboxExtensionHandle);
545 void WebPageProxy::loadURL(const String& url)
547 setPendingAPIRequestURL(url);
550 reattachToWebProcess();
552 SandboxExtension::Handle sandboxExtensionHandle;
553 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), url), sandboxExtensionHandle);
554 if (createdExtension)
555 process()->willAcquireUniversalFileReadSandboxExtension();
556 process()->send(Messages::WebPage::LoadURL(url, sandboxExtensionHandle), m_pageID);
557 process()->responsivenessTimer()->start();
560 void WebPageProxy::loadURLRequest(WebURLRequest* urlRequest)
562 setPendingAPIRequestURL(urlRequest->resourceRequest().url());
565 reattachToWebProcess();
567 SandboxExtension::Handle sandboxExtensionHandle;
568 bool createdExtension = maybeInitializeSandboxExtensionHandle(urlRequest->resourceRequest().url(), sandboxExtensionHandle);
569 if (createdExtension)
570 process()->willAcquireUniversalFileReadSandboxExtension();
571 process()->send(Messages::WebPage::LoadURLRequest(urlRequest->resourceRequest(), sandboxExtensionHandle), m_pageID);
572 process()->responsivenessTimer()->start();
575 void WebPageProxy::loadHTMLString(const String& htmlString, const String& baseURL)
578 reattachToWebProcess();
580 process()->assumeReadAccessToBaseURL(baseURL);
581 process()->send(Messages::WebPage::LoadHTMLString(htmlString, baseURL), m_pageID);
582 process()->responsivenessTimer()->start();
585 void WebPageProxy::loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL)
588 reattachToWebProcess();
591 m_mainFrame->setUnreachableURL(unreachableURL);
593 process()->assumeReadAccessToBaseURL(baseURL);
594 process()->send(Messages::WebPage::LoadAlternateHTMLString(htmlString, baseURL, unreachableURL), m_pageID);
595 process()->responsivenessTimer()->start();
598 void WebPageProxy::loadPlainTextString(const String& string)
601 reattachToWebProcess();
603 process()->send(Messages::WebPage::LoadPlainTextString(string), m_pageID);
604 process()->responsivenessTimer()->start();
607 void WebPageProxy::loadWebArchiveData(const WebData* webArchiveData)
610 reattachToWebProcess();
612 process()->send(Messages::WebPage::LoadWebArchiveData(webArchiveData->dataReference()), m_pageID);
613 process()->responsivenessTimer()->start();
617 void WebPageProxy::loadContentsbyMimeType(const WebData* contents, const String& mimeType, const String& encoding, const String& baseURL)
620 reattachToWebProcess();
622 process()->assumeReadAccessToBaseURL(baseURL);
623 #if ENABLE(TIZEN_UNIVERSAL_FILE_READ_ACCESS)
624 SandboxExtension::Handle sandboxExtensionHandleEmail;
625 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), baseURL), sandboxExtensionHandleEmail);
626 if (createdExtension)
627 process()->willAcquireUniversalFileReadSandboxExtension();
629 process()->send(Messages::WebPage::LoadContentsbyMimeType(contents->dataReference(), mimeType, encoding, baseURL), m_pageID);
630 process()->responsivenessTimer()->start();
634 void WebPageProxy::stopLoading()
639 process()->send(Messages::WebPage::StopLoading(), m_pageID);
640 process()->responsivenessTimer()->start();
643 void WebPageProxy::reload(bool reloadFromOrigin)
645 SandboxExtension::Handle sandboxExtensionHandle;
647 if (m_backForwardList->currentItem()) {
648 String url = m_backForwardList->currentItem()->url();
649 setPendingAPIRequestURL(url);
651 // We may not have an extension yet if back/forward list was reinstated after a WebProcess crash or a browser relaunch
652 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), url), sandboxExtensionHandle);
653 if (createdExtension)
654 process()->willAcquireUniversalFileReadSandboxExtension();
658 reattachToWebProcessWithItem(m_backForwardList->currentItem());
662 process()->send(Messages::WebPage::Reload(reloadFromOrigin, sandboxExtensionHandle), m_pageID);
663 process()->responsivenessTimer()->start();
666 void WebPageProxy::goForward()
668 if (isValid() && !canGoForward())
671 WebBackForwardListItem* forwardItem = m_backForwardList->forwardItem();
675 setPendingAPIRequestURL(forwardItem->url());
678 reattachToWebProcessWithItem(forwardItem);
682 process()->send(Messages::WebPage::GoForward(forwardItem->itemID()), m_pageID);
683 process()->responsivenessTimer()->start();
686 bool WebPageProxy::canGoForward() const
688 return m_backForwardList->forwardItem();
691 void WebPageProxy::goBack()
693 if (isValid() && !canGoBack())
696 WebBackForwardListItem* backItem = m_backForwardList->backItem();
700 setPendingAPIRequestURL(backItem->url());
703 reattachToWebProcessWithItem(backItem);
707 process()->send(Messages::WebPage::GoBack(backItem->itemID()), m_pageID);
708 process()->responsivenessTimer()->start();
711 bool WebPageProxy::canGoBack() const
713 return m_backForwardList->backItem();
716 void WebPageProxy::goToBackForwardItem(WebBackForwardListItem* item)
719 reattachToWebProcessWithItem(item);
723 setPendingAPIRequestURL(item->url());
725 process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
726 process()->responsivenessTimer()->start();
729 void WebPageProxy::tryRestoreScrollPosition()
734 process()->send(Messages::WebPage::TryRestoreScrollPosition(), m_pageID);
737 void WebPageProxy::didChangeBackForwardList(WebBackForwardListItem* added, Vector<RefPtr<APIObject> >* removed)
739 m_loaderClient.didChangeBackForwardList(this, added, removed);
742 void WebPageProxy::shouldGoToBackForwardListItem(uint64_t itemID, bool& shouldGoToBackForwardItem)
744 WebBackForwardListItem* item = process()->webBackForwardItem(itemID);
745 shouldGoToBackForwardItem = item && m_loaderClient.shouldGoToBackForwardListItem(this, item);
748 void WebPageProxy::willGoToBackForwardListItem(uint64_t itemID, CoreIPC::ArgumentDecoder* arguments)
750 RefPtr<APIObject> userData;
751 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
752 if (!arguments->decode(messageDecoder))
755 if (WebBackForwardListItem* item = process()->webBackForwardItem(itemID))
756 m_loaderClient.willGoToBackForwardListItem(this, item, userData.get());
759 String WebPageProxy::activeURL() const
761 // If there is a currently pending url, it is the active URL,
762 // even when there's no main frame yet, as it might be the
763 // first API request.
764 if (!m_pendingAPIRequestURL.isNull())
765 return m_pendingAPIRequestURL;
770 if (!m_mainFrame->unreachableURL().isEmpty())
771 return m_mainFrame->unreachableURL();
773 switch (m_mainFrame->loadState()) {
774 case WebFrameProxy::LoadStateProvisional:
775 return m_mainFrame->provisionalURL();
776 case WebFrameProxy::LoadStateCommitted:
777 case WebFrameProxy::LoadStateFinished:
778 return m_mainFrame->url();
781 ASSERT_NOT_REACHED();
785 String WebPageProxy::provisionalURL() const
789 return m_mainFrame->provisionalURL();
792 String WebPageProxy::committedURL() const
797 return m_mainFrame->url();
800 bool WebPageProxy::canShowMIMEType(const String& mimeType) const
802 if (MIMETypeRegistry::canShowMIMEType(mimeType))
805 String newMimeType = mimeType;
806 PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL());
807 if (!plugin.path.isNull() && m_pageGroup->preferences()->pluginsEnabled())
813 void WebPageProxy::setDrawsBackground(bool drawsBackground)
815 if (m_drawsBackground == drawsBackground)
818 m_drawsBackground = drawsBackground;
821 process()->send(Messages::WebPage::SetDrawsBackground(drawsBackground), m_pageID);
824 void WebPageProxy::setDrawsTransparentBackground(bool drawsTransparentBackground)
826 if (m_drawsTransparentBackground == drawsTransparentBackground)
829 m_drawsTransparentBackground = drawsTransparentBackground;
832 process()->send(Messages::WebPage::SetDrawsTransparentBackground(drawsTransparentBackground), m_pageID);
835 void WebPageProxy::viewWillStartLiveResize()
839 process()->send(Messages::WebPage::ViewWillStartLiveResize(), m_pageID);
842 void WebPageProxy::viewWillEndLiveResize()
846 process()->send(Messages::WebPage::ViewWillEndLiveResize(), m_pageID);
849 void WebPageProxy::setViewNeedsDisplay(const IntRect& rect)
851 m_pageClient->setViewNeedsDisplay(rect);
854 void WebPageProxy::displayView()
856 m_pageClient->displayView();
859 void WebPageProxy::scrollView(const IntRect& scrollRect, const IntSize& scrollOffset)
861 m_pageClient->scrollView(scrollRect, scrollOffset);
864 void WebPageProxy::viewStateDidChange(ViewStateFlags flags)
869 if (flags & ViewIsFocused)
870 process()->send(Messages::WebPage::SetFocused(m_pageClient->isViewFocused()), m_pageID);
872 if (flags & ViewWindowIsActive)
873 process()->send(Messages::WebPage::SetActive(m_pageClient->isViewWindowActive()), m_pageID);
875 if (flags & ViewIsVisible) {
876 bool isVisible = m_pageClient->isViewVisible();
877 if (isVisible != m_isVisible) {
878 m_isVisible = isVisible;
879 m_drawingArea->visibilityDidChange();
882 // If we've started the responsiveness timer as part of telling the web process to update the backing store
883 // state, it might not send back a reply (since it won't paint anything if the web page is hidden) so we
884 // stop the unresponsiveness timer here.
885 process()->responsivenessTimer()->stop();
890 if (flags & ViewIsInWindow) {
891 bool isInWindow = m_pageClient->isViewInWindow();
892 if (m_isInWindow != isInWindow) {
893 m_isInWindow = isInWindow;
894 process()->send(Messages::WebPage::SetIsInWindow(isInWindow), m_pageID);
898 LayerHostingMode layerHostingMode = m_pageClient->viewLayerHostingMode();
899 if (m_layerHostingMode != layerHostingMode) {
900 m_layerHostingMode = layerHostingMode;
901 m_drawingArea->layerHostingModeDidChange();
906 #if ENABLE(PAGE_VISIBILITY_API)
907 PageVisibilityState visibilityState = PageVisibilityStateHidden;
909 if (m_pageClient->isViewVisible())
910 visibilityState = PageVisibilityStateVisible;
912 if (visibilityState != m_visibilityState) {
913 m_visibilityState = visibilityState;
914 process()->send(Messages::WebPage::SetVisibilityState(visibilityState, false), m_pageID);
918 updateBackingStoreDiscardableState();
921 IntSize WebPageProxy::viewSize() const
923 return m_pageClient->viewSize();
926 void WebPageProxy::setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent& keyboardEvent)
930 process()->send(Messages::WebPage::SetInitialFocus(forward, isKeyboardEventValid, keyboardEvent), m_pageID);
933 void WebPageProxy::setWindowResizerSize(const IntSize& windowResizerSize)
937 process()->send(Messages::WebPage::SetWindowResizerSize(windowResizerSize), m_pageID);
940 void WebPageProxy::clearSelection()
944 process()->send(Messages::WebPage::ClearSelection(), m_pageID);
947 void WebPageProxy::validateCommand(const String& commandName, PassRefPtr<ValidateCommandCallback> callback)
950 callback->invalidate();
954 uint64_t callbackID = callback->callbackID();
955 m_validateCommandCallbacks.set(callbackID, callback.get());
956 process()->send(Messages::WebPage::ValidateCommand(commandName, callbackID), m_pageID);
959 void WebPageProxy::setMaintainsInactiveSelection(bool newValue)
961 m_maintainsInactiveSelection = newValue;
964 void WebPageProxy::executeEditCommand(const String& commandName)
969 DEFINE_STATIC_LOCAL(String, ignoreSpellingCommandName, ("ignoreSpelling"));
970 if (commandName == ignoreSpellingCommandName)
971 ++m_pendingLearnOrIgnoreWordMessageCount;
973 process()->send(Messages::WebPage::ExecuteEditCommand(commandName), m_pageID);
976 #if USE(TILED_BACKING_STORE)
977 void WebPageProxy::setViewportSize(const IntSize& size)
982 process()->send(Messages::WebPage::SetViewportSize(size), m_pageID);
986 #if ENABLE(DRAG_SUPPORT)
987 void WebPageProxy::dragEntered(DragData* dragData, const String& dragStorageName)
989 SandboxExtension::Handle sandboxExtensionHandle;
990 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
991 performDragControllerAction(DragControllerActionEntered, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
994 void WebPageProxy::dragUpdated(DragData* dragData, const String& dragStorageName)
996 SandboxExtension::Handle sandboxExtensionHandle;
997 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
998 performDragControllerAction(DragControllerActionUpdated, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
1001 void WebPageProxy::dragExited(DragData* dragData, const String& dragStorageName)
1003 SandboxExtension::Handle sandboxExtensionHandle;
1004 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
1005 performDragControllerAction(DragControllerActionExited, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
1008 #if ENABLE(TIZEN_DRAG_SUPPORT)
1009 void WebPageProxy::performDrag(DragData* dragData, const String& dragStorageName)
1011 void WebPageProxy::performDrag(DragData* dragData, const String& dragStorageName, const SandboxExtension::Handle& sandboxExtensionHandle, const SandboxExtension::HandleArray& sandboxExtensionsForUpload)
1014 #if ENABLE(TIZEN_DRAG_SUPPORT)
1015 TIZEN_LOGI("dragData (%p)", dragData);
1016 SandboxExtension::Handle sandboxExtensionHandle;
1017 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
1018 performDragControllerAction(DragControllerActionPerformDrag, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
1020 performDragControllerAction(DragControllerActionPerformDrag, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionsForUpload);
1024 void WebPageProxy::performDragControllerAction(DragControllerAction action, DragData* dragData, const String& dragStorageName, const SandboxExtension::Handle& sandboxExtensionHandle, const SandboxExtension::HandleArray& sandboxExtensionsForUpload)
1029 // FIXME: We should pass the drag data map only on DragEnter.
1030 process()->send(Messages::WebPage::PerformDragControllerAction(action, dragData->clientPosition(), dragData->globalPosition(),
1031 dragData->draggingSourceOperationMask(), dragData->dragDataMap(), dragData->flags()), m_pageID);
1032 #elif PLATFORM(QT) || PLATFORM(GTK) || ENABLE(TIZEN_DRAG_SUPPORT)
1033 process()->send(Messages::WebPage::PerformDragControllerAction(action, *dragData), m_pageID);
1035 process()->send(Messages::WebPage::PerformDragControllerAction(action, dragData->clientPosition(), dragData->globalPosition(), dragData->draggingSourceOperationMask(), dragStorageName, dragData->flags(), sandboxExtensionHandle, sandboxExtensionsForUpload), m_pageID);
1039 void WebPageProxy::didPerformDragControllerAction(WebCore::DragSession dragSession)
1041 m_currentDragSession = dragSession;
1044 #if PLATFORM(QT) || PLATFORM(GTK) || ENABLE(TIZEN_DRAG_SUPPORT)
1045 void WebPageProxy::startDrag(const DragData& dragData, const ShareableBitmap::Handle& dragImageHandle)
1047 TIZEN_LOGI("dragData (%p)", dragData);
1048 RefPtr<ShareableBitmap> dragImage = 0;
1049 if (!dragImageHandle.isNull()) {
1050 dragImage = ShareableBitmap::create(dragImageHandle);
1055 m_pageClient->startDrag(dragData, dragImage.release());
1059 void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& globalPosition, uint64_t operation)
1061 TIZEN_LOGI("clientPosition (%p)", clientPosition);
1064 process()->send(Messages::WebPage::DragEnded(clientPosition, globalPosition, operation), m_pageID);
1066 #endif // ENABLE(DRAG_SUPPORT)
1068 void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event)
1073 // NOTE: This does not start the responsiveness timer because mouse move should not indicate interaction.
1074 if (event.type() != WebEvent::MouseMove)
1075 process()->responsivenessTimer()->start();
1077 if (m_processingMouseMoveEvent) {
1078 m_nextMouseMoveEvent = adoptPtr(new NativeWebMouseEvent(event));
1082 m_processingMouseMoveEvent = true;
1085 // <https://bugs.webkit.org/show_bug.cgi?id=57904> We need to keep track of the mouse down event in the case where we
1086 // display a popup menu for select elements. When the user changes the selected item,
1087 // we fake a mouse up event by using this stored down event. This event gets cleared
1088 // when the mouse up message is received from WebProcess.
1089 if (event.type() == WebEvent::MouseDown)
1090 m_currentlyProcessedMouseDownEvent = adoptPtr(new NativeWebMouseEvent(event));
1092 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
1093 // We have to hide text-selection's context menu when other area is clicked.
1094 // In case of normal context menu, it is hided by elm_ctxpopup's logic.
1095 if (event.type() == WebEvent::MouseDown)
1099 if (m_shouldSendEventsSynchronously) {
1100 bool handled = false;
1101 process()->sendSync(Messages::WebPage::MouseEventSyncForTesting(event), Messages::WebPage::MouseEventSyncForTesting::Reply(handled), m_pageID);
1102 didReceiveEvent(event.type(), handled);
1104 process()->send(Messages::WebPage::MouseEvent(event), m_pageID);
1107 #if MERGE_WHEEL_EVENTS
1108 static bool canCoalesce(const WebWheelEvent& a, const WebWheelEvent& b)
1110 if (a.position() != b.position())
1112 if (a.globalPosition() != b.globalPosition())
1114 if (a.modifiers() != b.modifiers())
1116 if (a.granularity() != b.granularity())
1119 if (a.phase() != b.phase())
1121 if (a.momentumPhase() != b.momentumPhase())
1123 if (a.hasPreciseScrollingDeltas() != b.hasPreciseScrollingDeltas())
1130 static WebWheelEvent coalesce(const WebWheelEvent& a, const WebWheelEvent& b)
1132 ASSERT(canCoalesce(a, b));
1134 FloatSize mergedDelta = a.delta() + b.delta();
1135 FloatSize mergedWheelTicks = a.wheelTicks() + b.wheelTicks();
1138 FloatSize mergedUnacceleratedScrollingDelta = a.unacceleratedScrollingDelta() + b.unacceleratedScrollingDelta();
1140 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());
1142 return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.modifiers(), b.timestamp());
1145 #endif // MERGE_WHEEL_EVENTS
1147 static WebWheelEvent coalescedWheelEvent(Deque<NativeWebWheelEvent>& queue, Vector<NativeWebWheelEvent>& coalescedEvents)
1149 ASSERT(!queue.isEmpty());
1150 ASSERT(coalescedEvents.isEmpty());
1152 #if MERGE_WHEEL_EVENTS
1153 NativeWebWheelEvent firstEvent = queue.takeFirst();
1154 coalescedEvents.append(firstEvent);
1156 WebWheelEvent event = firstEvent;
1157 while (!queue.isEmpty() && canCoalesce(event, queue.first())) {
1158 NativeWebWheelEvent firstEvent = queue.takeFirst();
1159 coalescedEvents.append(firstEvent);
1160 event = coalesce(event, firstEvent);
1165 while (!queue.isEmpty())
1166 coalescedEvents.append(queue.takeFirst());
1167 return coalescedEvents.last();
1171 void WebPageProxy::handleWheelEvent(const NativeWebWheelEvent& event)
1176 if (!m_currentlyProcessedWheelEvents.isEmpty()) {
1177 m_wheelEventQueue.append(event);
1178 if (m_wheelEventQueue.size() < wheelEventQueueSizeThreshold)
1180 // The queue has too many wheel events, so push a new event.
1183 if (!m_wheelEventQueue.isEmpty()) {
1184 processNextQueuedWheelEvent();
1188 OwnPtr<Vector<NativeWebWheelEvent> > coalescedWheelEvent = adoptPtr(new Vector<NativeWebWheelEvent>);
1189 coalescedWheelEvent->append(event);
1190 m_currentlyProcessedWheelEvents.append(coalescedWheelEvent.release());
1191 sendWheelEvent(event);
1194 void WebPageProxy::processNextQueuedWheelEvent()
1196 OwnPtr<Vector<NativeWebWheelEvent> > nextCoalescedEvent = adoptPtr(new Vector<NativeWebWheelEvent>);
1197 WebWheelEvent nextWheelEvent = coalescedWheelEvent(m_wheelEventQueue, *nextCoalescedEvent.get());
1198 m_currentlyProcessedWheelEvents.append(nextCoalescedEvent.release());
1199 sendWheelEvent(nextWheelEvent);
1202 void WebPageProxy::sendWheelEvent(const WebWheelEvent& event)
1204 process()->responsivenessTimer()->start();
1206 if (m_shouldSendEventsSynchronously) {
1207 bool handled = false;
1208 process()->sendSync(Messages::WebPage::WheelEventSyncForTesting(event), Messages::WebPage::WheelEventSyncForTesting::Reply(handled), m_pageID);
1209 didReceiveEvent(event.type(), handled);
1213 process()->send(Messages::EventDispatcher::WheelEvent(m_pageID, event, canGoBack(), canGoForward()), 0);
1216 void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event)
1221 LOG(KeyHandling, "WebPageProxy::handleKeyboardEvent: %s", webKeyboardEventTypeString(event.type()));
1223 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1224 if (!isWaitingForJavaScriptPopupReply()) {
1225 m_keyEventQueue.append(event);
1227 process()->responsivenessTimer()->start();
1228 if (m_shouldSendEventsSynchronously) {
1229 bool handled = false;
1230 process()->sendSync(Messages::WebPage::KeyEventSyncForTesting(event), Messages::WebPage::KeyEventSyncForTesting::Reply(handled), m_pageID);
1231 didReceiveEvent(event.type(), handled);
1233 process()->send(Messages::WebPage::KeyEvent(event), m_pageID);
1235 if (m_keyEventQueue.isEmpty()) {
1236 bool handled = false;
1237 m_pageClient->doneWithKeyEvent(event, handled);
1239 QueuedUIEvents<NativeWebKeyboardEvent>& lastEvent = m_keyEventQueue.last();
1240 lastEvent.deferredEvents.append(event);
1244 m_keyEventQueue.append(event);
1246 process()->responsivenessTimer()->start();
1247 if (m_shouldSendEventsSynchronously) {
1248 bool handled = false;
1249 process()->sendSync(Messages::WebPage::KeyEventSyncForTesting(event), Messages::WebPage::KeyEventSyncForTesting::Reply(handled), m_pageID);
1250 didReceiveEvent(event.type(), handled);
1251 } else if (m_keyEventQueue.size() == 1) // Otherwise, sent from DidReceiveEvent message handler.
1252 process()->send(Messages::WebPage::KeyEvent(event), m_pageID);
1256 #if ENABLE(GESTURE_EVENTS)
1257 void WebPageProxy::handleGestureEvent(const WebGestureEvent& event)
1262 #if ENABLE(TIZEN_ISF_PORT)
1263 if (event.type() == WebEvent::GestureSingleTap) {
1264 InputMethodContextEfl* inputMethodContext = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->inputMethodContext();
1265 if (inputMethodContext)
1266 inputMethodContext->resetIMFContext();
1270 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1271 if (!isWaitingForJavaScriptPopupReply()) {
1272 m_gestureEventQueue.append(event);
1274 process()->responsivenessTimer()->start();
1275 process()->send(Messages::EventDispatcher::GestureEvent(m_pageID, event), 0);
1277 if (m_gestureEventQueue.isEmpty()) {
1278 bool isEventHandled = false;
1279 m_pageClient->doneWithGestureEvent(event, isEventHandled);
1281 QueuedUIEvents<WebGestureEvent>& lastEvent = m_gestureEventQueue.last();
1282 lastEvent.deferredEvents.append(event);
1286 m_gestureEventQueue.append(event);
1288 process()->responsivenessTimer()->start();
1289 process()->send(Messages::EventDispatcher::GestureEvent(m_pageID, event), 0);
1294 #if ENABLE(TOUCH_EVENTS)
1296 void WebPageProxy::handlePotentialActivation(const IntPoint& touchPoint, const IntSize& touchArea)
1298 process()->send(Messages::WebPage::HighlightPotentialActivation(touchPoint, touchArea), m_pageID);
1302 void WebPageProxy::handleTouchEvent(const NativeWebTouchEvent& event)
1304 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
1305 if (!isValid() || isContentSuspendedByInspector())
1311 // If the page is suspended, which should be the case during panning, pinching
1312 // and animation on the page itself (kinetic scrolling, tap to zoom) etc, then
1313 // we do not send any of the events to the page even if is has listeners.
1314 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1315 if (m_needTouchEvents && !m_isPageSuspended && !isWaitingForJavaScriptPopupReply()) {
1317 if (m_needTouchEvents && !m_isPageSuspended) {
1320 // Do not send the TouchMove event if last TouchMove is not processed yet.
1321 // TouchMove event will be sent too many times without below codes,
1322 // and it will affect Web Applications' performance.
1323 if (event.type() == WebEvent::TouchMove
1324 && !m_touchEventQueue.isEmpty()
1325 && m_touchEventQueue.last().forwardedEvent.type() == event.type())
1328 m_touchEventQueue.append(event);
1329 process()->responsivenessTimer()->start();
1330 if (m_shouldSendEventsSynchronously) {
1331 bool handled = false;
1332 process()->sendSync(Messages::WebPage::TouchEventSyncForTesting(event), Messages::WebPage::TouchEventSyncForTesting::Reply(handled), m_pageID);
1333 didReceiveEvent(event.type(), handled);
1335 process()->send(Messages::WebPage::TouchEvent(event), m_pageID);
1337 if (m_touchEventQueue.isEmpty()) {
1338 bool isEventHandled = false;
1339 m_pageClient->doneWithTouchEvent(event, isEventHandled);
1341 // We attach the incoming events to the newest queued event so that all
1342 // the events are delivered in the correct order when the event is dequed.
1343 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1344 QueuedUIEvents<NativeWebTouchEvent>& lastEvent = m_touchEventQueue.last();
1345 lastEvent.deferredEvents.append(event);
1347 QueuedTouchEvents& lastEvent = m_touchEventQueue.last();
1348 lastEvent.deferredTouchEvents.append(event);
1355 #if ENABLE(SCREEN_ORIENTATION_SUPPORT) && ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT)
1356 void WebPageProxy::lockOrientation(int willLockOrientation, bool& result)
1358 result = m_pageClient->lockOrientation(willLockOrientation);
1360 void WebPageProxy::unlockOrientation()
1362 m_pageClient->unlockOrientation();
1366 void WebPageProxy::scrollBy(ScrollDirection direction, ScrollGranularity granularity)
1371 process()->send(Messages::WebPage::ScrollBy(direction, granularity), m_pageID);
1374 void WebPageProxy::centerSelectionInVisibleArea()
1379 process()->send(Messages::WebPage::CenterSelectionInVisibleArea(), m_pageID);
1382 #if ENABLE(TIZEN_DOWNLOAD_ATTRIBUTE)
1383 void WebPageProxy::startDownload(const ResourceRequest& request, const String& /*suggestedName*/)
1385 // FIXME: suggestedName need to be passed to provide a suggested destination file name
1386 m_process->context()->download(this, request);
1390 void WebPageProxy::receivedPolicyDecision(PolicyAction action, WebFrameProxy* frame, uint64_t listenerID)
1395 if (action == PolicyIgnore)
1396 clearPendingAPIRequestURL();
1398 uint64_t downloadID = 0;
1399 if (action == PolicyDownload) {
1400 // Create a download proxy.
1401 DownloadProxy* download = m_process->context()->createDownloadProxy();
1402 downloadID = download->downloadID();
1403 #if PLATFORM(QT) || PLATFORM(EFL)
1404 // Our design does not suppport downloads without a WebPage.
1405 handleDownloadRequest(download);
1409 // If we received a policy decision while in decidePolicyForResponse the decision will
1410 // be sent back to the web process by decidePolicyForResponse.
1411 if (m_inDecidePolicyForResponse) {
1412 m_syncMimeTypePolicyActionIsValid = true;
1413 m_syncMimeTypePolicyAction = action;
1414 m_syncMimeTypePolicyDownloadID = downloadID;
1418 // If we received a policy decision while in decidePolicyForNavigationAction the decision will
1419 // be sent back to the web process by decidePolicyForNavigationAction.
1420 if (m_inDecidePolicyForNavigationAction) {
1421 m_syncNavigationActionPolicyActionIsValid = true;
1422 m_syncNavigationActionPolicyAction = action;
1423 m_syncNavigationActionPolicyDownloadID = downloadID;
1427 process()->send(Messages::WebPage::DidReceivePolicyDecision(frame->frameID(), listenerID, action, downloadID), m_pageID);
1430 String WebPageProxy::pageTitle() const
1432 // Return the null string if there is no main frame (e.g. nothing has been loaded in the page yet, WebProcess has
1433 // crashed, page has been closed).
1437 return m_mainFrame->title();
1440 void WebPageProxy::setUserAgent(const String& userAgent)
1442 if (m_userAgent == userAgent)
1444 m_userAgent = userAgent;
1448 process()->send(Messages::WebPage::SetUserAgent(m_userAgent), m_pageID);
1451 void WebPageProxy::setApplicationNameForUserAgent(const String& applicationName)
1453 if (m_applicationNameForUserAgent == applicationName)
1456 m_applicationNameForUserAgent = applicationName;
1457 if (!m_customUserAgent.isEmpty())
1460 setUserAgent(standardUserAgent(m_applicationNameForUserAgent));
1463 void WebPageProxy::setCustomUserAgent(const String& customUserAgent)
1465 if (m_customUserAgent == customUserAgent)
1468 m_customUserAgent = customUserAgent;
1470 if (m_customUserAgent.isEmpty()) {
1471 setUserAgent(standardUserAgent(m_applicationNameForUserAgent));
1475 setUserAgent(m_customUserAgent);
1478 void WebPageProxy::resumeActiveDOMObjectsAndAnimations()
1480 if (!isValid() || !m_isPageSuspended)
1483 m_isPageSuspended = false;
1485 process()->send(Messages::WebPage::ResumeActiveDOMObjectsAndAnimations(), m_pageID);
1488 void WebPageProxy::suspendActiveDOMObjectsAndAnimations()
1490 if (!isValid() || m_isPageSuspended)
1493 m_isPageSuspended = true;
1495 process()->send(Messages::WebPage::SuspendActiveDOMObjectsAndAnimations(), m_pageID);
1498 bool WebPageProxy::supportsTextEncoding() const
1500 return !m_mainFrameHasCustomRepresentation && m_mainFrame && !m_mainFrame->isDisplayingStandaloneImageDocument();
1503 void WebPageProxy::setCustomTextEncodingName(const String& encodingName)
1505 if (m_customTextEncodingName == encodingName)
1507 m_customTextEncodingName = encodingName;
1511 process()->send(Messages::WebPage::SetCustomTextEncodingName(encodingName), m_pageID);
1514 void WebPageProxy::terminateProcess()
1516 // NOTE: This uses a check of m_isValid rather than calling isValid() since
1517 // we want this to run even for pages being closed or that already closed.
1521 process()->terminate();
1524 #if !USE(CF) || defined(BUILDING_QT__)
1525 PassRefPtr<WebData> WebPageProxy::sessionStateData(WebPageProxySessionStateFilterCallback, void* context) const
1527 // FIXME: Return session state data for saving Page state.
1531 void WebPageProxy::restoreFromSessionStateData(WebData*)
1533 // FIXME: Restore the Page from the passed in session state data.
1537 bool WebPageProxy::supportsTextZoom() const
1539 if (m_mainFrameHasCustomRepresentation)
1542 // FIXME: This should also return false for standalone media and plug-in documents.
1543 if (!m_mainFrame || m_mainFrame->isDisplayingStandaloneImageDocument())
1549 void WebPageProxy::setTextZoomFactor(double zoomFactor)
1554 if (m_mainFrameHasCustomRepresentation)
1557 if (m_textZoomFactor == zoomFactor)
1560 m_textZoomFactor = zoomFactor;
1561 process()->send(Messages::WebPage::SetTextZoomFactor(m_textZoomFactor), m_pageID);
1564 double WebPageProxy::pageZoomFactor() const
1566 return m_mainFrameHasCustomRepresentation ? m_pageClient->customRepresentationZoomFactor() : m_pageZoomFactor;
1569 void WebPageProxy::setPageZoomFactor(double zoomFactor)
1574 if (m_mainFrameHasCustomRepresentation) {
1575 m_pageClient->setCustomRepresentationZoomFactor(zoomFactor);
1579 if (m_pageZoomFactor == zoomFactor)
1582 m_pageZoomFactor = zoomFactor;
1583 process()->send(Messages::WebPage::SetPageZoomFactor(m_pageZoomFactor), m_pageID);
1586 void WebPageProxy::setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor)
1591 if (m_mainFrameHasCustomRepresentation) {
1592 m_pageClient->setCustomRepresentationZoomFactor(pageZoomFactor);
1596 if (m_pageZoomFactor == pageZoomFactor && m_textZoomFactor == textZoomFactor)
1599 m_pageZoomFactor = pageZoomFactor;
1600 m_textZoomFactor = textZoomFactor;
1601 process()->send(Messages::WebPage::SetPageAndTextZoomFactors(m_pageZoomFactor, m_textZoomFactor), m_pageID);
1604 void WebPageProxy::scalePage(double scale, const IntPoint& origin)
1609 process()->send(Messages::WebPage::ScalePage(scale, origin), m_pageID);
1612 void WebPageProxy::setIntrinsicDeviceScaleFactor(float scaleFactor)
1614 if (m_intrinsicDeviceScaleFactor == scaleFactor)
1617 m_intrinsicDeviceScaleFactor = scaleFactor;
1620 m_drawingArea->deviceScaleFactorDidChange();
1623 void WebPageProxy::windowScreenDidChange(PlatformDisplayID displayID)
1628 process()->send(Messages::WebPage::WindowScreenDidChange(displayID), m_pageID);
1631 float WebPageProxy::deviceScaleFactor() const
1633 if (m_customDeviceScaleFactor)
1634 return m_customDeviceScaleFactor;
1635 return m_intrinsicDeviceScaleFactor;
1638 void WebPageProxy::setCustomDeviceScaleFactor(float customScaleFactor)
1643 if (m_customDeviceScaleFactor == customScaleFactor)
1646 float oldScaleFactor = deviceScaleFactor();
1648 m_customDeviceScaleFactor = customScaleFactor;
1650 if (deviceScaleFactor() != oldScaleFactor)
1651 m_drawingArea->deviceScaleFactorDidChange();
1654 void WebPageProxy::setUseFixedLayout(bool fixed)
1659 // This check is fine as the value is initialized in the web
1660 // process as part of the creation parameters.
1661 if (fixed == m_useFixedLayout)
1664 m_useFixedLayout = fixed;
1666 m_fixedLayoutSize = IntSize();
1667 process()->send(Messages::WebPage::SetUseFixedLayout(fixed), m_pageID);
1670 void WebPageProxy::setFixedLayoutSize(const IntSize& size)
1675 if (size == m_fixedLayoutSize)
1678 m_fixedLayoutSize = size;
1679 process()->send(Messages::WebPage::SetFixedLayoutSize(size), m_pageID);
1682 void WebPageProxy::setPaginationMode(WebCore::Page::Pagination::Mode mode)
1684 if (mode == m_paginationMode)
1687 m_paginationMode = mode;
1691 process()->send(Messages::WebPage::SetPaginationMode(mode), m_pageID);
1694 void WebPageProxy::setPaginationBehavesLikeColumns(bool behavesLikeColumns)
1696 if (behavesLikeColumns == m_paginationBehavesLikeColumns)
1699 m_paginationBehavesLikeColumns = behavesLikeColumns;
1703 process()->send(Messages::WebPage::SetPaginationBehavesLikeColumns(behavesLikeColumns), m_pageID);
1706 void WebPageProxy::setPageLength(double pageLength)
1708 if (pageLength == m_pageLength)
1711 m_pageLength = pageLength;
1715 process()->send(Messages::WebPage::SetPageLength(pageLength), m_pageID);
1718 void WebPageProxy::setGapBetweenPages(double gap)
1720 if (gap == m_gapBetweenPages)
1723 m_gapBetweenPages = gap;
1727 process()->send(Messages::WebPage::SetGapBetweenPages(gap), m_pageID);
1730 void WebPageProxy::pageScaleFactorDidChange(double scaleFactor)
1732 m_pageScaleFactor = scaleFactor;
1733 m_pageClient->pageScaleFactorDidChange();
1736 void WebPageProxy::setMemoryCacheClientCallsEnabled(bool memoryCacheClientCallsEnabled)
1741 if (m_areMemoryCacheClientCallsEnabled == memoryCacheClientCallsEnabled)
1744 m_areMemoryCacheClientCallsEnabled = memoryCacheClientCallsEnabled;
1745 process()->send(Messages::WebPage::SetMemoryCacheMessagesEnabled(memoryCacheClientCallsEnabled), m_pageID);
1748 void WebPageProxy::findStringMatches(const String& string, FindOptions options, unsigned maxMatchCount)
1750 if (string.isEmpty()) {
1751 didFindStringMatches(string, Vector<Vector<WebCore::IntRect> > (), 0);
1755 m_process->send(Messages::WebPage::FindStringMatches(string, options, maxMatchCount), m_pageID);
1758 void WebPageProxy::findString(const String& string, FindOptions options, unsigned maxMatchCount)
1760 if (m_mainFrameHasCustomRepresentation)
1761 m_pageClient->findStringInCustomRepresentation(string, options, maxMatchCount);
1763 process()->send(Messages::WebPage::FindString(string, options, maxMatchCount), m_pageID);
1766 void WebPageProxy::getImageForFindMatch(int32_t matchIndex)
1768 m_process->send(Messages::WebPage::GetImageForFindMatch(matchIndex), m_pageID);
1771 void WebPageProxy::selectFindMatch(int32_t matchIndex)
1773 m_process->send(Messages::WebPage::SelectFindMatch(matchIndex), m_pageID);
1776 void WebPageProxy::hideFindUI()
1778 process()->send(Messages::WebPage::HideFindUI(), m_pageID);
1781 void WebPageProxy::countStringMatches(const String& string, FindOptions options, unsigned maxMatchCount)
1783 if (m_mainFrameHasCustomRepresentation) {
1784 m_pageClient->countStringMatchesInCustomRepresentation(string, options, maxMatchCount);
1791 process()->send(Messages::WebPage::CountStringMatches(string, options, maxMatchCount), m_pageID);
1794 void WebPageProxy::runJavaScriptInMainFrame(const String& script, PassRefPtr<ScriptValueCallback> prpCallback)
1796 RefPtr<ScriptValueCallback> callback = prpCallback;
1798 callback->invalidate();
1802 uint64_t callbackID = callback->callbackID();
1803 m_scriptValueCallbacks.set(callbackID, callback.get());
1804 process()->send(Messages::WebPage::RunJavaScriptInMainFrame(script, callbackID), m_pageID);
1807 void WebPageProxy::getRenderTreeExternalRepresentation(PassRefPtr<StringCallback> prpCallback)
1809 RefPtr<StringCallback> callback = prpCallback;
1811 callback->invalidate();
1815 uint64_t callbackID = callback->callbackID();
1816 m_stringCallbacks.set(callbackID, callback.get());
1817 process()->send(Messages::WebPage::GetRenderTreeExternalRepresentation(callbackID), m_pageID);
1820 void WebPageProxy::getSourceForFrame(WebFrameProxy* frame, PassRefPtr<StringCallback> prpCallback)
1822 RefPtr<StringCallback> callback = prpCallback;
1824 callback->invalidate();
1828 uint64_t callbackID = callback->callbackID();
1829 m_loadDependentStringCallbackIDs.add(callbackID);
1830 m_stringCallbacks.set(callbackID, callback.get());
1831 process()->send(Messages::WebPage::GetSourceForFrame(frame->frameID(), callbackID), m_pageID);
1834 #if ENABLE(WEB_INTENTS)
1835 void WebPageProxy::deliverIntentToFrame(WebFrameProxy* frame, WebIntentData* webIntentData)
1840 process()->send(Messages::WebPage::DeliverIntentToFrame(frame->frameID(), webIntentData->store()), m_pageID);
1844 void WebPageProxy::getContentsAsString(PassRefPtr<StringCallback> prpCallback)
1846 RefPtr<StringCallback> callback = prpCallback;
1848 callback->invalidate();
1852 uint64_t callbackID = callback->callbackID();
1853 m_loadDependentStringCallbackIDs.add(callbackID);
1854 m_stringCallbacks.set(callbackID, callback.get());
1855 process()->send(Messages::WebPage::GetContentsAsString(callbackID), m_pageID);
1859 void WebPageProxy::getContentsAsMHTMLData(PassRefPtr<DataCallback> prpCallback, bool useBinaryEncoding)
1861 RefPtr<DataCallback> callback = prpCallback;
1863 callback->invalidate();
1867 uint64_t callbackID = callback->callbackID();
1868 m_dataCallbacks.set(callbackID, callback.get());
1869 process()->send(Messages::WebPage::GetContentsAsMHTMLData(callbackID, useBinaryEncoding), m_pageID);
1873 void WebPageProxy::getSelectionOrContentsAsString(PassRefPtr<StringCallback> prpCallback)
1875 RefPtr<StringCallback> callback = prpCallback;
1877 callback->invalidate();
1881 uint64_t callbackID = callback->callbackID();
1882 m_stringCallbacks.set(callbackID, callback.get());
1883 process()->send(Messages::WebPage::GetSelectionOrContentsAsString(callbackID), m_pageID);
1886 void WebPageProxy::getMainResourceDataOfFrame(WebFrameProxy* frame, PassRefPtr<DataCallback> prpCallback)
1888 RefPtr<DataCallback> callback = prpCallback;
1890 callback->invalidate();
1894 uint64_t callbackID = callback->callbackID();
1895 m_dataCallbacks.set(callbackID, callback.get());
1896 process()->send(Messages::WebPage::GetMainResourceDataOfFrame(frame->frameID(), callbackID), m_pageID);
1899 void WebPageProxy::getResourceDataFromFrame(WebFrameProxy* frame, WebURL* resourceURL, 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::GetResourceDataFromFrame(frame->frameID(), resourceURL->string(), callbackID), m_pageID);
1912 void WebPageProxy::getWebArchiveOfFrame(WebFrameProxy* frame, 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::GetWebArchiveOfFrame(frame->frameID(), callbackID), m_pageID);
1925 void WebPageProxy::forceRepaint(PassRefPtr<VoidCallback> prpCallback)
1927 RefPtr<VoidCallback> callback = prpCallback;
1929 callback->invalidate();
1933 uint64_t callbackID = callback->callbackID();
1934 m_voidCallbacks.set(callbackID, callback.get());
1935 m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
1936 process()->send(Messages::WebPage::ForceRepaint(callbackID), m_pageID);
1939 void WebPageProxy::preferencesDidChange()
1944 #if ENABLE(INSPECTOR_SERVER)
1945 if (m_pageGroup->preferences()->developerExtrasEnabled())
1946 inspector()->enableRemoteInspection();
1949 // FIXME: It probably makes more sense to send individual preference changes.
1950 // However, WebKitTestRunner depends on getting a preference change notification
1951 // even if nothing changed in UI process, so that overrides get removed.
1953 // Preferences need to be updated during synchronous printing to make "print backgrounds" preference work when toggled from a print dialog checkbox.
1954 process()->send(Messages::WebPage::PreferencesDidChange(pageGroup()->preferences()->store()), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
1957 void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
1959 if (messageID.is<CoreIPC::MessageClassDrawingAreaProxy>()) {
1960 m_drawingArea->didReceiveDrawingAreaProxyMessage(connection, messageID, arguments);
1964 #if USE(UI_SIDE_COMPOSITING)
1965 if (messageID.is<CoreIPC::MessageClassLayerTreeCoordinatorProxy>()) {
1966 m_drawingArea->didReceiveLayerTreeCoordinatorProxyMessage(connection, messageID, arguments);
1971 #if ENABLE(INSPECTOR)
1972 if (messageID.is<CoreIPC::MessageClassWebInspectorProxy>()) {
1973 if (WebInspectorProxy* inspector = this->inspector())
1974 inspector->didReceiveWebInspectorProxyMessage(connection, messageID, arguments);
1979 #if ENABLE(FULLSCREEN_API)
1980 if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) {
1981 fullScreenManager()->didReceiveMessage(connection, messageID, arguments);
1986 didReceiveWebPageProxyMessage(connection, messageID, arguments);
1989 void WebPageProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
1991 #if ENABLE(INSPECTOR)
1992 if (messageID.is<CoreIPC::MessageClassWebInspectorProxy>()) {
1993 if (WebInspectorProxy* inspector = this->inspector())
1994 inspector->didReceiveSyncWebInspectorProxyMessage(connection, messageID, arguments, reply);
1999 #if ENABLE(FULLSCREEN_API)
2000 if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) {
2001 fullScreenManager()->didReceiveSyncMessage(connection, messageID, arguments, reply);
2006 // FIXME: Do something with reply.
2007 didReceiveSyncWebPageProxyMessage(connection, messageID, arguments, reply);
2010 void WebPageProxy::didCreateMainFrame(uint64_t frameID)
2012 MESSAGE_CHECK(!m_mainFrame);
2013 MESSAGE_CHECK(process()->canCreateFrame(frameID));
2015 m_mainFrame = WebFrameProxy::create(this, frameID);
2017 // Add the frame to the process wide map.
2018 process()->frameCreated(frameID, m_mainFrame.get());
2021 void WebPageProxy::didCreateSubframe(uint64_t frameID, uint64_t parentFrameID)
2023 MESSAGE_CHECK(m_mainFrame);
2025 WebFrameProxy* parentFrame = process()->webFrame(parentFrameID);
2026 MESSAGE_CHECK(parentFrame);
2027 MESSAGE_CHECK(parentFrame->isDescendantOf(m_mainFrame.get()));
2029 MESSAGE_CHECK(process()->canCreateFrame(frameID));
2031 RefPtr<WebFrameProxy> subFrame = WebFrameProxy::create(this, frameID);
2033 // Add the frame to the process wide map.
2034 process()->frameCreated(frameID, subFrame.get());
2036 // Insert the frame into the frame hierarchy.
2037 parentFrame->appendChild(subFrame.get());
2040 static bool isDisconnectedFrame(WebFrameProxy* frame)
2042 return !frame->page() || !frame->page()->mainFrame() || !frame->isDescendantOf(frame->page()->mainFrame());
2045 void WebPageProxy::didSaveFrameToPageCache(uint64_t frameID)
2047 MESSAGE_CHECK(m_mainFrame);
2049 WebFrameProxy* subframe = process()->webFrame(frameID);
2050 MESSAGE_CHECK(subframe);
2052 if (isDisconnectedFrame(subframe))
2055 MESSAGE_CHECK(subframe->isDescendantOf(m_mainFrame.get()));
2057 subframe->didRemoveFromHierarchy();
2060 void WebPageProxy::didRestoreFrameFromPageCache(uint64_t frameID, uint64_t parentFrameID)
2062 MESSAGE_CHECK(m_mainFrame);
2064 WebFrameProxy* subframe = process()->webFrame(frameID);
2065 MESSAGE_CHECK(subframe);
2066 MESSAGE_CHECK(!subframe->parentFrame());
2067 MESSAGE_CHECK(subframe->page() == m_mainFrame->page());
2069 WebFrameProxy* parentFrame = process()->webFrame(parentFrameID);
2070 MESSAGE_CHECK(parentFrame);
2071 MESSAGE_CHECK(parentFrame->isDescendantOf(m_mainFrame.get()));
2073 // Insert the frame into the frame hierarchy.
2074 parentFrame->appendChild(subframe);
2078 // Always start progress at initialProgressValue. This helps provide feedback as
2079 // soon as a load starts.
2081 static const double initialProgressValue = 0.1;
2083 double WebPageProxy::estimatedProgress() const
2085 if (!pendingAPIRequestURL().isNull())
2086 return initialProgressValue;
2087 return m_estimatedProgress;
2090 void WebPageProxy::didStartProgress()
2092 m_estimatedProgress = initialProgressValue;
2094 m_loaderClient.didStartProgress(this);
2097 void WebPageProxy::didChangeProgress(double value)
2099 m_estimatedProgress = value;
2101 m_loaderClient.didChangeProgress(this);
2104 void WebPageProxy::didFinishProgress()
2106 m_estimatedProgress = 1.0;
2108 m_loaderClient.didFinishProgress(this);
2111 #if ENABLE(WEB_INTENTS_TAG)
2112 void WebPageProxy::registerIntentServiceForFrame(uint64_t frameID, const IntentServiceInfo& serviceInfo, CoreIPC::ArgumentDecoder* arguments)
2114 RefPtr<APIObject> userData;
2115 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2116 if (!arguments->decode(messageDecoder))
2119 WebFrameProxy* frame = process()->webFrame(frameID);
2120 MESSAGE_CHECK(frame);
2122 RefPtr<WebIntentServiceInfo> webIntentServiceInfo = WebIntentServiceInfo::create(serviceInfo);
2123 m_loaderClient.registerIntentServiceForFrame(this, frame, webIntentServiceInfo.get(), userData.get());
2127 void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::ArgumentDecoder* arguments)
2129 clearPendingAPIRequestURL();
2131 RefPtr<APIObject> userData;
2132 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2133 if (!arguments->decode(messageDecoder))
2136 WebFrameProxy* frame = process()->webFrame(frameID);
2137 MESSAGE_CHECK(frame);
2138 MESSAGE_CHECK_URL(url);
2140 frame->setUnreachableURL(unreachableURL);
2142 frame->didStartProvisionalLoad(url);
2143 m_loaderClient.didStartProvisionalLoadForFrame(this, frame, userData.get());
2146 void WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, const String& url, CoreIPC::ArgumentDecoder* arguments)
2148 RefPtr<APIObject> userData;
2149 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2150 if (!arguments->decode(messageDecoder))
2153 WebFrameProxy* frame = process()->webFrame(frameID);
2154 MESSAGE_CHECK(frame);
2155 MESSAGE_CHECK_URL(url);
2157 frame->didReceiveServerRedirectForProvisionalLoad(url);
2159 m_loaderClient.didReceiveServerRedirectForProvisionalLoadForFrame(this, frame, userData.get());
2162 void WebPageProxy::didFailProvisionalLoadForFrame(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
2164 RefPtr<APIObject> userData;
2165 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2166 if (!arguments->decode(messageDecoder))
2169 WebFrameProxy* frame = process()->webFrame(frameID);
2170 MESSAGE_CHECK(frame);
2172 frame->didFailProvisionalLoad();
2174 m_loaderClient.didFailProvisionalLoadWithErrorForFrame(this, frame, error, userData.get());
2177 void WebPageProxy::clearLoadDependentCallbacks()
2179 Vector<uint64_t> callbackIDsCopy;
2180 copyToVector(m_loadDependentStringCallbackIDs, callbackIDsCopy);
2181 m_loadDependentStringCallbackIDs.clear();
2183 for (size_t i = 0; i < callbackIDsCopy.size(); ++i) {
2184 RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackIDsCopy[i]);
2186 callback->invalidate();
2190 void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, const PlatformCertificateInfo& certificateInfo, CoreIPC::ArgumentDecoder* arguments)
2192 RefPtr<APIObject> userData;
2193 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2194 if (!arguments->decode(messageDecoder))
2197 WebFrameProxy* frame = process()->webFrame(frameID);
2198 MESSAGE_CHECK(frame);
2201 // FIXME (bug 59111): didCommitLoadForFrame comes too late when restoring a page from b/f cache, making us disable secure event mode in password fields.
2202 // FIXME (bug 59121): A load going on in one frame shouldn't affect typing in sibling frames.
2203 m_pageClient->resetTextInputState();
2204 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
2205 // FIXME: Should this be moved inside resetTextInputState()?
2206 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
2207 m_pageClient->dismissDictionaryLookupPanel();
2211 clearLoadDependentCallbacks();
2213 frame->didCommitLoad(mimeType, certificateInfo);
2215 if (frame->isMainFrame()) {
2216 m_mainFrameHasCustomRepresentation = frameHasCustomRepresentation;
2218 if (m_mainFrameHasCustomRepresentation) {
2219 // Always assume that the main frame is pinned here, since the custom representation view will handle
2220 // any wheel events and dispatch them to the WKView when necessary.
2221 m_mainFrameIsPinnedToLeftSide = true;
2222 m_mainFrameIsPinnedToRightSide = true;
2224 m_pageClient->didCommitLoadForMainFrame(frameHasCustomRepresentation);
2227 m_loaderClient.didCommitLoadForFrame(this, frame, userData.get());
2230 void WebPageProxy::didFinishDocumentLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2232 RefPtr<APIObject> userData;
2233 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2234 if (!arguments->decode(messageDecoder))
2237 WebFrameProxy* frame = process()->webFrame(frameID);
2238 MESSAGE_CHECK(frame);
2240 m_loaderClient.didFinishDocumentLoadForFrame(this, frame, userData.get());
2243 #if ENABLE(TIZEN_NATIVE_MEMORY_SNAPSHOT)
2244 const char* isMemorySnapshot = getenv("TIZEN_MEMORY_SNAPSHOT");
2246 void WebPageProxy::didFinishLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2248 RefPtr<APIObject> userData;
2249 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2250 if (!arguments->decode(messageDecoder))
2253 WebFrameProxy* frame = process()->webFrame(frameID);
2254 MESSAGE_CHECK(frame);
2256 frame->didFinishLoad();
2258 m_loaderClient.didFinishLoadForFrame(this, frame, userData.get());
2259 #if ENABLE(TIZEN_NATIVE_MEMORY_SNAPSHOT)
2260 if (isMemorySnapshot && isMemorySnapshot[0] != '0')
2261 dumpMemorySnapshot();
2265 void WebPageProxy::didFailLoadForFrame(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
2267 RefPtr<APIObject> userData;
2268 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2269 if (!arguments->decode(messageDecoder))
2272 WebFrameProxy* frame = process()->webFrame(frameID);
2273 MESSAGE_CHECK(frame);
2275 clearLoadDependentCallbacks();
2277 frame->didFailLoad();
2279 m_loaderClient.didFailLoadWithErrorForFrame(this, frame, error, userData.get());
2282 void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t opaqueSameDocumentNavigationType, const String& url, CoreIPC::ArgumentDecoder* arguments)
2284 RefPtr<APIObject> userData;
2285 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2286 if (!arguments->decode(messageDecoder))
2289 WebFrameProxy* frame = process()->webFrame(frameID);
2290 MESSAGE_CHECK(frame);
2291 MESSAGE_CHECK_URL(url);
2293 clearPendingAPIRequestURL();
2294 frame->didSameDocumentNavigation(url);
2296 m_loaderClient.didSameDocumentNavigationForFrame(this, frame, static_cast<SameDocumentNavigationType>(opaqueSameDocumentNavigationType), userData.get());
2299 void WebPageProxy::didReceiveTitleForFrame(uint64_t frameID, const String& title, CoreIPC::ArgumentDecoder* arguments)
2301 RefPtr<APIObject> userData;
2302 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2303 if (!arguments->decode(messageDecoder))
2306 WebFrameProxy* frame = process()->webFrame(frameID);
2307 MESSAGE_CHECK(frame);
2309 frame->didChangeTitle(title);
2311 m_loaderClient.didReceiveTitleForFrame(this, title, frame, userData.get());
2314 void WebPageProxy::didFirstLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2316 RefPtr<APIObject> userData;
2317 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2318 if (!arguments->decode(messageDecoder))
2321 WebFrameProxy* frame = process()->webFrame(frameID);
2322 MESSAGE_CHECK(frame);
2324 m_loaderClient.didFirstLayoutForFrame(this, frame, userData.get());
2327 void WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame(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);
2338 if (frame->isMainFrame())
2339 m_pageClient->didFirstVisuallyNonEmptyLayoutForMainFrame();
2342 m_loaderClient.didFirstVisuallyNonEmptyLayoutForFrame(this, frame, userData.get());
2345 void WebPageProxy::didNewFirstVisuallyNonEmptyLayout(CoreIPC::ArgumentDecoder* arguments)
2347 RefPtr<APIObject> userData;
2348 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2349 if (!arguments->decode(messageDecoder))
2352 m_loaderClient.didNewFirstVisuallyNonEmptyLayout(this, userData.get());
2355 void WebPageProxy::didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2357 RefPtr<APIObject> userData;
2358 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2359 if (!arguments->decode(messageDecoder))
2362 WebFrameProxy* frame = process()->webFrame(frameID);
2363 MESSAGE_CHECK(frame);
2365 frame->didRemoveFromHierarchy();
2367 m_loaderClient.didRemoveFrameFromHierarchy(this, frame, userData.get());
2370 void WebPageProxy::didDisplayInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2372 RefPtr<APIObject> userData;
2373 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2374 if (!arguments->decode(messageDecoder))
2377 WebFrameProxy* frame = process()->webFrame(frameID);
2378 MESSAGE_CHECK(frame);
2380 m_loaderClient.didDisplayInsecureContentForFrame(this, frame, userData.get());
2383 void WebPageProxy::didRunInsecureContentForFrame(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.didRunInsecureContentForFrame(this, frame, userData.get());
2396 void WebPageProxy::didDetectXSSForFrame(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.didDetectXSSForFrame(this, frame, userData.get());
2409 #if ENABLE(WEB_INTENTS)
2410 void WebPageProxy::didReceiveIntentForFrame(uint64_t frameID, const IntentData& intentData, CoreIPC::ArgumentDecoder* arguments)
2412 RefPtr<APIObject> userData;
2413 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2414 if (!arguments->decode(messageDecoder))
2417 WebFrameProxy* frame = process()->webFrame(frameID);
2418 MESSAGE_CHECK(frame);
2420 RefPtr<WebIntentData> webIntentData = WebIntentData::create(intentData);
2421 m_loaderClient.didReceiveIntentForFrame(this, frame, webIntentData.get(), userData.get());
2425 void WebPageProxy::frameDidBecomeFrameSet(uint64_t frameID, bool value)
2427 WebFrameProxy* frame = process()->webFrame(frameID);
2428 MESSAGE_CHECK(frame);
2430 frame->setIsFrameSet(value);
2431 if (frame->isMainFrame())
2432 m_frameSetLargestFrame = value ? m_mainFrame : 0;
2436 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)
2438 RefPtr<APIObject> userData;
2439 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2440 if (!arguments->decode(messageDecoder))
2443 if (request.url() != pendingAPIRequestURL())
2444 clearPendingAPIRequestURL();
2446 WebFrameProxy* frame = process()->webFrame(frameID);
2447 MESSAGE_CHECK(frame);
2448 MESSAGE_CHECK_URL(request.url());
2450 NavigationType navigationType = static_cast<NavigationType>(opaqueNavigationType);
2451 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
2452 WebMouseEvent::Button mouseButton = static_cast<WebMouseEvent::Button>(opaqueMouseButton);
2454 RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
2456 ASSERT(!m_inDecidePolicyForNavigationAction);
2458 m_inDecidePolicyForNavigationAction = true;
2459 m_syncNavigationActionPolicyActionIsValid = false;
2461 if (!m_policyClient.decidePolicyForNavigationAction(this, frame, navigationType, modifiers, mouseButton, request, listener.get(), userData.get()))
2464 m_inDecidePolicyForNavigationAction = false;
2466 // Check if we received a policy decision already. If we did, we can just pass it back.
2467 receivedPolicyAction = m_syncNavigationActionPolicyActionIsValid;
2468 if (m_syncNavigationActionPolicyActionIsValid) {
2469 policyAction = m_syncNavigationActionPolicyAction;
2470 downloadID = m_syncNavigationActionPolicyDownloadID;
2474 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)
2476 RefPtr<APIObject> userData;
2477 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2478 if (!arguments->decode(messageDecoder))
2481 WebFrameProxy* frame = process()->webFrame(frameID);
2482 MESSAGE_CHECK(frame);
2483 MESSAGE_CHECK_URL(request.url());
2485 NavigationType navigationType = static_cast<NavigationType>(opaqueNavigationType);
2486 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
2487 WebMouseEvent::Button mouseButton = static_cast<WebMouseEvent::Button>(opaqueMouseButton);
2489 RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
2490 if (!m_policyClient.decidePolicyForNewWindowAction(this, frame, navigationType, modifiers, mouseButton, request, frameName, listener.get(), userData.get()))
2494 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)
2496 RefPtr<APIObject> userData;
2497 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2498 if (!arguments->decode(messageDecoder))
2501 WebFrameProxy* frame = process()->webFrame(frameID);
2502 MESSAGE_CHECK(frame);
2503 MESSAGE_CHECK_URL(request.url());
2504 MESSAGE_CHECK_URL(response.url());
2506 RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
2508 ASSERT(!m_inDecidePolicyForResponse);
2510 m_inDecidePolicyForResponse = true;
2511 m_syncMimeTypePolicyActionIsValid = false;
2513 if (!m_policyClient.decidePolicyForResponse(this, frame, response, request, listener.get(), userData.get()))
2516 m_inDecidePolicyForResponse = false;
2518 // Check if we received a policy decision already. If we did, we can just pass it back.
2519 receivedPolicyAction = m_syncMimeTypePolicyActionIsValid;
2520 if (m_syncMimeTypePolicyActionIsValid) {
2521 policyAction = m_syncMimeTypePolicyAction;
2522 downloadID = m_syncMimeTypePolicyDownloadID;
2526 void WebPageProxy::unableToImplementPolicy(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
2528 RefPtr<APIObject> userData;
2529 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2530 if (!arguments->decode(messageDecoder))
2533 WebFrameProxy* frame = process()->webFrame(frameID);
2534 MESSAGE_CHECK(frame);
2536 m_policyClient.unableToImplementPolicy(this, frame, error, userData.get());
2541 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
2542 void WebPageProxy::willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const StringPairVector& textFieldValues, bool containsPasswordData, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments)
2544 void WebPageProxy::willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const StringPairVector& textFieldValues, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments)
2547 RefPtr<APIObject> userData;
2548 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2549 if (!arguments->decode(messageDecoder))
2552 WebFrameProxy* frame = process()->webFrame(frameID);
2553 MESSAGE_CHECK(frame);
2555 WebFrameProxy* sourceFrame = process()->webFrame(sourceFrameID);
2556 MESSAGE_CHECK(sourceFrame);
2558 RefPtr<WebFormSubmissionListenerProxy> listener = frame->setUpFormSubmissionListenerProxy(listenerID);
2559 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
2560 if (!m_formClient.willSubmitForm(this, frame, sourceFrame, textFieldValues.stringPairVector(), containsPasswordData, userData.get(), listener.get()))
2562 if (!m_formClient.willSubmitForm(this, frame, sourceFrame, textFieldValues.stringPairVector(), userData.get(), listener.get()))
2564 listener->continueSubmission();
2567 // ResourceLoad Client
2569 void WebPageProxy::didInitiateLoadForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceRequest& request, bool pageIsProvisionallyLoading)
2571 WebFrameProxy* frame = process()->webFrame(frameID);
2572 MESSAGE_CHECK(frame);
2573 MESSAGE_CHECK_URL(request.url());
2575 m_resourceLoadClient.didInitiateLoadForResource(this, frame, resourceIdentifier, request, pageIsProvisionallyLoading);
2578 void WebPageProxy::didSendRequestForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceRequest& request, const ResourceResponse& redirectResponse)
2580 WebFrameProxy* frame = process()->webFrame(frameID);
2581 MESSAGE_CHECK(frame);
2582 MESSAGE_CHECK_URL(request.url());
2584 m_resourceLoadClient.didSendRequestForResource(this, frame, resourceIdentifier, request, redirectResponse);
2587 void WebPageProxy::didReceiveResponseForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceResponse& response)
2589 WebFrameProxy* frame = process()->webFrame(frameID);
2590 MESSAGE_CHECK(frame);
2591 MESSAGE_CHECK_URL(response.url());
2593 m_resourceLoadClient.didReceiveResponseForResource(this, frame, resourceIdentifier, response);
2596 void WebPageProxy::didReceiveContentLengthForResource(uint64_t frameID, uint64_t resourceIdentifier, uint64_t contentLength)
2598 WebFrameProxy* frame = process()->webFrame(frameID);
2599 MESSAGE_CHECK(frame);
2601 m_resourceLoadClient.didReceiveContentLengthForResource(this, frame, resourceIdentifier, contentLength);
2604 void WebPageProxy::didFinishLoadForResource(uint64_t frameID, uint64_t resourceIdentifier)
2606 WebFrameProxy* frame = process()->webFrame(frameID);
2607 MESSAGE_CHECK(frame);
2609 m_resourceLoadClient.didFinishLoadForResource(this, frame, resourceIdentifier);
2612 void WebPageProxy::didFailLoadForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceError& error)
2614 WebFrameProxy* frame = process()->webFrame(frameID);
2615 MESSAGE_CHECK(frame);
2617 m_resourceLoadClient.didFailLoadForResource(this, frame, resourceIdentifier, error);
2622 void WebPageProxy::createNewPage(const ResourceRequest& request, const WindowFeatures& windowFeatures, uint32_t opaqueModifiers, int32_t opaqueMouseButton, uint64_t& newPageID, WebPageCreationParameters& newPageParameters)
2624 RefPtr<WebPageProxy> newPage = m_uiClient.createNewPage(this, request, windowFeatures, static_cast<WebEvent::Modifiers>(opaqueModifiers), static_cast<WebMouseEvent::Button>(opaqueMouseButton));
2626 newPageID = newPage->pageID();
2627 newPageParameters = newPage->creationParameters();
2632 void WebPageProxy::showPage()
2634 m_uiClient.showPage(this);
2637 void WebPageProxy::closePage(bool stopResponsivenessTimer)
2639 if (stopResponsivenessTimer)
2640 process()->responsivenessTimer()->stop();
2642 m_pageClient->clearAllEditCommands();
2643 m_uiClient.close(this);
2646 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2647 bool WebPageProxy::isWaitingForJavaScriptPopupReply()
2649 #if ENABLE(TIZEN_SUPPORT_BEFORE_UNLOAD_CONFIRM_PANEL)
2650 return m_alertReply || m_confirmReply || m_promptReply || m_beforeUnloadConfirmPanelReply;
2652 return m_alertReply || m_confirmReply || m_promptReply;
2658 void WebPageProxy::runJavaScriptAlert(uint64_t frameID, const String& message, PassRefPtr<Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply> reply)
2660 WebFrameProxy* frame = process()->webFrame(frameID);
2661 MESSAGE_CHECK(frame);
2663 // Since runJavaScriptAlert() can spin a nested run loop we need to turn off the responsiveness timer.
2664 process()->responsivenessTimer()->stop();
2666 m_alertReply = reply;
2667 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
2668 m_uiClient.notifyPopupReplyWaitingState(this, true);
2670 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2671 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2673 if (!m_uiClient.runJavaScriptAlert(this, message, frame))
2674 replyJavaScriptAlert();
2677 void WebPageProxy::runJavaScriptConfirm(uint64_t frameID, const String& message, PassRefPtr<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply> reply)
2679 WebFrameProxy* frame = process()->webFrame(frameID);
2680 MESSAGE_CHECK(frame);
2682 // Since runJavaScriptConfirm() can spin a nested run loop we need to turn off the responsiveness timer.
2683 process()->responsivenessTimer()->stop();
2685 m_confirmReply = reply;
2686 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
2687 m_uiClient.notifyPopupReplyWaitingState(this, true);
2689 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2690 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2692 if (!m_uiClient.runJavaScriptConfirm(this, message, frame))
2693 replyJavaScriptConfirm(false);
2696 void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const String& message, const String& defaultValue, PassRefPtr<Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply> reply)
2698 WebFrameProxy* frame = process()->webFrame(frameID);
2699 MESSAGE_CHECK(frame);
2701 // Since runJavaScriptPrompt() can spin a nested run loop we need to turn off the responsiveness timer.
2702 process()->responsivenessTimer()->stop();
2704 m_promptReply = reply;
2705 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
2706 m_uiClient.notifyPopupReplyWaitingState(this, true);
2708 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2709 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2711 if (!m_uiClient.runJavaScriptPrompt(this, message, defaultValue, frame))
2712 replyJavaScriptPrompt(String());
2715 void WebPageProxy::runJavaScriptAlert(uint64_t frameID, const String& message)
2717 WebFrameProxy* frame = process()->webFrame(frameID);
2718 MESSAGE_CHECK(frame);
2720 // Since runJavaScriptAlert() can spin a nested run loop we need to turn off the responsiveness timer.
2721 process()->responsivenessTimer()->stop();
2723 m_uiClient.runJavaScriptAlert(this, message, frame);
2726 void WebPageProxy::runJavaScriptConfirm(uint64_t frameID, const String& message, bool& result)
2728 WebFrameProxy* frame = process()->webFrame(frameID);
2729 MESSAGE_CHECK(frame);
2731 // Since runJavaScriptConfirm() can spin a nested run loop we need to turn off the responsiveness timer.
2732 process()->responsivenessTimer()->stop();
2734 result = m_uiClient.runJavaScriptConfirm(this, message, frame);
2737 void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const String& message, const String& defaultValue, String& result)
2739 WebFrameProxy* frame = process()->webFrame(frameID);
2740 MESSAGE_CHECK(frame);
2742 // Since runJavaScriptPrompt() can spin a nested run loop we need to turn off the responsiveness timer.
2743 process()->responsivenessTimer()->stop();
2745 result = m_uiClient.runJavaScriptPrompt(this, message, defaultValue, frame);
2749 void WebPageProxy::shouldInterruptJavaScript(bool& result)
2751 // Since shouldInterruptJavaScript() can spin a nested run loop we need to turn off the responsiveness timer.
2752 process()->responsivenessTimer()->stop();
2754 result = m_uiClient.shouldInterruptJavaScript(this);
2757 void WebPageProxy::setStatusText(const String& text)
2759 m_uiClient.setStatusText(this, text);
2762 void WebPageProxy::mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t opaqueModifiers, CoreIPC::ArgumentDecoder* arguments)
2764 RefPtr<APIObject> userData;
2765 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2766 if (!arguments->decode(messageDecoder))
2769 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
2771 m_uiClient.mouseDidMoveOverElement(this, hitTestResultData, modifiers, userData.get());
2774 void WebPageProxy::unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& url, const String& pluginsPageURL)
2776 MESSAGE_CHECK_URL(url);
2777 MESSAGE_CHECK_URL(pluginsPageURL);
2779 WKPluginUnavailabilityReason pluginUnavailabilityReason = static_cast<WKPluginUnavailabilityReason>(opaquePluginUnavailabilityReason);
2780 m_uiClient.unavailablePluginButtonClicked(this, pluginUnavailabilityReason, mimeType, url, pluginsPageURL);
2783 void WebPageProxy::setToolbarsAreVisible(bool toolbarsAreVisible)
2785 m_uiClient.setToolbarsAreVisible(this, toolbarsAreVisible);
2788 void WebPageProxy::getToolbarsAreVisible(bool& toolbarsAreVisible)
2790 toolbarsAreVisible = m_uiClient.toolbarsAreVisible(this);
2793 void WebPageProxy::setMenuBarIsVisible(bool menuBarIsVisible)
2795 m_uiClient.setMenuBarIsVisible(this, menuBarIsVisible);
2798 void WebPageProxy::getMenuBarIsVisible(bool& menuBarIsVisible)
2800 menuBarIsVisible = m_uiClient.menuBarIsVisible(this);
2803 void WebPageProxy::setStatusBarIsVisible(bool statusBarIsVisible)
2805 m_uiClient.setStatusBarIsVisible(this, statusBarIsVisible);
2808 void WebPageProxy::getStatusBarIsVisible(bool& statusBarIsVisible)
2810 statusBarIsVisible = m_uiClient.statusBarIsVisible(this);
2813 void WebPageProxy::setIsResizable(bool isResizable)
2815 m_uiClient.setIsResizable(this, isResizable);
2818 void WebPageProxy::getIsResizable(bool& isResizable)
2820 isResizable = m_uiClient.isResizable(this);
2823 void WebPageProxy::setWindowFrame(const FloatRect& newWindowFrame)
2825 m_uiClient.setWindowFrame(this, m_pageClient->convertToDeviceSpace(newWindowFrame));
2828 void WebPageProxy::getWindowFrame(FloatRect& newWindowFrame)
2830 newWindowFrame = m_pageClient->convertToUserSpace(m_uiClient.windowFrame(this));
2833 void WebPageProxy::screenToWindow(const IntPoint& screenPoint, IntPoint& windowPoint)
2835 windowPoint = m_pageClient->screenToWindow(screenPoint);
2838 void WebPageProxy::windowToScreen(const IntRect& viewRect, IntRect& result)
2840 result = m_pageClient->windowToScreen(viewRect);
2843 #if ENABLE(TIZEN_SUPPORT_BEFORE_UNLOAD_CONFIRM_PANEL)
2844 void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, PassRefPtr<Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply> reply)
2846 WebFrameProxy* frame = process()->webFrame(frameID);
2847 MESSAGE_CHECK(frame);
2849 // Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer.
2850 process()->responsivenessTimer()->stop();
2852 m_beforeUnloadConfirmPanelReply = reply;
2853 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2854 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2856 if (!m_uiClient.runBeforeUnloadConfirmPanel(this, message, frame))
2857 replyBeforeUnloadConfirmPanel(false);
2860 void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose)
2862 WebFrameProxy* frame = process()->webFrame(frameID);
2863 MESSAGE_CHECK(frame);
2865 // Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer.
2866 process()->responsivenessTimer()->stop();
2868 shouldClose = m_uiClient.runBeforeUnloadConfirmPanel(this, message, frame);
2872 #if USE(TILED_BACKING_STORE)
2873 void WebPageProxy::pageDidRequestScroll(const IntPoint& point)
2875 m_pageClient->pageDidRequestScroll(point);
2879 void WebPageProxy::didChangeViewportProperties(const ViewportAttributes& attr)
2881 m_pageClient->didChangeViewportProperties(attr);
2884 void WebPageProxy::pageDidScroll()
2886 m_uiClient.pageDidScroll(this);
2887 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
2888 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
2892 void WebPageProxy::runOpenPanel(uint64_t frameID, const FileChooserSettings& settings)
2894 if (m_openPanelResultListener) {
2895 m_openPanelResultListener->invalidate();
2896 m_openPanelResultListener = 0;
2899 WebFrameProxy* frame = process()->webFrame(frameID);
2900 MESSAGE_CHECK(frame);
2902 RefPtr<WebOpenPanelParameters> parameters = WebOpenPanelParameters::create(settings);
2903 m_openPanelResultListener = WebOpenPanelResultListenerProxy::create(this);
2905 // Since runOpenPanel() can spin a nested run loop we need to turn off the responsiveness timer.
2906 process()->responsivenessTimer()->stop();
2908 if (!m_uiClient.runOpenPanel(this, frame, parameters.get(), m_openPanelResultListener.get()))
2909 didCancelForOpenPanel();
2912 void WebPageProxy::printFrame(uint64_t frameID)
2914 ASSERT(!m_isPerformingDOMPrintOperation);
2915 m_isPerformingDOMPrintOperation = true;
2917 WebFrameProxy* frame = process()->webFrame(frameID);
2918 MESSAGE_CHECK(frame);
2920 m_uiClient.printFrame(this, frame);
2922 endPrinting(); // Send a message synchronously while m_isPerformingDOMPrintOperation is still true.
2923 m_isPerformingDOMPrintOperation = false;
2926 void WebPageProxy::printMainFrame()
2928 printFrame(m_mainFrame->frameID());
2931 #if ENABLE(TIZEN_REGISTER_PROTOCOL_HANDLER)
2932 void WebPageProxy::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title)
2934 m_pageClient->registerProtocolHandler(scheme, baseURL, url, title);
2938 #if ENABLE(TIZEN_CUSTOM_SCHEME_HANDLER)
2939 void WebPageProxy::isProtocolHandlerRegistered(const String& scheme, const String& baseURL, const String& url, unsigned int& result)
2941 result = m_pageClient->isProtocolHandlerRegistered(scheme, baseURL, url);
2943 void WebPageProxy::unregisterProtocolHandler(const String& scheme, const String& baseURL, const String& url)
2945 m_pageClient->unregisterProtocolHandler(scheme, baseURL, url);
2949 #if ENABLE(TIZEN_REGISTER_CONTENT_HANDLER)
2950 void WebPageProxy::registerContentHandler(const String& mimeType, const String& baseURL, const String& url, const String& title)
2952 m_pageClient->registerContentHandler(mimeType, baseURL, url, title);
2955 void WebPageProxy::isContentHandlerRegistered(const String& mimeType, const String& baseURL, const String& url, unsigned int& result)
2957 result = m_pageClient->isContentHandlerRegistered(mimeType, baseURL, url);
2960 void WebPageProxy::unregisterContentHandler(const String& mimeType, const String& baseURL, const String& url)
2962 m_pageClient->unregisterContentHandler(mimeType, baseURL, url);
2966 #if ENABLE(TIZEN_SEARCH_PROVIDER)
2967 void WebPageProxy::addSearchProvider(const String& baseURL, const String& engineURL)
2969 m_pageClient->addSearchProvider(baseURL, engineURL);
2972 void WebPageProxy::isSearchProviderInstalled(const String& baseURL, const String& engineURL, uint64_t& result)
2974 result = m_pageClient->isSearchProviderInstalled(baseURL, engineURL);
2978 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
2979 void WebPageProxy::getStandaloneStatus(bool& standalone)
2981 standalone = m_pageClient->getStandaloneStatus();
2984 void WebPageProxy::getWebAppCapable(PassRefPtr<BooleanCallback> prpCallback)
2986 RefPtr<BooleanCallback> callback = prpCallback;
2988 callback->invalidate();
2992 uint64_t callbackID = callback->callbackID();
2993 m_booleanCallbacks.set(callbackID, callback.get());
2994 process()->send(Messages::WebPage::GetWebAppCapable(callbackID), m_pageID);
2997 void WebPageProxy::didGetWebAppCapable(const bool capable, uint64_t callbackID)
2999 RefPtr<BooleanCallback> callback = m_booleanCallbacks.take(callbackID);
3000 m_booleanCallbacks.remove(callbackID);
3001 callback->performCallbackWithReturnValue(WebBoolean::create(capable).leakRef());
3004 void WebPageProxy::getWebAppIconURL(PassRefPtr<StringCallback> prpCallback)
3006 RefPtr<StringCallback> callback = prpCallback;
3008 callback->invalidate();
3012 uint64_t callbackID = callback->callbackID();
3013 m_stringCallbacks.set(callbackID, callback.get());
3014 process()->send(Messages::WebPage::GetWebAppIconURL(callbackID), m_pageID);
3017 void WebPageProxy::didGetWebAppIconURL(const String& iconURL, uint64_t callbackID)
3019 RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackID);
3021 // FIXME: Log error or assert.
3022 // this can validly happen if a load invalidated the callback, though
3026 m_stringCallbacks.remove(callbackID);
3027 callback->performCallbackWithReturnValue(iconURL.impl());
3030 void WebPageProxy::getWebAppIconURLs(PassRefPtr<DictionaryCallback> prpCallback)
3032 RefPtr<DictionaryCallback> callback = prpCallback;
3034 callback->invalidate();
3038 uint64_t callbackID = callback->callbackID();
3039 m_dictionaryCallbacks.set(callbackID, callback.get());
3040 process()->send(Messages::WebPage::GetWebAppIconURLs(callbackID), m_pageID);
3043 void WebPageProxy::didGetWebAppIconURLs(const StringPairVector& iconURLs, uint64_t callbackID)
3045 RefPtr<DictionaryCallback> callback = m_dictionaryCallbacks.take(callbackID);
3046 ImmutableDictionary::MapType iconURLList;
3047 size_t iconURLCount = iconURLs.stringPairVector().size();
3048 for (size_t i = 0; i < iconURLCount; ++i)
3049 iconURLList.set(iconURLs.stringPairVector()[i].first, WebString::create(iconURLs.stringPairVector()[i].second));
3051 callback->performCallbackWithReturnValue(ImmutableDictionary::adopt(iconURLList).get());
3055 void WebPageProxy::setMediaVolume(float volume)
3057 if (volume == m_mediaVolume)
3060 m_mediaVolume = volume;
3065 process()->send(Messages::WebPage::SetMediaVolume(volume), m_pageID);
3069 void WebPageProxy::didChangeContentsSize(const IntSize& size)
3071 m_pageClient->didChangeContentsSize(size);
3074 void WebPageProxy::didFindZoomableArea(const IntPoint& target, const IntRect& area)
3076 m_pageClient->didFindZoomableArea(target, area);
3079 void WebPageProxy::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
3084 process()->send(Messages::WebPage::FindZoomableAreaForPoint(point, area), m_pageID);
3087 void WebPageProxy::didReceiveMessageFromNavigatorQtObject(const String& contents)
3089 m_pageClient->didReceiveMessageFromNavigatorQtObject(contents);
3092 void WebPageProxy::authenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password)
3094 m_pageClient->handleAuthenticationRequiredRequest(hostname, realm, prefilledUsername, username, password);
3097 void WebPageProxy::proxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password)
3099 m_pageClient->handleProxyAuthenticationRequiredRequest(hostname, port, prefilledUsername, username, password);
3102 void WebPageProxy::certificateVerificationRequest(const String& hostname, bool& ignoreErrors)
3104 m_pageClient->handleCertificateVerificationRequest(hostname, ignoreErrors);
3106 #endif // PLATFORM(QT).
3109 void WebPageProxy::didFindZoomableArea(const IntPoint& target, const IntRect& area)
3111 m_pageClient->didFindZoomableArea(target, area);
3114 void WebPageProxy::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
3119 process()->send(Messages::WebPage::FindZoomableAreaForPoint(point, area), m_pageID);
3121 #endif // #if OS(TIZEN)
3123 #if PLATFORM(QT) || PLATFORM(EFL)
3124 void WebPageProxy::handleDownloadRequest(DownloadProxy* download)
3126 m_pageClient->handleDownloadRequest(download);
3128 #endif // PLATFORM(QT) || PLATFORM(EFL)
3130 #if ENABLE(TOUCH_EVENTS)
3131 void WebPageProxy::needTouchEvents(bool needTouchEvents)
3133 m_needTouchEvents = needTouchEvents;
3134 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
3135 // We don't have to ask overflow if we need touch events,
3136 // because we will check overflow in the web process when touch event is processed.
3137 m_askOverflow = !m_needTouchEvents;
3142 #if ENABLE(INPUT_TYPE_COLOR)
3143 void WebPageProxy::showColorChooser(const WebCore::Color& initialColor)
3145 ASSERT(!m_colorChooser);
3147 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3148 if (m_colorPickerResultListener) {
3149 m_colorPickerResultListener->invalidate();
3150 m_colorPickerResultListener = nullptr;
3153 m_colorPickerResultListener = WebColorPickerResultListenerProxy::create(this);
3154 m_colorChooser = WebColorChooserProxy::create(this);
3156 if (m_uiClient.showColorPicker(this, initialColor.serialized(), m_colorPickerResultListener.get()))
3160 m_colorChooser = m_pageClient->createColorChooserProxy(this, initialColor);
3161 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3162 if (!m_colorChooser)
3163 didEndColorChooser();
3167 void WebPageProxy::setColorChooserColor(const WebCore::Color& color)
3169 ASSERT(m_colorChooser);
3171 m_colorChooser->setSelectedColor(color);
3174 void WebPageProxy::endColorChooser()
3176 ASSERT(m_colorChooser);
3178 m_colorChooser->endChooser();
3181 void WebPageProxy::didChooseColor(const WebCore::Color& color)
3186 process()->send(Messages::WebPage::DidChooseColor(color), m_pageID);
3189 void WebPageProxy::didEndColorChooser()
3194 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3195 if (m_colorChooser) {
3196 m_colorChooser->invalidate();
3197 m_colorChooser = nullptr;
3200 ASSERT(m_colorChooser);
3202 m_colorChooser->invalidate();
3203 m_colorChooser = nullptr;
3206 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3207 m_process->send(Messages::WebPage::DidEndColorChooser(), m_pageID);
3209 m_colorPickerResultListener->invalidate();
3210 m_colorPickerResultListener = nullptr;
3212 m_uiClient.hideColorPicker(this);
3214 process()->send(Messages::WebPage::DidEndColorChooser(), m_pageID);
3219 void WebPageProxy::didDraw()
3221 m_uiClient.didDraw(this);
3226 #if ENABLE(INSPECTOR)
3228 WebInspectorProxy* WebPageProxy::inspector()
3230 if (isClosed() || !isValid())
3233 m_inspector = WebInspectorProxy::create(this);
3234 return m_inspector.get();
3239 #if ENABLE(FULLSCREEN_API)
3240 WebFullScreenManagerProxy* WebPageProxy::fullScreenManager()
3242 if (!m_fullScreenManager)
3243 m_fullScreenManager = WebFullScreenManagerProxy::create(this);
3244 return m_fullScreenManager.get();
3250 void WebPageProxy::backForwardAddItem(uint64_t itemID)
3252 m_backForwardList->addItem(process()->webBackForwardItem(itemID));
3255 void WebPageProxy::backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle& sandboxExtensionHandle)
3257 WebBackForwardListItem* item = process()->webBackForwardItem(itemID);
3261 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), item->url()), sandboxExtensionHandle);
3262 if (createdExtension)
3263 process()->willAcquireUniversalFileReadSandboxExtension();
3264 m_backForwardList->goToItem(item);
3267 void WebPageProxy::backForwardItemAtIndex(int32_t index, uint64_t& itemID)
3269 WebBackForwardListItem* item = m_backForwardList->itemAtIndex(index);
3270 itemID = item ? item->itemID() : 0;
3273 void WebPageProxy::backForwardBackListCount(int32_t& count)
3275 count = m_backForwardList->backListCount();
3278 void WebPageProxy::backForwardForwardListCount(int32_t& count)
3280 count = m_backForwardList->forwardListCount();
3283 void WebPageProxy::editorStateChanged(const EditorState& editorState)
3286 bool couldChangeSecureInputState = m_editorState.isInPasswordField != editorState.isInPasswordField || m_editorState.selectionIsNone;
3289 m_editorState = editorState;
3292 m_pageClient->updateTextInputState(couldChangeSecureInputState);
3293 #elif PLATFORM(QT) || PLATFORM(EFL)
3294 m_pageClient->updateTextInputState();
3300 void WebPageProxy::registerEditCommandForUndo(uint64_t commandID, uint32_t editAction)
3302 registerEditCommand(WebEditCommandProxy::create(commandID, static_cast<EditAction>(editAction), this), Undo);
3305 void WebPageProxy::canUndoRedo(uint32_t action, bool& result)
3307 result = m_pageClient->canUndoRedo(static_cast<UndoOrRedo>(action));
3310 void WebPageProxy::executeUndoRedo(uint32_t action, bool& result)
3312 m_pageClient->executeUndoRedo(static_cast<UndoOrRedo>(action));
3316 void WebPageProxy::clearAllEditCommands()
3318 m_pageClient->clearAllEditCommands();
3321 void WebPageProxy::didCountStringMatches(const String& string, uint32_t matchCount)
3323 m_findClient.didCountStringMatches(this, string, matchCount);
3326 void WebPageProxy::didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex)
3328 m_findMatchesClient.didGetImageForMatchResult(this, WebImage::create(ShareableBitmap::create(contentImageHandle)).get(), matchIndex);
3331 void WebPageProxy::setFindIndicator(const FloatRect& selectionRectInWindowCoordinates, const Vector<FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut, bool animate)
3333 RefPtr<FindIndicator> findIndicator = FindIndicator::create(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, contentImageScaleFactor, contentImageHandle);
3334 m_pageClient->setFindIndicator(findIndicator.release(), fadeOut, animate);
3337 void WebPageProxy::didFindString(const String& string, uint32_t matchCount)
3339 m_findClient.didFindString(this, string, matchCount);
3342 void WebPageProxy::didFindStringMatches(const String& string, Vector<Vector<WebCore::IntRect> > matchRects, int32_t firstIndexAfterSelection)
3344 Vector<RefPtr<APIObject> > matches;
3345 matches.reserveInitialCapacity(matchRects.size());
3347 for (size_t i = 0; i < matchRects.size(); ++i) {
3348 const Vector<WebCore::IntRect>& rects = matchRects[i];
3349 size_t numRects = matchRects[i].size();
3350 Vector<RefPtr<APIObject> > apiRects;
3351 apiRects.reserveInitialCapacity(numRects);
3353 for (size_t i = 0; i < numRects; ++i)
3354 apiRects.uncheckedAppend(WebRect::create(toAPI(rects[i])));
3355 matches.uncheckedAppend(ImmutableArray::adopt(apiRects));
3357 m_findMatchesClient.didFindStringMatches(this, string, ImmutableArray::adopt(matches).get(), firstIndexAfterSelection);
3360 void WebPageProxy::didFailToFindString(const String& string)
3362 m_findClient.didFailToFindString(this, string);
3365 void WebPageProxy::valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex)
3367 process()->send(Messages::WebPage::DidChangeSelectedIndexForActivePopupMenu(newSelectedIndex), m_pageID);
3370 void WebPageProxy::setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index)
3372 process()->send(Messages::WebPage::SetTextForActivePopupMenu(index), m_pageID);
3375 NativeWebMouseEvent* WebPageProxy::currentlyProcessedMouseDownEvent()
3377 return m_currentlyProcessedMouseDownEvent.get();
3381 void WebPageProxy::failedToShowPopupMenu()
3383 process()->send(Messages::WebPage::FailedToShowPopupMenu(), m_pageID);
3387 void WebPageProxy::showPopupMenu(const IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData& data)
3389 if (m_activePopupMenu) {
3390 m_activePopupMenu->hidePopupMenu();
3391 m_activePopupMenu->invalidate();
3392 m_activePopupMenu = 0;
3395 m_activePopupMenu = m_pageClient->createPopupMenuProxy(this);
3397 // Since showPopupMenu() can spin a nested run loop we need to turn off the responsiveness timer.
3398 process()->responsivenessTimer()->stop();
3400 RefPtr<WebPopupMenuProxy> protectedActivePopupMenu = m_activePopupMenu;
3402 protectedActivePopupMenu->showPopupMenu(rect, static_cast<TextDirection>(textDirection), m_pageScaleFactor, items, data, selectedIndex);
3404 // 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.
3405 #if !PLATFORM(QT) && !PLATFORM(EFL)
3406 protectedActivePopupMenu->invalidate();
3408 protectedActivePopupMenu = 0;
3411 void WebPageProxy::hidePopupMenu()
3413 if (!m_activePopupMenu)
3416 m_activePopupMenu->hidePopupMenu();
3417 m_activePopupMenu->invalidate();
3418 m_activePopupMenu = 0;
3421 #if ENABLE(TIZEN_WEBKIT2_POPUP_INTERNAL)
3422 void WebPageProxy::updatePopupMenu(uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex)
3424 if (!m_activePopupMenu)
3427 m_activePopupMenu->updatePopupMenu(static_cast<TextDirection>(textDirection), items, selectedIndex);
3431 #if ENABLE(CONTEXT_MENUS)
3432 void WebPageProxy::showContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::ArgumentDecoder* arguments)
3434 internalShowContextMenu(menuLocation, hitTestResultData, proposedItems, arguments);
3436 // No matter the result of internalShowContextMenu, always notify the WebProcess that the menu is hidden so it starts handling mouse events again.
3437 process()->send(Messages::WebPage::ContextMenuHidden(), m_pageID);
3440 void WebPageProxy::internalShowContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::ArgumentDecoder* arguments)
3442 RefPtr<APIObject> userData;
3443 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
3444 if (!arguments->decode(messageDecoder))
3447 m_activeContextMenuHitTestResultData = hitTestResultData;
3449 if (m_activeContextMenu) {
3450 m_activeContextMenu->hideContextMenu();
3451 m_activeContextMenu = 0;
3454 m_activeContextMenu = m_pageClient->createContextMenuProxy(this);
3456 // Since showContextMenu() can spin a nested run loop we need to turn off the responsiveness timer.
3457 process()->responsivenessTimer()->stop();
3459 // Give the PageContextMenuClient one last swipe at changing the menu.
3460 Vector<WebContextMenuItemData> items;
3461 if (!m_contextMenuClient.getContextMenuFromProposedMenu(this, proposedItems, items, hitTestResultData, userData.get()))
3462 m_activeContextMenu->showContextMenu(menuLocation, proposedItems);
3464 m_activeContextMenu->showContextMenu(menuLocation, items);
3466 m_contextMenuClient.contextMenuDismissed(this);
3469 void WebPageProxy::contextMenuItemSelected(const WebContextMenuItemData& item)
3471 TIZEN_LOGI("selected item : action(%d), title(%s)", item.action(), item.title().utf8().data());
3472 // Application custom items don't need to round-trip through to WebCore in the WebProcess.
3473 if (item.action() >= ContextMenuItemBaseApplicationTag) {
3474 m_contextMenuClient.customContextMenuItemSelected(this, item);
3475 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
3476 m_pageClient->setIsTextSelectionMode(false);
3482 if (item.action() == ContextMenuItemTagSmartCopyPaste) {
3483 setSmartInsertDeleteEnabled(!isSmartInsertDeleteEnabled());
3486 if (item.action() == ContextMenuItemTagSmartQuotes) {
3487 TextChecker::setAutomaticQuoteSubstitutionEnabled(!TextChecker::state().isAutomaticQuoteSubstitutionEnabled);
3488 process()->updateTextCheckerState();
3491 if (item.action() == ContextMenuItemTagSmartDashes) {
3492 TextChecker::setAutomaticDashSubstitutionEnabled(!TextChecker::state().isAutomaticDashSubstitutionEnabled);
3493 process()->updateTextCheckerState();
3496 if (item.action() == ContextMenuItemTagSmartLinks) {
3497 TextChecker::setAutomaticLinkDetectionEnabled(!TextChecker::state().isAutomaticLinkDetectionEnabled);
3498 process()->updateTextCheckerState();
3501 if (item.action() == ContextMenuItemTagTextReplacement) {
3502 TextChecker::setAutomaticTextReplacementEnabled(!TextChecker::state().isAutomaticTextReplacementEnabled);
3503 process()->updateTextCheckerState();
3506 if (item.action() == ContextMenuItemTagCorrectSpellingAutomatically) {
3507 TextChecker::setAutomaticSpellingCorrectionEnabled(!TextChecker::state().isAutomaticSpellingCorrectionEnabled);
3508 process()->updateTextCheckerState();
3511 if (item.action() == ContextMenuItemTagShowSubstitutions) {
3512 TextChecker::toggleSubstitutionsPanelIsShowing();
3516 if (item.action() == ContextMenuItemTagDownloadImageToDisk) {
3517 m_process->context()->download(this, KURL(KURL(), m_activeContextMenuHitTestResultData.absoluteImageURL));
3520 if (item.action() == ContextMenuItemTagDownloadLinkToDisk) {
3521 m_process->context()->download(this, KURL(KURL(), m_activeContextMenuHitTestResultData.absoluteLinkURL));
3524 if (item.action() == ContextMenuItemTagCheckSpellingWhileTyping) {
3525 TextChecker::setContinuousSpellCheckingEnabled(!TextChecker::state().isContinuousSpellCheckingEnabled);
3526 process()->updateTextCheckerState();
3529 if (item.action() == ContextMenuItemTagCheckGrammarWithSpelling) {
3530 TextChecker::setGrammarCheckingEnabled(!TextChecker::state().isGrammarCheckingEnabled);
3531 process()->updateTextCheckerState();
3534 if (item.action() == ContextMenuItemTagShowSpellingPanel) {
3535 if (!TextChecker::spellingUIIsShowing())
3536 advanceToNextMisspelling(true);
3537 TextChecker::toggleSpellingUIIsShowing();
3540 if (item.action() == ContextMenuItemTagLearnSpelling || item.action() == ContextMenuItemTagIgnoreSpelling)
3541 ++m_pendingLearnOrIgnoreWordMessageCount;
3543 #if ENABLE(TIZEN_WEBKIT2_CLIPBOARD_HELPER)
3544 if (item.action() == ContextMenuItemTagPaste) {
3545 pasteContextMenuSelected();
3550 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_TEXT_SELECTION_MODE)
3551 if (item.action() == ContextMenuItemTagTextSelectionMode) {
3552 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
3553 m_pageClient->setIsTextSelectionMode(true);
3556 evas_object_focus_set(viewWidget(), true);
3557 WebCore::IntPoint positionForSelection = m_activeContextMenu->positionForSelection();
3558 bool result = false;
3559 process()->sendSync(Messages::WebPage::SelectLink(positionForSelection), Messages::WebPage::SelectLink::Reply(result), m_pageID);
3560 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
3561 if (result == false)
3562 m_pageClient->setIsTextSelectionMode(false);
3569 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
3570 if (item.action() == ContextMenuItemTagClipboard) {
3571 clipboardContextMenuSelected();
3576 #if ENABLE(CONTEXT_MENUS)
3577 process()->send(Messages::WebPage::DidSelectItemFromActiveContextMenu(item), m_pageID);
3580 #endif // ENABLE(CONTEXT_MENUS)
3582 void WebPageProxy::didChooseFilesForOpenPanel(const Vector<String>& fileURLs)
3587 #if ENABLE(WEB_PROCESS_SANDBOX)
3588 // FIXME: The sandbox extensions should be sent with the DidChooseFilesForOpenPanel message. This
3589 // is gated on a way of passing SandboxExtension::Handles in a Vector.
3590 for (size_t i = 0; i < fileURLs.size(); ++i) {
3591 SandboxExtension::Handle sandboxExtensionHandle;
3592 SandboxExtension::createHandle(fileURLs[i], SandboxExtension::ReadOnly, sandboxExtensionHandle);
3593 process()->send(Messages::WebPage::ExtendSandboxForFileFromOpenPanel(sandboxExtensionHandle), m_pageID);
3597 process()->send(Messages::WebPage::DidChooseFilesForOpenPanel(fileURLs), m_pageID);
3599 m_openPanelResultListener->invalidate();
3600 m_openPanelResultListener = 0;
3603 void WebPageProxy::didCancelForOpenPanel()
3608 process()->send(Messages::WebPage::DidCancelForOpenPanel(), m_pageID);
3610 m_openPanelResultListener->invalidate();
3611 m_openPanelResultListener = 0;
3614 void WebPageProxy::advanceToNextMisspelling(bool startBeforeSelection) const
3616 process()->send(Messages::WebPage::AdvanceToNextMisspelling(startBeforeSelection), m_pageID);
3619 void WebPageProxy::changeSpellingToWord(const String& word) const
3624 process()->send(Messages::WebPage::ChangeSpellingToWord(word), m_pageID);
3627 void WebPageProxy::registerEditCommand(PassRefPtr<WebEditCommandProxy> commandProxy, UndoOrRedo undoOrRedo)
3629 m_pageClient->registerEditCommand(commandProxy, undoOrRedo);
3632 void WebPageProxy::addEditCommand(WebEditCommandProxy* command)
3634 m_editCommandSet.add(command);
3637 void WebPageProxy::removeEditCommand(WebEditCommandProxy* command)
3639 m_editCommandSet.remove(command);
3643 process()->send(Messages::WebPage::DidRemoveEditCommand(command->commandID()), m_pageID);
3646 bool WebPageProxy::isValidEditCommand(WebEditCommandProxy* command)
3648 return m_editCommandSet.find(command) != m_editCommandSet.end();
3651 int64_t WebPageProxy::spellDocumentTag()
3653 if (!m_hasSpellDocumentTag) {
3654 m_spellDocumentTag = TextChecker::uniqueSpellDocumentTag(this);
3655 m_hasSpellDocumentTag = true;
3658 return m_spellDocumentTag;
3661 #if USE(UNIFIED_TEXT_CHECKING)
3662 void WebPageProxy::checkTextOfParagraph(const String& text, uint64_t checkingTypes, Vector<TextCheckingResult>& results)
3664 results = TextChecker::checkTextOfParagraph(spellDocumentTag(), text.characters(), text.length(), checkingTypes);
3668 void WebPageProxy::checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength)
3670 TextChecker::checkSpellingOfString(spellDocumentTag(), text.characters(), text.length(), misspellingLocation, misspellingLength);
3673 void WebPageProxy::checkGrammarOfString(const String& text, Vector<GrammarDetail>& grammarDetails, int32_t& badGrammarLocation, int32_t& badGrammarLength)
3675 TextChecker::checkGrammarOfString(spellDocumentTag(), text.characters(), text.length(), grammarDetails, badGrammarLocation, badGrammarLength);
3678 void WebPageProxy::spellingUIIsShowing(bool& isShowing)
3680 isShowing = TextChecker::spellingUIIsShowing();
3683 void WebPageProxy::updateSpellingUIWithMisspelledWord(const String& misspelledWord)
3685 TextChecker::updateSpellingUIWithMisspelledWord(spellDocumentTag(), misspelledWord);
3688 void WebPageProxy::updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const GrammarDetail& grammarDetail)
3690 TextChecker::updateSpellingUIWithGrammarString(spellDocumentTag(), badGrammarPhrase, grammarDetail);
3693 void WebPageProxy::getGuessesForWord(const String& word, const String& context, Vector<String>& guesses)
3695 TextChecker::getGuessesForWord(spellDocumentTag(), word, context, guesses);
3698 void WebPageProxy::learnWord(const String& word)
3700 MESSAGE_CHECK(m_pendingLearnOrIgnoreWordMessageCount);
3701 --m_pendingLearnOrIgnoreWordMessageCount;
3703 TextChecker::learnWord(spellDocumentTag(), word);
3706 void WebPageProxy::ignoreWord(const String& word)
3708 MESSAGE_CHECK(m_pendingLearnOrIgnoreWordMessageCount);
3709 --m_pendingLearnOrIgnoreWordMessageCount;
3711 TextChecker::ignoreWord(spellDocumentTag(), word);
3716 void WebPageProxy::setFocus(bool focused)
3719 m_uiClient.focus(this);
3721 m_uiClient.unfocus(this);
3724 void WebPageProxy::takeFocus(uint32_t direction)
3726 m_uiClient.takeFocus(this, (static_cast<FocusDirection>(direction) == FocusDirectionForward) ? kWKFocusDirectionForward : kWKFocusDirectionBackward);
3729 void WebPageProxy::setToolTip(const String& toolTip)
3731 String oldToolTip = m_toolTip;
3732 m_toolTip = toolTip;
3733 m_pageClient->toolTipChanged(oldToolTip, m_toolTip);
3736 void WebPageProxy::setCursor(const WebCore::Cursor& cursor)
3738 m_pageClient->setCursor(cursor);
3741 void WebPageProxy::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
3743 m_pageClient->setCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves);
3746 void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
3748 WebEvent::Type type = static_cast<WebEvent::Type>(opaqueType);
3751 case WebEvent::NoType:
3752 case WebEvent::MouseMove:
3755 case WebEvent::MouseDown:
3756 case WebEvent::MouseUp:
3757 case WebEvent::Wheel:
3758 case WebEvent::KeyDown:
3759 case WebEvent::KeyUp:
3760 case WebEvent::RawKeyDown:
3761 case WebEvent::Char:
3762 #if ENABLE(GESTURE_EVENTS)
3763 case WebEvent::GestureScrollBegin:
3764 case WebEvent::GestureScrollEnd:
3765 case WebEvent::GestureSingleTap:
3767 #if ENABLE(TOUCH_EVENTS)
3768 case WebEvent::TouchStart:
3769 case WebEvent::TouchMove:
3770 case WebEvent::TouchEnd:
3771 case WebEvent::TouchCancel:
3773 process()->responsivenessTimer()->stop();
3778 case WebEvent::NoType:
3780 case WebEvent::MouseMove:
3781 m_processingMouseMoveEvent = false;
3782 if (m_nextMouseMoveEvent) {
3783 handleMouseEvent(*m_nextMouseMoveEvent);
3784 m_nextMouseMoveEvent = nullptr;
3787 case WebEvent::MouseDown:
3789 #if ENABLE(GESTURE_EVENTS)
3790 case WebEvent::GestureScrollBegin:
3791 case WebEvent::GestureScrollEnd:
3792 case WebEvent::GestureSingleTap: {
3793 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3794 QueuedUIEvents<WebGestureEvent> queuedEvents = m_gestureEventQueue.first();
3795 MESSAGE_CHECK(type == queuedEvents.forwardedEvent.type());
3796 m_gestureEventQueue.removeFirst();
3798 m_pageClient->doneWithGestureEvent(queuedEvents.forwardedEvent, handled);
3799 for (size_t i = 0; i < queuedEvents.deferredEvents.size(); ++i) {
3800 bool isEventHandled = false;
3801 m_pageClient->doneWithGestureEvent(queuedEvents.deferredEvents.at(i), isEventHandled);
3804 WebGestureEvent event = m_gestureEventQueue.first();
3805 MESSAGE_CHECK(type == event.type());
3807 m_gestureEventQueue.removeFirst();
3808 m_pageClient->doneWithGestureEvent(event, handled);
3810 #if ENABLE(TIZEN_ISF_PORT)
3811 if (type == WebEvent::GestureSingleTap)
3812 evas_object_focus_set(viewWidget(), true);
3817 case WebEvent::MouseUp:
3818 m_currentlyProcessedMouseDownEvent = nullptr;
3821 case WebEvent::Wheel: {
3822 ASSERT(!m_currentlyProcessedWheelEvents.isEmpty());
3824 OwnPtr<Vector<NativeWebWheelEvent> > oldestCoalescedEvent = m_currentlyProcessedWheelEvents.takeFirst();
3826 // FIXME: Dispatch additional events to the didNotHandleWheelEvent client function.
3827 if (!handled && m_uiClient.implementsDidNotHandleWheelEvent())
3828 m_uiClient.didNotHandleWheelEvent(this, oldestCoalescedEvent->last());
3830 if (!m_wheelEventQueue.isEmpty())
3831 processNextQueuedWheelEvent();
3835 case WebEvent::KeyDown:
3836 case WebEvent::KeyUp:
3837 case WebEvent::RawKeyDown:
3838 case WebEvent::Char: {
3839 LOG(KeyHandling, "WebPageProxy::didReceiveEvent: %s", webKeyboardEventTypeString(type));
3841 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3842 QueuedUIEvents<NativeWebKeyboardEvent> queuedEvents = m_keyEventQueue.first();
3843 NativeWebKeyboardEvent event = queuedEvents.forwardedEvent;
3844 MESSAGE_CHECK(type == event.type());
3845 m_keyEventQueue.removeFirst();
3847 m_pageClient->doneWithKeyEvent(event, handled);
3848 for (size_t i = 0; i < queuedEvents.deferredEvents.size(); ++i) {
3849 bool isEventHandled = false;
3850 m_pageClient->doneWithKeyEvent(queuedEvents.deferredEvents.at(i), isEventHandled);
3853 NativeWebKeyboardEvent event = m_keyEventQueue.first();
3854 MESSAGE_CHECK(type == event.type());
3856 m_keyEventQueue.removeFirst();
3858 if (!m_keyEventQueue.isEmpty())
3859 process()->send(Messages::WebPage::KeyEvent(m_keyEventQueue.first()), m_pageID);
3861 m_pageClient->doneWithKeyEvent(event, handled);
3862 #endif // #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3867 #if ENABLE(TIZEN_ISF_PORT)
3868 InputMethodContextEfl* inputMethodContext = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->inputMethodContext();
3869 if (event.type() == WebEvent::KeyDown && event.keyIdentifier() == "Enter" && inputMethodContext && inputMethodContext->autoCapitalType() == ECORE_IMF_AUTOCAPITAL_TYPE_NONE)
3870 inputMethodContext->hideIMFContext();
3873 if (m_uiClient.implementsDidNotHandleKeyEvent())
3874 m_uiClient.didNotHandleKeyEvent(this, event);
3877 ::TranslateMessage(event.nativeEvent());
3881 #if ENABLE(TOUCH_EVENTS)
3882 case WebEvent::TouchStart:
3883 case WebEvent::TouchMove:
3884 case WebEvent::TouchEnd:
3885 case WebEvent::TouchCancel: {
3886 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3887 QueuedUIEvents<NativeWebTouchEvent> queuedEvents = m_touchEventQueue.first();
3888 MESSAGE_CHECK(type == queuedEvents.forwardedEvent.type());
3889 m_touchEventQueue.removeFirst();
3891 m_pageClient->doneWithTouchEvent(queuedEvents.forwardedEvent, handled);
3892 for (size_t i = 0; i < queuedEvents.deferredEvents.size(); ++i) {
3893 bool isEventHandled = false;
3894 m_pageClient->doneWithTouchEvent(queuedEvents.deferredEvents.at(i), isEventHandled);
3897 QueuedTouchEvents queuedEvents = m_touchEventQueue.first();
3898 MESSAGE_CHECK(type == queuedEvents.forwardedEvent.type());
3899 m_touchEventQueue.removeFirst();
3901 m_pageClient->doneWithTouchEvent(queuedEvents.forwardedEvent, handled);
3902 for (size_t i = 0; i < queuedEvents.deferredTouchEvents.size(); ++i) {
3903 bool isEventHandled = false;
3904 m_pageClient->doneWithTouchEvent(queuedEvents.deferredTouchEvents.at(i), isEventHandled);
3913 void WebPageProxy::stopResponsivenessTimer()
3915 process()->responsivenessTimer()->stop();
3918 void WebPageProxy::voidCallback(uint64_t callbackID)
3920 RefPtr<VoidCallback> callback = m_voidCallbacks.take(callbackID);
3922 // FIXME: Log error or assert.
3926 callback->performCallback();
3929 void WebPageProxy::dataCallback(const CoreIPC::DataReference& dataReference, uint64_t callbackID)
3931 RefPtr<DataCallback> callback = m_dataCallbacks.take(callbackID);
3933 // FIXME: Log error or assert.
3937 callback->performCallbackWithReturnValue(WebData::create(dataReference.data(), dataReference.size()).get());
3940 void WebPageProxy::stringCallback(const String& resultString, uint64_t callbackID)
3942 RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackID);
3944 // FIXME: Log error or assert.
3945 // this can validly happen if a load invalidated the callback, though
3949 m_loadDependentStringCallbackIDs.remove(callbackID);
3951 callback->performCallbackWithReturnValue(resultString.impl());
3954 void WebPageProxy::scriptValueCallback(const CoreIPC::DataReference& dataReference, uint64_t callbackID)
3956 RefPtr<ScriptValueCallback> callback = m_scriptValueCallbacks.take(callbackID);
3958 // FIXME: Log error or assert.
3962 Vector<uint8_t> data;
3963 data.reserveInitialCapacity(dataReference.size());
3964 data.append(dataReference.data(), dataReference.size());
3966 callback->performCallbackWithReturnValue(data.size() ? WebSerializedScriptValue::adopt(data).get() : 0);
3969 void WebPageProxy::computedPagesCallback(const Vector<IntRect>& pageRects, double totalScaleFactorForPrinting, uint64_t callbackID)
3971 RefPtr<ComputedPagesCallback> callback = m_computedPagesCallbacks.take(callbackID);
3973 // FIXME: Log error or assert.
3977 callback->performCallbackWithReturnValue(pageRects, totalScaleFactorForPrinting);
3980 void WebPageProxy::validateCommandCallback(const String& commandName, bool isEnabled, int state, uint64_t callbackID)
3982 RefPtr<ValidateCommandCallback> callback = m_validateCommandCallbacks.take(callbackID);
3984 // FIXME: Log error or assert.
3988 callback->performCallbackWithReturnValue(commandName.impl(), isEnabled, state);
3992 void WebPageProxy::printFinishedCallback(const ResourceError& printError, uint64_t callbackID)
3994 RefPtr<PrintFinishedCallback> callback = m_printFinishedCallbacks.take(callbackID);
3996 // FIXME: Log error or assert.
4000 RefPtr<WebError> error = WebError::create(printError);
4001 callback->performCallbackWithReturnValue(error.get());
4005 void WebPageProxy::focusedFrameChanged(uint64_t frameID)
4012 WebFrameProxy* frame = process()->webFrame(frameID);
4013 MESSAGE_CHECK(frame);
4015 m_focusedFrame = frame;
4018 void WebPageProxy::frameSetLargestFrameChanged(uint64_t frameID)
4021 m_frameSetLargestFrame = 0;
4025 WebFrameProxy* frame = process()->webFrame(frameID);
4026 MESSAGE_CHECK(frame);
4028 m_frameSetLargestFrame = frame;
4031 void WebPageProxy::processDidBecomeUnresponsive()
4036 updateBackingStoreDiscardableState();
4038 m_loaderClient.processDidBecomeUnresponsive(this);
4041 void WebPageProxy::interactionOccurredWhileProcessUnresponsive()
4046 m_loaderClient.interactionOccurredWhileProcessUnresponsive(this);
4049 void WebPageProxy::processDidBecomeResponsive()
4054 updateBackingStoreDiscardableState();
4056 m_loaderClient.processDidBecomeResponsive(this);
4059 void WebPageProxy::processDidCrash()
4061 ASSERT(m_pageClient);
4064 m_isPageSuspended = false;
4067 m_urlAtProcessExit = m_mainFrame->url();
4068 m_loadStateAtProcessExit = m_mainFrame->loadState();
4071 m_mainFrame = nullptr;
4072 m_drawingArea = nullptr;
4074 #if ENABLE(INSPECTOR)
4076 m_inspector->invalidate();
4077 m_inspector = nullptr;
4081 #if ENABLE(FULLSCREEN_API)
4082 if (m_fullScreenManager) {
4083 m_fullScreenManager->invalidate();
4084 m_fullScreenManager = nullptr;
4088 if (m_openPanelResultListener) {
4089 m_openPanelResultListener->invalidate();
4090 m_openPanelResultListener = nullptr;
4093 #if ENABLE(INPUT_TYPE_COLOR)
4094 if (m_colorChooser) {
4095 m_colorChooser->invalidate();
4096 m_colorChooser = nullptr;
4099 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
4100 if (m_colorPickerResultListener) {
4101 m_colorPickerResultListener->invalidate();
4102 m_colorPickerResultListener = nullptr;
4107 #if ENABLE(GEOLOCATION)
4108 m_geolocationPermissionRequestManager.invalidateRequests();
4111 m_notificationPermissionRequestManager.invalidateRequests();
4113 m_toolTip = String();
4115 m_mainFrameHasHorizontalScrollbar = false;
4116 m_mainFrameHasVerticalScrollbar = false;
4118 m_mainFrameIsPinnedToLeftSide = false;
4119 m_mainFrameIsPinnedToRightSide = false;
4121 m_visibleScrollerThumbRect = IntRect();
4123 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
4124 invalidateCallbackMap(m_booleanCallbacks);
4125 invalidateCallbackMap(m_dictionaryCallbacks);
4127 invalidateCallbackMap(m_voidCallbacks);
4128 invalidateCallbackMap(m_dataCallbacks);
4129 invalidateCallbackMap(m_stringCallbacks);
4130 m_loadDependentStringCallbackIDs.clear();
4131 invalidateCallbackMap(m_scriptValueCallbacks);
4132 invalidateCallbackMap(m_computedPagesCallbacks);
4133 invalidateCallbackMap(m_validateCommandCallbacks);
4135 invalidateCallbackMap(m_printFinishedCallbacks);
4138 Vector<WebEditCommandProxy*> editCommandVector;
4139 copyToVector(m_editCommandSet, editCommandVector);
4140 m_editCommandSet.clear();
4141 for (size_t i = 0, size = editCommandVector.size(); i < size; ++i)
4142 editCommandVector[i]->invalidate();
4143 m_pageClient->clearAllEditCommands();
4145 m_activePopupMenu = 0;
4147 m_estimatedProgress = 0.0;
4149 m_pendingLearnOrIgnoreWordMessageCount = 0;
4151 m_pageClient->processDidCrash();
4152 m_loaderClient.processDidCrash(this);
4155 // If the call out to the loader client didn't cause the web process to be relaunched,
4156 // we'll call setNeedsDisplay on the view so that we won't have the old contents showing.
4157 // If the call did cause the web process to be relaunched, we'll keep the old page contents showing
4158 // until the new web process has painted its contents.
4159 setViewNeedsDisplay(IntRect(IntPoint(), viewSize()));
4162 // Can't expect DidReceiveEvent notifications from a crashed web process.
4163 m_keyEventQueue.clear();
4165 m_wheelEventQueue.clear();
4166 m_currentlyProcessedWheelEvents.clear();
4168 m_nextMouseMoveEvent = nullptr;
4169 m_currentlyProcessedMouseDownEvent = nullptr;
4171 m_processingMouseMoveEvent = false;
4173 #if ENABLE(TOUCH_EVENTS)
4174 m_needTouchEvents = false;
4175 m_touchEventQueue.clear();
4178 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4179 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
4180 m_pageClient->dismissDictionaryLookupPanel();
4184 WebPageCreationParameters WebPageProxy::creationParameters() const
4186 WebPageCreationParameters parameters;
4188 parameters.viewSize = m_pageClient->viewSize();
4189 parameters.isActive = m_pageClient->isViewWindowActive();
4190 parameters.isFocused = m_pageClient->isViewFocused();
4191 parameters.isVisible = m_pageClient->isViewVisible();
4192 parameters.isInWindow = m_pageClient->isViewInWindow();
4193 parameters.drawingAreaType = m_drawingArea->type();
4194 parameters.store = m_pageGroup->preferences()->store();
4195 parameters.pageGroupData = m_pageGroup->data();
4196 parameters.drawsBackground = m_drawsBackground;
4197 parameters.drawsTransparentBackground = m_drawsTransparentBackground;
4198 parameters.areMemoryCacheClientCallsEnabled = m_areMemoryCacheClientCallsEnabled;
4199 parameters.useFixedLayout = m_useFixedLayout;
4200 parameters.fixedLayoutSize = m_fixedLayoutSize;
4201 parameters.paginationMode = m_paginationMode;
4202 parameters.paginationBehavesLikeColumns = m_paginationBehavesLikeColumns;
4203 parameters.pageLength = m_pageLength;
4204 parameters.gapBetweenPages = m_gapBetweenPages;
4205 parameters.userAgent = userAgent();
4206 parameters.sessionState = SessionState(m_backForwardList->entries(), m_backForwardList->currentIndex());
4207 parameters.highestUsedBackForwardItemID = WebBackForwardListItem::highedUsedItemID();
4208 parameters.canRunBeforeUnloadConfirmPanel = m_uiClient.canRunBeforeUnloadConfirmPanel();
4209 parameters.canRunModal = m_canRunModal;
4210 parameters.deviceScaleFactor = m_intrinsicDeviceScaleFactor;
4211 parameters.mediaVolume = m_mediaVolume;
4214 parameters.isSmartInsertDeleteEnabled = m_isSmartInsertDeleteEnabled;
4215 parameters.layerHostingMode = m_layerHostingMode;
4216 parameters.colorSpace = m_pageClient->colorSpace();
4220 parameters.nativeWindow = m_pageClient->nativeWindow();
4225 #if USE(ACCELERATED_COMPOSITING)
4226 void WebPageProxy::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
4228 m_pageClient->enterAcceleratedCompositingMode(layerTreeContext);
4231 void WebPageProxy::exitAcceleratedCompositingMode()
4233 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
4234 process()->platformSurfaceTexturePool()->removeAllPlatformSurfaceTextures();
4236 m_pageClient->exitAcceleratedCompositingMode();
4239 void WebPageProxy::updateAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
4241 m_pageClient->updateAcceleratedCompositingMode(layerTreeContext);
4243 #endif // USE(ACCELERATED_COMPOSITING)
4245 void WebPageProxy::backForwardClear()
4247 m_backForwardList->clear();
4250 void WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const ProtectionSpace& coreProtectionSpace, bool& canAuthenticate)
4252 WebFrameProxy* frame = process()->webFrame(frameID);
4253 MESSAGE_CHECK(frame);
4255 RefPtr<WebProtectionSpace> protectionSpace = WebProtectionSpace::create(coreProtectionSpace);
4257 canAuthenticate = m_loaderClient.canAuthenticateAgainstProtectionSpaceInFrame(this, frame, protectionSpace.get());
4260 #if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
4261 void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const AuthenticationChallenge& coreChallenge, uint64_t challengeID, PassRefPtr<Messages::WebPageProxy::DidReceiveAuthenticationChallenge::DelayedReply> reply)
4263 void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const AuthenticationChallenge& coreChallenge, uint64_t challengeID)
4266 WebFrameProxy* frame = process()->webFrame(frameID);
4267 MESSAGE_CHECK(frame);
4269 #if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
4270 RefPtr<AuthenticationChallengeProxy> authenticationChallenge = frame->setUpAuthenticationChallengeProxy(coreChallenge, challengeID, process());
4271 m_AuthReply = reply;
4273 if (!m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get()))
4274 replyReceiveAuthenticationChallengeInFrame(true);
4276 RefPtr<AuthenticationChallengeProxy> authenticationChallenge = AuthenticationChallengeProxy::create(coreChallenge, challengeID, process());
4278 m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get());
4282 #if ENABLE(TIZEN_SQL_DATABASE)
4283 void WebPageProxy::exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& displayName, uint64_t expectedUsage, PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply> allowExceed)
4285 WebFrameProxy* frame = process()->webFrame(frameID);
4286 MESSAGE_CHECK(frame);
4288 // Since exceededDatabaseQuota() can spin a nested run loop we need to turn off the responsiveness timer.
4289 process()->responsivenessTimer()->stop();
4291 m_exceededDatabaseQuotaReply = allowExceed;
4292 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
4293 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
4294 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
4297 if (!m_uiClient.exceededDatabaseQuota(this, frame, origin.get(), displayName, expectedUsage))
4298 replyExceededDatabaseQuota(true);
4301 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)
4303 WebFrameProxy* frame = process()->webFrame(frameID);
4304 MESSAGE_CHECK(frame);
4306 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
4308 newQuota = m_uiClient.exceededDatabaseQuota(this, frame, origin.get(), databaseName, displayName, currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage);
4312 void WebPageProxy::requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier)
4314 WebFrameProxy* frame = process()->webFrame(frameID);
4315 MESSAGE_CHECK(frame);
4317 // FIXME: Geolocation should probably be using toString() as its string representation instead of databaseIdentifier().
4318 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
4319 RefPtr<GeolocationPermissionRequestProxy> request = m_geolocationPermissionRequestManager.createRequest(geolocationID);
4321 if (!m_uiClient.decidePolicyForGeolocationPermissionRequest(this, frame, origin.get(), request.get()))
4325 void WebPageProxy::requestNotificationPermission(uint64_t requestID, const String& originString)
4327 if (!isRequestIDValid(requestID))
4330 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromString(originString);
4331 RefPtr<NotificationPermissionRequest> request = m_notificationPermissionRequestManager.createRequest(requestID);
4333 if (!m_uiClient.decidePolicyForNotificationPermissionRequest(this, origin.get(), request.get()))
4337 void WebPageProxy::showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID)
4339 m_process->context()->notificationManagerProxy()->show(this, title, body, iconURL, tag, originString, notificationID);
4342 #if ENABLE(TIZEN_MEDIA_STREAM)
4343 void WebPageProxy::requestUserMediaPermission(uint64_t requestID)
4345 RefPtr<UserMediaPermissionRequest> request = m_userMediaPermissionRequestManager.createRequest(requestID);
4347 if (!m_tizenClient.decidePolicyForUserMediaPermissionRequest(this, request.get()))
4352 float WebPageProxy::headerHeight(WebFrameProxy* frame)
4354 if (frame->isDisplayingPDFDocument())
4356 return m_uiClient.headerHeight(this, frame);
4359 float WebPageProxy::footerHeight(WebFrameProxy* frame)
4361 if (frame->isDisplayingPDFDocument())
4363 return m_uiClient.footerHeight(this, frame);
4366 void WebPageProxy::drawHeader(WebFrameProxy* frame, const FloatRect& rect)
4368 if (frame->isDisplayingPDFDocument())
4370 m_uiClient.drawHeader(this, frame, rect);
4373 void WebPageProxy::drawFooter(WebFrameProxy* frame, const FloatRect& rect)
4375 if (frame->isDisplayingPDFDocument())
4377 m_uiClient.drawFooter(this, frame, rect);
4380 void WebPageProxy::runModal()
4382 // Since runModal() can (and probably will) spin a nested run loop we need to turn off the responsiveness timer.
4383 process()->responsivenessTimer()->stop();
4385 // Our Connection's run loop might have more messages waiting to be handled after this RunModal message.
4386 // To make sure they are handled inside of the the nested modal run loop we must first signal the Connection's
4387 // run loop so we're guaranteed that it has a chance to wake up.
4388 // See http://webkit.org/b/89590 for more discussion.
4389 process()->connection()->wakeUpRunLoop();
4391 m_uiClient.runModal(this);
4394 void WebPageProxy::notifyScrollerThumbIsVisibleInRect(const IntRect& scrollerThumb)
4396 m_visibleScrollerThumbRect = scrollerThumb;
4399 void WebPageProxy::recommendedScrollbarStyleDidChange(int32_t newStyle)
4402 m_pageClient->recommendedScrollbarStyleDidChange(newStyle);
4406 void WebPageProxy::didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar)
4408 m_mainFrameHasHorizontalScrollbar = hasHorizontalScrollbar;
4409 m_mainFrameHasVerticalScrollbar = hasVerticalScrollbar;
4411 m_pageClient->didChangeScrollbarsForMainFrame();
4414 void WebPageProxy::didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide)
4416 m_mainFrameIsPinnedToLeftSide = pinnedToLeftSide;
4417 m_mainFrameIsPinnedToRightSide = pinnedToRightSide;
4420 void WebPageProxy::didChangePageCount(unsigned pageCount)
4422 m_pageCount = pageCount;
4425 void WebPageProxy::didFailToInitializePlugin(const String& mimeType)
4427 m_loaderClient.didFailToInitializePlugin(this, mimeType);
4430 void WebPageProxy::didBlockInsecurePluginVersion(const String& mimeType, const String& urlString)
4432 String pluginIdentifier;
4433 String pluginVersion;
4434 String newMimeType = mimeType;
4437 PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL(KURL(), urlString));
4439 pluginIdentifier = plugin.bundleIdentifier;
4440 pluginVersion = plugin.versionString;
4443 m_loaderClient.didBlockInsecurePluginVersion(this, newMimeType, pluginIdentifier, pluginVersion);
4446 bool WebPageProxy::willHandleHorizontalScrollEvents() const
4448 return !m_canShortCircuitHorizontalWheelEvents;
4451 void WebPageProxy::didFinishLoadingDataForCustomRepresentation(const String& suggestedFilename, const CoreIPC::DataReference& dataReference)
4453 m_pageClient->didFinishLoadingDataForCustomRepresentation(suggestedFilename, dataReference);
4456 void WebPageProxy::backForwardRemovedItem(uint64_t itemID)
4458 process()->send(Messages::WebPage::DidRemoveBackForwardItem(itemID), m_pageID);
4461 void WebPageProxy::setCanRunModal(bool canRunModal)
4466 // It's only possible to change the state for a WebPage which
4467 // already qualifies for running modal child web pages, otherwise
4468 // there's no other possibility than not allowing it.
4469 m_canRunModal = m_uiClient.canRunModal() && canRunModal;
4470 process()->send(Messages::WebPage::SetCanRunModal(m_canRunModal), m_pageID);
4473 bool WebPageProxy::canRunModal()
4475 return isValid() ? m_canRunModal : false;
4478 void WebPageProxy::beginPrinting(WebFrameProxy* frame, const PrintInfo& printInfo)
4480 if (m_isInPrintingMode)
4483 m_isInPrintingMode = true;
4484 process()->send(Messages::WebPage::BeginPrinting(frame->frameID(), printInfo), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4487 void WebPageProxy::endPrinting()
4489 if (!m_isInPrintingMode)
4492 m_isInPrintingMode = false;
4493 process()->send(Messages::WebPage::EndPrinting(), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4496 void WebPageProxy::computePagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<ComputedPagesCallback> prpCallback)
4498 RefPtr<ComputedPagesCallback> callback = prpCallback;
4500 callback->invalidate();
4504 uint64_t callbackID = callback->callbackID();
4505 m_computedPagesCallbacks.set(callbackID, callback.get());
4506 m_isInPrintingMode = true;
4507 process()->send(Messages::WebPage::ComputePagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4510 #if PLATFORM(MAC) || PLATFORM(WIN)
4511 void WebPageProxy::drawRectToPDF(WebFrameProxy* frame, const PrintInfo& printInfo, const IntRect& rect, PassRefPtr<DataCallback> prpCallback)
4513 RefPtr<DataCallback> callback = prpCallback;
4515 callback->invalidate();
4519 uint64_t callbackID = callback->callbackID();
4520 m_dataCallbacks.set(callbackID, callback.get());
4521 process()->send(Messages::WebPage::DrawRectToPDF(frame->frameID(), printInfo, rect, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4524 void WebPageProxy::drawPagesToPDF(WebFrameProxy* frame, const PrintInfo& printInfo, uint32_t first, uint32_t count, PassRefPtr<DataCallback> prpCallback)
4526 RefPtr<DataCallback> callback = prpCallback;
4528 callback->invalidate();
4532 uint64_t callbackID = callback->callbackID();
4533 m_dataCallbacks.set(callbackID, callback.get());
4534 process()->send(Messages::WebPage::DrawPagesToPDF(frame->frameID(), printInfo, first, count, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4537 void WebPageProxy::drawPagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<PrintFinishedCallback> didPrintCallback)
4539 RefPtr<PrintFinishedCallback> callback = didPrintCallback;
4541 callback->invalidate();
4545 uint64_t callbackID = callback->callbackID();
4546 m_printFinishedCallbacks.set(callbackID, callback.get());
4547 m_isInPrintingMode = true;
4548 process()->send(Messages::WebPage::DrawPagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4552 void WebPageProxy::flashBackingStoreUpdates(const Vector<IntRect>& updateRects)
4554 m_pageClient->flashBackingStoreUpdates(updateRects);
4557 void WebPageProxy::updateBackingStoreDiscardableState()
4563 if (!process()->responsivenessTimer()->isResponsive())
4564 isDiscardable = false;
4566 isDiscardable = !m_pageClient->isViewWindowActive() || !isViewVisible();
4568 m_drawingArea->setBackingStoreIsDiscardable(isDiscardable);
4571 Color WebPageProxy::viewUpdatesFlashColor()
4573 return Color(0, 200, 255);
4576 Color WebPageProxy::backingStoreUpdatesFlashColor()
4578 return Color(200, 0, 255);
4581 void WebPageProxy::saveDataToFileInDownloadsFolder(const String& suggestedFilename, const String& mimeType, const String& originatingURLString, WebData* data)
4583 m_uiClient.saveDataToFileInDownloadsFolder(this, suggestedFilename, mimeType, originatingURLString, data);
4586 void WebPageProxy::linkClicked(const String& url, const WebMouseEvent& event)
4588 process()->send(Messages::WebPage::LinkClicked(url, event), m_pageID, 0);
4593 void WebPageProxy::substitutionsPanelIsShowing(bool& isShowing)
4595 isShowing = TextChecker::substitutionsPanelIsShowing();
4598 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4599 void WebPageProxy::showCorrectionPanel(int32_t panelType, const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings)
4601 m_pageClient->showCorrectionPanel((AlternativeTextType)panelType, boundingBoxOfReplacedString, replacedString, replacementString, alternativeReplacementStrings);
4604 void WebPageProxy::dismissCorrectionPanel(int32_t reason)
4606 m_pageClient->dismissCorrectionPanel((ReasonForDismissingAlternativeText)reason);
4609 void WebPageProxy::dismissCorrectionPanelSoon(int32_t reason, String& result)
4611 result = m_pageClient->dismissCorrectionPanelSoon((ReasonForDismissingAlternativeText)reason);
4614 void WebPageProxy::recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString)
4616 m_pageClient->recordAutocorrectionResponse((AutocorrectionResponseType)responseType, replacedString, replacementString);
4618 #endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4620 void WebPageProxy::handleAlternativeTextUIResult(const String& result)
4622 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4624 process()->send(Messages::WebPage::HandleAlternativeTextUIResult(result), m_pageID, 0);
4628 #if USE(DICTATION_ALTERNATIVES)
4629 void WebPageProxy::showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext)
4631 m_pageClient->showDictationAlternativeUI(boundingBoxOfDictatedText, dictationContext);
4634 void WebPageProxy::dismissDictationAlternativeUI()
4636 m_pageClient->dismissDictationAlternativeUI();
4639 void WebPageProxy::removeDictationAlternatives(uint64_t dictationContext)
4641 m_pageClient->removeDictationAlternatives(dictationContext);
4644 void WebPageProxy::dictationAlternatives(uint64_t dictationContext, Vector<String>& result)
4646 result = m_pageClient->dictationAlternatives(dictationContext);
4650 #endif // PLATFORM(MAC)
4653 void WebPageProxy::didReceiveURIRequest(String uriString, uint64_t requestID)
4655 m_process->context()->soupRequestManagerProxy()->didReceiveURIRequest(uriString, this, requestID);
4659 #if ENABLE(TIZEN_PAGE_VISIBILITY_API)
4660 void WebPageProxy::setPageVisibility(WebCore::PageVisibilityState pageVisibilityState, bool isInitialState)
4662 process()->send(Messages::WebPage::SetVisibilityState(static_cast<uint32_t>(pageVisibilityState), isInitialState), m_pageID);
4666 #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
4667 void WebPageProxy::decidePolicyForCertificateError(const String& url, const String& certificate, int error, PassRefPtr<Messages::WebPageProxy::DecidePolicyForCertificateError::DelayedReply> reply)
4669 m_allowedReply = reply;
4671 if (!m_tizenClient.decidePolicyForCertificateError(this, url, certificate, error))
4672 replyPolicyForCertificateError(true);
4676 #if ENABLE(TIZEN_NATIVE_MEMORY_SNAPSHOT)
4677 void WebPageProxy::dumpMemorySnapshot()
4679 process()->send(Messages::WebPage::DumpMemorySnapshot(), m_pageID);
4683 } // namespace WebKit