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 // This controls what strategy we use for mouse wheel coalescing.
130 #define MERGE_WHEEL_EVENTS 1
132 #define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, m_process->connection())
133 #define MESSAGE_CHECK_URL(url) MESSAGE_CHECK_BASE(m_process->checkURLReceivedFromWebProcess(url), m_process->connection())
135 using namespace WebCore;
137 // Represents the number of wheel events we can hold in the queue before we start pushing them preemptively.
138 static const unsigned wheelEventQueueSizeThreshold = 10;
142 WKPageDebugPaintFlags WebPageProxy::s_debugPaintFlags = 0;
144 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, webPageProxyCounter, ("WebPageProxy"));
147 static const char* webKeyboardEventTypeString(WebEvent::Type type)
150 case WebEvent::KeyDown:
153 case WebEvent::KeyUp:
156 case WebEvent::RawKeyDown:
163 ASSERT_NOT_REACHED();
167 #endif // !LOG_DISABLED
169 PassRefPtr<WebPageProxy> WebPageProxy::create(PageClient* pageClient, PassRefPtr<WebProcessProxy> process, WebPageGroup* pageGroup, uint64_t pageID)
171 return adoptRef(new WebPageProxy(pageClient, process, pageGroup, pageID));
174 WebPageProxy::WebPageProxy(PageClient* pageClient, PassRefPtr<WebProcessProxy> process, WebPageGroup* pageGroup, uint64_t pageID)
175 : m_pageClient(pageClient)
177 , m_pageGroup(pageGroup)
179 , m_userAgent(standardUserAgent())
180 , m_geolocationPermissionRequestManager(this)
181 , m_notificationPermissionRequestManager(this)
182 #if ENABLE(TIZEN_MEDIA_STREAM)
183 , m_userMediaPermissionRequestManager(this)
185 , m_estimatedProgress(0)
186 , m_isInWindow(m_pageClient->isViewInWindow())
187 , m_isVisible(m_pageClient->isViewVisible())
188 , m_backForwardList(WebBackForwardList::create(this))
189 , m_loadStateAtProcessExit(WebFrameProxy::LoadStateFinished)
190 , m_textZoomFactor(1)
191 , m_pageZoomFactor(1)
192 , m_pageScaleFactor(1)
193 , m_intrinsicDeviceScaleFactor(1)
194 , m_customDeviceScaleFactor(0)
195 #if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
196 , m_layerHostingMode(LayerHostingModeInWindowServer)
198 , m_layerHostingMode(LayerHostingModeDefault)
200 , m_drawsBackground(true)
201 , m_drawsTransparentBackground(false)
202 , m_areMemoryCacheClientCallsEnabled(true)
203 , m_useFixedLayout(false)
204 , m_paginationMode(Page::Pagination::Unpaginated)
205 , m_paginationBehavesLikeColumns(false)
207 , m_gapBetweenPages(0)
210 , m_canRunModal(false)
211 , m_isInPrintingMode(false)
212 , m_isPerformingDOMPrintOperation(false)
213 , m_inDecidePolicyForResponse(false)
214 , m_syncMimeTypePolicyActionIsValid(false)
215 , m_syncMimeTypePolicyAction(PolicyUse)
216 , m_syncMimeTypePolicyDownloadID(0)
217 , m_inDecidePolicyForNavigationAction(false)
218 , m_syncNavigationActionPolicyActionIsValid(false)
219 , m_syncNavigationActionPolicyAction(PolicyUse)
220 , m_syncNavigationActionPolicyDownloadID(0)
221 , m_processingMouseMoveEvent(false)
222 #if ENABLE(TOUCH_EVENTS)
223 , m_needTouchEvents(false)
225 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
226 , m_askOverflow(true)
229 , m_isPageSuspended(false)
231 , m_isSmartInsertDeleteEnabled(TextChecker::isSmartInsertDeleteEnabled())
233 , m_spellDocumentTag(0)
234 , m_hasSpellDocumentTag(false)
235 , m_pendingLearnOrIgnoreWordMessageCount(0)
236 , m_mainFrameHasCustomRepresentation(false)
237 , m_mainFrameHasHorizontalScrollbar(false)
238 , m_mainFrameHasVerticalScrollbar(false)
239 , m_canShortCircuitHorizontalWheelEvents(true)
240 , m_mainFrameIsPinnedToLeftSide(false)
241 , m_mainFrameIsPinnedToRightSide(false)
243 , m_renderTreeSize(0)
244 , m_shouldSendEventsSynchronously(false)
245 , m_suppressVisibilityUpdates(false)
247 #if ENABLE(PAGE_VISIBILITY_API)
248 , m_visibilityState(PageVisibilityStateVisible)
250 #if ENABLE(TIZEN_REDUCE_KEY_LAGGING)
251 , m_pageContentResumeTimer(0)
253 #if ENABLE(TIZEN_ISF_PORT)
254 , m_didCancelCompositionFromWebProcess(false)
256 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
257 , m_contentSuspendedByInspector(false)
261 webPageProxyCounter.increment();
264 WebContext::statistics().wkPageCount++;
266 m_pageGroup->addPage(this);
269 WebPageProxy::~WebPageProxy()
274 WebContext::statistics().wkPageCount--;
276 if (m_hasSpellDocumentTag)
277 TextChecker::closeSpellDocumentWithTag(m_spellDocumentTag);
279 m_pageGroup->removePage(this);
282 webPageProxyCounter.decrement();
284 #if ENABLE(TIZEN_REDUCE_KEY_LAGGING)
285 if (m_pageContentResumeTimer)
286 ecore_timer_del(m_pageContentResumeTimer);
290 WebProcessProxy* WebPageProxy::process() const
292 return m_process.get();
295 PlatformProcessIdentifier WebPageProxy::processIdentifier() const
300 return m_process->processIdentifier();
303 bool WebPageProxy::isValid()
305 // A page that has been explicitly closed is never valid.
312 void WebPageProxy::initializeLoaderClient(const WKPageLoaderClient* loadClient)
314 m_loaderClient.initialize(loadClient);
319 process()->send(Messages::WebPage::SetWillGoToBackForwardItemCallbackEnabled(loadClient->version > 0), m_pageID);
322 void WebPageProxy::initializePolicyClient(const WKPagePolicyClient* policyClient)
324 m_policyClient.initialize(policyClient);
327 void WebPageProxy::initializeFormClient(const WKPageFormClient* formClient)
329 m_formClient.initialize(formClient);
332 void WebPageProxy::initializeResourceLoadClient(const WKPageResourceLoadClient* client)
334 m_resourceLoadClient.initialize(client);
337 void WebPageProxy::initializeUIClient(const WKPageUIClient* client)
342 m_uiClient.initialize(client);
344 process()->send(Messages::WebPage::SetCanRunBeforeUnloadConfirmPanel(m_uiClient.canRunBeforeUnloadConfirmPanel()), m_pageID);
345 setCanRunModal(m_uiClient.canRunModal());
348 void WebPageProxy::initializeFindClient(const WKPageFindClient* client)
350 m_findClient.initialize(client);
353 void WebPageProxy::initializeFindMatchesClient(const WKPageFindMatchesClient* client)
355 m_findMatchesClient.initialize(client);
358 #if ENABLE(CONTEXT_MENUS)
359 void WebPageProxy::initializeContextMenuClient(const WKPageContextMenuClient* client)
361 m_contextMenuClient.initialize(client);
365 void WebPageProxy::reattachToWebProcess()
371 m_process = m_process->context()->relaunchProcessIfNecessary();
372 process()->addExistingWebPage(this, m_pageID);
376 m_pageClient->didRelaunchProcess();
377 m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
380 void WebPageProxy::reattachToWebProcessWithItem(WebBackForwardListItem* item)
382 if (item && item != m_backForwardList->currentItem())
383 m_backForwardList->goToItem(item);
385 reattachToWebProcess();
390 process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
391 process()->responsivenessTimer()->start();
394 void WebPageProxy::initializeWebPage()
398 BackForwardListItemVector items = m_backForwardList->entries();
399 for (size_t i = 0; i < items.size(); ++i)
400 process()->registerNewWebBackForwardListItem(items[i].get());
402 m_drawingArea = m_pageClient->createDrawingAreaProxy();
403 ASSERT(m_drawingArea);
405 #if ENABLE(INSPECTOR_SERVER)
406 if (m_pageGroup->preferences()->developerExtrasEnabled())
407 inspector()->enableRemoteInspection();
410 process()->send(Messages::WebProcess::CreateWebPage(m_pageID, creationParameters()), 0);
412 #if ENABLE(PAGE_VISIBILITY_API)
413 process()->send(Messages::WebPage::SetVisibilityState(m_visibilityState, /* isInitialState */ true), m_pageID);
417 void WebPageProxy::close()
424 m_backForwardList->pageClosed();
425 m_pageClient->pageClosed();
427 process()->disconnectFramesFromPage(this);
430 #if ENABLE(INSPECTOR)
432 m_inspector->invalidate();
437 #if ENABLE(FULLSCREEN_API)
438 if (m_fullScreenManager) {
439 m_fullScreenManager->invalidate();
440 m_fullScreenManager = 0;
444 if (m_openPanelResultListener) {
445 m_openPanelResultListener->invalidate();
446 m_openPanelResultListener = 0;
449 #if ENABLE(INPUT_TYPE_COLOR)
450 if (m_colorChooser) {
451 m_colorChooser->invalidate();
452 m_colorChooser = nullptr;
455 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
456 if (m_colorPickerResultListener) {
457 m_colorPickerResultListener->invalidate();
458 m_colorPickerResultListener = nullptr;
463 #if ENABLE(GEOLOCATION)
464 m_geolocationPermissionRequestManager.invalidateRequests();
467 m_notificationPermissionRequestManager.invalidateRequests();
468 #if ENABLE(TIZEN_MEDIA_STREAM)
469 m_userMediaPermissionRequestManager.invalidateRequests();
472 m_toolTip = String();
474 m_mainFrameHasHorizontalScrollbar = false;
475 m_mainFrameHasVerticalScrollbar = false;
477 m_mainFrameIsPinnedToLeftSide = false;
478 m_mainFrameIsPinnedToRightSide = false;
480 m_visibleScrollerThumbRect = IntRect();
482 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
483 invalidateCallbackMap(m_booleanCallbacks);
484 invalidateCallbackMap(m_dictionaryCallbacks);
486 invalidateCallbackMap(m_voidCallbacks);
487 invalidateCallbackMap(m_dataCallbacks);
488 invalidateCallbackMap(m_stringCallbacks);
489 m_loadDependentStringCallbackIDs.clear();
490 invalidateCallbackMap(m_scriptValueCallbacks);
491 invalidateCallbackMap(m_computedPagesCallbacks);
493 invalidateCallbackMap(m_printFinishedCallbacks);
496 Vector<WebEditCommandProxy*> editCommandVector;
497 copyToVector(m_editCommandSet, editCommandVector);
498 m_editCommandSet.clear();
499 for (size_t i = 0, size = editCommandVector.size(); i < size; ++i)
500 editCommandVector[i]->invalidate();
502 m_activePopupMenu = 0;
504 m_estimatedProgress = 0.0;
506 m_loaderClient.initialize(0);
507 m_policyClient.initialize(0);
508 m_uiClient.initialize(0);
510 m_drawingArea = nullptr;
512 process()->send(Messages::WebPage::Close(), m_pageID);
513 process()->removeWebPage(m_pageID);
516 bool WebPageProxy::tryClose()
521 process()->send(Messages::WebPage::TryClose(), m_pageID);
522 process()->responsivenessTimer()->start();
526 bool WebPageProxy::maybeInitializeSandboxExtensionHandle(const KURL& url, SandboxExtension::Handle& sandboxExtensionHandle)
528 if (!url.isLocalFile())
531 #if ENABLE(INSPECTOR)
532 // Don't give the inspector full access to the file system.
533 if (WebInspectorProxy::isInspectorPage(this))
537 SandboxExtension::createHandle("/", SandboxExtension::ReadOnly, sandboxExtensionHandle);
541 void WebPageProxy::loadURL(const String& url)
543 setPendingAPIRequestURL(url);
546 reattachToWebProcess();
548 SandboxExtension::Handle sandboxExtensionHandle;
549 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), url), sandboxExtensionHandle);
550 if (createdExtension)
551 process()->willAcquireUniversalFileReadSandboxExtension();
552 process()->send(Messages::WebPage::LoadURL(url, sandboxExtensionHandle), m_pageID);
553 process()->responsivenessTimer()->start();
556 void WebPageProxy::loadURLRequest(WebURLRequest* urlRequest)
558 setPendingAPIRequestURL(urlRequest->resourceRequest().url());
561 reattachToWebProcess();
563 SandboxExtension::Handle sandboxExtensionHandle;
564 bool createdExtension = maybeInitializeSandboxExtensionHandle(urlRequest->resourceRequest().url(), sandboxExtensionHandle);
565 if (createdExtension)
566 process()->willAcquireUniversalFileReadSandboxExtension();
567 process()->send(Messages::WebPage::LoadURLRequest(urlRequest->resourceRequest(), sandboxExtensionHandle), m_pageID);
568 process()->responsivenessTimer()->start();
571 void WebPageProxy::loadHTMLString(const String& htmlString, const String& baseURL)
574 reattachToWebProcess();
576 process()->assumeReadAccessToBaseURL(baseURL);
577 process()->send(Messages::WebPage::LoadHTMLString(htmlString, baseURL), m_pageID);
578 process()->responsivenessTimer()->start();
581 void WebPageProxy::loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL)
584 reattachToWebProcess();
587 m_mainFrame->setUnreachableURL(unreachableURL);
589 process()->assumeReadAccessToBaseURL(baseURL);
590 process()->send(Messages::WebPage::LoadAlternateHTMLString(htmlString, baseURL, unreachableURL), m_pageID);
591 process()->responsivenessTimer()->start();
594 void WebPageProxy::loadPlainTextString(const String& string)
597 reattachToWebProcess();
599 process()->send(Messages::WebPage::LoadPlainTextString(string), m_pageID);
600 process()->responsivenessTimer()->start();
603 void WebPageProxy::loadWebArchiveData(const WebData* webArchiveData)
606 reattachToWebProcess();
608 process()->send(Messages::WebPage::LoadWebArchiveData(webArchiveData->dataReference()), m_pageID);
609 process()->responsivenessTimer()->start();
613 void WebPageProxy::loadContentsbyMimeType(const WebData* contents, const String& mimeType, const String& encoding, const String& baseURL)
616 reattachToWebProcess();
618 process()->assumeReadAccessToBaseURL(baseURL);
619 #if ENABLE(TIZEN_UNIVERSAL_FILE_READ_ACCESS)
620 SandboxExtension::Handle sandboxExtensionHandleEmail;
621 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), baseURL), sandboxExtensionHandleEmail);
622 if (createdExtension)
623 process()->willAcquireUniversalFileReadSandboxExtension();
625 process()->send(Messages::WebPage::LoadContentsbyMimeType(contents->dataReference(), mimeType, encoding, baseURL), m_pageID);
626 process()->responsivenessTimer()->start();
630 void WebPageProxy::stopLoading()
635 process()->send(Messages::WebPage::StopLoading(), m_pageID);
636 process()->responsivenessTimer()->start();
639 void WebPageProxy::reload(bool reloadFromOrigin)
641 SandboxExtension::Handle sandboxExtensionHandle;
643 if (m_backForwardList->currentItem()) {
644 String url = m_backForwardList->currentItem()->url();
645 setPendingAPIRequestURL(url);
647 // We may not have an extension yet if back/forward list was reinstated after a WebProcess crash or a browser relaunch
648 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), url), sandboxExtensionHandle);
649 if (createdExtension)
650 process()->willAcquireUniversalFileReadSandboxExtension();
654 reattachToWebProcessWithItem(m_backForwardList->currentItem());
658 process()->send(Messages::WebPage::Reload(reloadFromOrigin, sandboxExtensionHandle), m_pageID);
659 process()->responsivenessTimer()->start();
662 void WebPageProxy::goForward()
664 if (isValid() && !canGoForward())
667 WebBackForwardListItem* forwardItem = m_backForwardList->forwardItem();
671 setPendingAPIRequestURL(forwardItem->url());
674 reattachToWebProcessWithItem(forwardItem);
678 process()->send(Messages::WebPage::GoForward(forwardItem->itemID()), m_pageID);
679 process()->responsivenessTimer()->start();
682 bool WebPageProxy::canGoForward() const
684 return m_backForwardList->forwardItem();
687 void WebPageProxy::goBack()
689 if (isValid() && !canGoBack())
692 WebBackForwardListItem* backItem = m_backForwardList->backItem();
696 setPendingAPIRequestURL(backItem->url());
699 reattachToWebProcessWithItem(backItem);
703 process()->send(Messages::WebPage::GoBack(backItem->itemID()), m_pageID);
704 process()->responsivenessTimer()->start();
707 bool WebPageProxy::canGoBack() const
709 return m_backForwardList->backItem();
712 void WebPageProxy::goToBackForwardItem(WebBackForwardListItem* item)
715 reattachToWebProcessWithItem(item);
719 setPendingAPIRequestURL(item->url());
721 process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
722 process()->responsivenessTimer()->start();
725 void WebPageProxy::tryRestoreScrollPosition()
730 process()->send(Messages::WebPage::TryRestoreScrollPosition(), m_pageID);
733 void WebPageProxy::didChangeBackForwardList(WebBackForwardListItem* added, Vector<RefPtr<APIObject> >* removed)
735 m_loaderClient.didChangeBackForwardList(this, added, removed);
738 void WebPageProxy::shouldGoToBackForwardListItem(uint64_t itemID, bool& shouldGoToBackForwardItem)
740 WebBackForwardListItem* item = process()->webBackForwardItem(itemID);
741 shouldGoToBackForwardItem = item && m_loaderClient.shouldGoToBackForwardListItem(this, item);
744 void WebPageProxy::willGoToBackForwardListItem(uint64_t itemID, CoreIPC::ArgumentDecoder* arguments)
746 RefPtr<APIObject> userData;
747 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
748 if (!arguments->decode(messageDecoder))
751 if (WebBackForwardListItem* item = process()->webBackForwardItem(itemID))
752 m_loaderClient.willGoToBackForwardListItem(this, item, userData.get());
755 String WebPageProxy::activeURL() const
757 // If there is a currently pending url, it is the active URL,
758 // even when there's no main frame yet, as it might be the
759 // first API request.
760 if (!m_pendingAPIRequestURL.isNull())
761 return m_pendingAPIRequestURL;
766 if (!m_mainFrame->unreachableURL().isEmpty())
767 return m_mainFrame->unreachableURL();
769 switch (m_mainFrame->loadState()) {
770 case WebFrameProxy::LoadStateProvisional:
771 return m_mainFrame->provisionalURL();
772 case WebFrameProxy::LoadStateCommitted:
773 case WebFrameProxy::LoadStateFinished:
774 return m_mainFrame->url();
777 ASSERT_NOT_REACHED();
781 String WebPageProxy::provisionalURL() const
785 return m_mainFrame->provisionalURL();
788 String WebPageProxy::committedURL() const
793 return m_mainFrame->url();
796 bool WebPageProxy::canShowMIMEType(const String& mimeType) const
798 if (MIMETypeRegistry::canShowMIMEType(mimeType))
801 String newMimeType = mimeType;
802 PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL());
803 if (!plugin.path.isNull() && m_pageGroup->preferences()->pluginsEnabled())
809 void WebPageProxy::setDrawsBackground(bool drawsBackground)
811 if (m_drawsBackground == drawsBackground)
814 m_drawsBackground = drawsBackground;
817 process()->send(Messages::WebPage::SetDrawsBackground(drawsBackground), m_pageID);
820 void WebPageProxy::setDrawsTransparentBackground(bool drawsTransparentBackground)
822 if (m_drawsTransparentBackground == drawsTransparentBackground)
825 m_drawsTransparentBackground = drawsTransparentBackground;
828 process()->send(Messages::WebPage::SetDrawsTransparentBackground(drawsTransparentBackground), m_pageID);
831 void WebPageProxy::viewWillStartLiveResize()
835 process()->send(Messages::WebPage::ViewWillStartLiveResize(), m_pageID);
838 void WebPageProxy::viewWillEndLiveResize()
842 process()->send(Messages::WebPage::ViewWillEndLiveResize(), m_pageID);
845 void WebPageProxy::setViewNeedsDisplay(const IntRect& rect)
847 m_pageClient->setViewNeedsDisplay(rect);
850 void WebPageProxy::displayView()
852 m_pageClient->displayView();
855 void WebPageProxy::scrollView(const IntRect& scrollRect, const IntSize& scrollOffset)
857 m_pageClient->scrollView(scrollRect, scrollOffset);
860 void WebPageProxy::viewStateDidChange(ViewStateFlags flags)
865 if (flags & ViewIsFocused)
866 process()->send(Messages::WebPage::SetFocused(m_pageClient->isViewFocused()), m_pageID);
868 if (flags & ViewWindowIsActive)
869 process()->send(Messages::WebPage::SetActive(m_pageClient->isViewWindowActive()), m_pageID);
871 if (flags & ViewIsVisible) {
872 bool isVisible = m_pageClient->isViewVisible();
873 if (isVisible != m_isVisible) {
874 m_isVisible = isVisible;
875 m_drawingArea->visibilityDidChange();
878 // If we've started the responsiveness timer as part of telling the web process to update the backing store
879 // state, it might not send back a reply (since it won't paint anything if the web page is hidden) so we
880 // stop the unresponsiveness timer here.
881 process()->responsivenessTimer()->stop();
886 if (flags & ViewIsInWindow) {
887 bool isInWindow = m_pageClient->isViewInWindow();
888 if (m_isInWindow != isInWindow) {
889 m_isInWindow = isInWindow;
890 process()->send(Messages::WebPage::SetIsInWindow(isInWindow), m_pageID);
894 LayerHostingMode layerHostingMode = m_pageClient->viewLayerHostingMode();
895 if (m_layerHostingMode != layerHostingMode) {
896 m_layerHostingMode = layerHostingMode;
897 m_drawingArea->layerHostingModeDidChange();
902 #if ENABLE(PAGE_VISIBILITY_API)
903 PageVisibilityState visibilityState = PageVisibilityStateHidden;
905 if (m_pageClient->isViewVisible())
906 visibilityState = PageVisibilityStateVisible;
908 if (visibilityState != m_visibilityState) {
909 m_visibilityState = visibilityState;
910 process()->send(Messages::WebPage::SetVisibilityState(visibilityState, false), m_pageID);
914 updateBackingStoreDiscardableState();
917 IntSize WebPageProxy::viewSize() const
919 return m_pageClient->viewSize();
922 void WebPageProxy::setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent& keyboardEvent)
926 process()->send(Messages::WebPage::SetInitialFocus(forward, isKeyboardEventValid, keyboardEvent), m_pageID);
929 void WebPageProxy::setWindowResizerSize(const IntSize& windowResizerSize)
933 process()->send(Messages::WebPage::SetWindowResizerSize(windowResizerSize), m_pageID);
936 void WebPageProxy::clearSelection()
940 process()->send(Messages::WebPage::ClearSelection(), m_pageID);
943 void WebPageProxy::validateCommand(const String& commandName, PassRefPtr<ValidateCommandCallback> callback)
946 callback->invalidate();
950 uint64_t callbackID = callback->callbackID();
951 m_validateCommandCallbacks.set(callbackID, callback.get());
952 process()->send(Messages::WebPage::ValidateCommand(commandName, callbackID), m_pageID);
955 void WebPageProxy::setMaintainsInactiveSelection(bool newValue)
957 m_maintainsInactiveSelection = newValue;
960 void WebPageProxy::executeEditCommand(const String& commandName)
965 DEFINE_STATIC_LOCAL(String, ignoreSpellingCommandName, ("ignoreSpelling"));
966 if (commandName == ignoreSpellingCommandName)
967 ++m_pendingLearnOrIgnoreWordMessageCount;
969 process()->send(Messages::WebPage::ExecuteEditCommand(commandName), m_pageID);
972 #if USE(TILED_BACKING_STORE)
973 void WebPageProxy::setViewportSize(const IntSize& size)
978 process()->send(Messages::WebPage::SetViewportSize(size), m_pageID);
982 #if ENABLE(DRAG_SUPPORT)
983 void WebPageProxy::dragEntered(DragData* dragData, const String& dragStorageName)
985 SandboxExtension::Handle sandboxExtensionHandle;
986 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
987 performDragControllerAction(DragControllerActionEntered, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
990 void WebPageProxy::dragUpdated(DragData* dragData, const String& dragStorageName)
992 SandboxExtension::Handle sandboxExtensionHandle;
993 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
994 performDragControllerAction(DragControllerActionUpdated, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
997 void WebPageProxy::dragExited(DragData* dragData, const String& dragStorageName)
999 SandboxExtension::Handle sandboxExtensionHandle;
1000 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
1001 performDragControllerAction(DragControllerActionExited, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
1004 #if ENABLE(TIZEN_DRAG_SUPPORT)
1005 void WebPageProxy::performDrag(DragData* dragData, const String& dragStorageName)
1007 void WebPageProxy::performDrag(DragData* dragData, const String& dragStorageName, const SandboxExtension::Handle& sandboxExtensionHandle, const SandboxExtension::HandleArray& sandboxExtensionsForUpload)
1010 #if ENABLE(TIZEN_DRAG_SUPPORT)
1011 TIZEN_LOGI("dragData (%p)", dragData);
1012 SandboxExtension::Handle sandboxExtensionHandle;
1013 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
1014 performDragControllerAction(DragControllerActionPerformDrag, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
1016 performDragControllerAction(DragControllerActionPerformDrag, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionsForUpload);
1020 void WebPageProxy::performDragControllerAction(DragControllerAction action, DragData* dragData, const String& dragStorageName, const SandboxExtension::Handle& sandboxExtensionHandle, const SandboxExtension::HandleArray& sandboxExtensionsForUpload)
1025 // FIXME: We should pass the drag data map only on DragEnter.
1026 process()->send(Messages::WebPage::PerformDragControllerAction(action, dragData->clientPosition(), dragData->globalPosition(),
1027 dragData->draggingSourceOperationMask(), dragData->dragDataMap(), dragData->flags()), m_pageID);
1028 #elif PLATFORM(QT) || PLATFORM(GTK) || ENABLE(TIZEN_DRAG_SUPPORT)
1029 process()->send(Messages::WebPage::PerformDragControllerAction(action, *dragData), m_pageID);
1031 process()->send(Messages::WebPage::PerformDragControllerAction(action, dragData->clientPosition(), dragData->globalPosition(), dragData->draggingSourceOperationMask(), dragStorageName, dragData->flags(), sandboxExtensionHandle, sandboxExtensionsForUpload), m_pageID);
1035 void WebPageProxy::didPerformDragControllerAction(WebCore::DragSession dragSession)
1037 m_currentDragSession = dragSession;
1040 #if PLATFORM(QT) || PLATFORM(GTK) || ENABLE(TIZEN_DRAG_SUPPORT)
1041 void WebPageProxy::startDrag(const DragData& dragData, const ShareableBitmap::Handle& dragImageHandle)
1043 TIZEN_LOGI("dragData (%p)", dragData);
1044 RefPtr<ShareableBitmap> dragImage = 0;
1045 if (!dragImageHandle.isNull()) {
1046 dragImage = ShareableBitmap::create(dragImageHandle);
1051 m_pageClient->startDrag(dragData, dragImage.release());
1055 void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& globalPosition, uint64_t operation)
1057 TIZEN_LOGI("clientPosition (%p)", clientPosition);
1060 process()->send(Messages::WebPage::DragEnded(clientPosition, globalPosition, operation), m_pageID);
1062 #endif // ENABLE(DRAG_SUPPORT)
1064 void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event)
1069 // NOTE: This does not start the responsiveness timer because mouse move should not indicate interaction.
1070 if (event.type() != WebEvent::MouseMove)
1071 process()->responsivenessTimer()->start();
1073 if (m_processingMouseMoveEvent) {
1074 m_nextMouseMoveEvent = adoptPtr(new NativeWebMouseEvent(event));
1078 m_processingMouseMoveEvent = true;
1081 // <https://bugs.webkit.org/show_bug.cgi?id=57904> We need to keep track of the mouse down event in the case where we
1082 // display a popup menu for select elements. When the user changes the selected item,
1083 // we fake a mouse up event by using this stored down event. This event gets cleared
1084 // when the mouse up message is received from WebProcess.
1085 if (event.type() == WebEvent::MouseDown)
1086 m_currentlyProcessedMouseDownEvent = adoptPtr(new NativeWebMouseEvent(event));
1088 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
1089 // We have to hide text-selection's context menu when other area is clicked.
1090 // In case of normal context menu, it is hided by elm_ctxpopup's logic.
1091 if (event.type() == WebEvent::MouseDown)
1095 if (m_shouldSendEventsSynchronously) {
1096 bool handled = false;
1097 process()->sendSync(Messages::WebPage::MouseEventSyncForTesting(event), Messages::WebPage::MouseEventSyncForTesting::Reply(handled), m_pageID);
1098 didReceiveEvent(event.type(), handled);
1100 process()->send(Messages::WebPage::MouseEvent(event), m_pageID);
1103 #if MERGE_WHEEL_EVENTS
1104 static bool canCoalesce(const WebWheelEvent& a, const WebWheelEvent& b)
1106 if (a.position() != b.position())
1108 if (a.globalPosition() != b.globalPosition())
1110 if (a.modifiers() != b.modifiers())
1112 if (a.granularity() != b.granularity())
1115 if (a.phase() != b.phase())
1117 if (a.momentumPhase() != b.momentumPhase())
1119 if (a.hasPreciseScrollingDeltas() != b.hasPreciseScrollingDeltas())
1126 static WebWheelEvent coalesce(const WebWheelEvent& a, const WebWheelEvent& b)
1128 ASSERT(canCoalesce(a, b));
1130 FloatSize mergedDelta = a.delta() + b.delta();
1131 FloatSize mergedWheelTicks = a.wheelTicks() + b.wheelTicks();
1134 FloatSize mergedUnacceleratedScrollingDelta = a.unacceleratedScrollingDelta() + b.unacceleratedScrollingDelta();
1136 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());
1138 return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.modifiers(), b.timestamp());
1141 #endif // MERGE_WHEEL_EVENTS
1143 static WebWheelEvent coalescedWheelEvent(Deque<NativeWebWheelEvent>& queue, Vector<NativeWebWheelEvent>& coalescedEvents)
1145 ASSERT(!queue.isEmpty());
1146 ASSERT(coalescedEvents.isEmpty());
1148 #if MERGE_WHEEL_EVENTS
1149 NativeWebWheelEvent firstEvent = queue.takeFirst();
1150 coalescedEvents.append(firstEvent);
1152 WebWheelEvent event = firstEvent;
1153 while (!queue.isEmpty() && canCoalesce(event, queue.first())) {
1154 NativeWebWheelEvent firstEvent = queue.takeFirst();
1155 coalescedEvents.append(firstEvent);
1156 event = coalesce(event, firstEvent);
1161 while (!queue.isEmpty())
1162 coalescedEvents.append(queue.takeFirst());
1163 return coalescedEvents.last();
1167 void WebPageProxy::handleWheelEvent(const NativeWebWheelEvent& event)
1172 if (!m_currentlyProcessedWheelEvents.isEmpty()) {
1173 m_wheelEventQueue.append(event);
1174 if (m_wheelEventQueue.size() < wheelEventQueueSizeThreshold)
1176 // The queue has too many wheel events, so push a new event.
1179 if (!m_wheelEventQueue.isEmpty()) {
1180 processNextQueuedWheelEvent();
1184 OwnPtr<Vector<NativeWebWheelEvent> > coalescedWheelEvent = adoptPtr(new Vector<NativeWebWheelEvent>);
1185 coalescedWheelEvent->append(event);
1186 m_currentlyProcessedWheelEvents.append(coalescedWheelEvent.release());
1187 sendWheelEvent(event);
1190 void WebPageProxy::processNextQueuedWheelEvent()
1192 OwnPtr<Vector<NativeWebWheelEvent> > nextCoalescedEvent = adoptPtr(new Vector<NativeWebWheelEvent>);
1193 WebWheelEvent nextWheelEvent = coalescedWheelEvent(m_wheelEventQueue, *nextCoalescedEvent.get());
1194 m_currentlyProcessedWheelEvents.append(nextCoalescedEvent.release());
1195 sendWheelEvent(nextWheelEvent);
1198 void WebPageProxy::sendWheelEvent(const WebWheelEvent& event)
1200 process()->responsivenessTimer()->start();
1202 if (m_shouldSendEventsSynchronously) {
1203 bool handled = false;
1204 process()->sendSync(Messages::WebPage::WheelEventSyncForTesting(event), Messages::WebPage::WheelEventSyncForTesting::Reply(handled), m_pageID);
1205 didReceiveEvent(event.type(), handled);
1209 process()->send(Messages::EventDispatcher::WheelEvent(m_pageID, event, canGoBack(), canGoForward()), 0);
1212 void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event)
1217 LOG(KeyHandling, "WebPageProxy::handleKeyboardEvent: %s", webKeyboardEventTypeString(event.type()));
1219 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1220 if (!isWaitingForJavaScriptPopupReply()) {
1221 m_keyEventQueue.append(event);
1223 process()->responsivenessTimer()->start();
1224 if (m_shouldSendEventsSynchronously) {
1225 bool handled = false;
1226 process()->sendSync(Messages::WebPage::KeyEventSyncForTesting(event), Messages::WebPage::KeyEventSyncForTesting::Reply(handled), m_pageID);
1227 didReceiveEvent(event.type(), handled);
1229 process()->send(Messages::WebPage::KeyEvent(event), m_pageID);
1231 if (m_keyEventQueue.isEmpty()) {
1232 bool handled = false;
1233 m_pageClient->doneWithKeyEvent(event, handled);
1235 QueuedUIEvents<NativeWebKeyboardEvent>& lastEvent = m_keyEventQueue.last();
1236 lastEvent.deferredEvents.append(event);
1240 m_keyEventQueue.append(event);
1242 process()->responsivenessTimer()->start();
1243 if (m_shouldSendEventsSynchronously) {
1244 bool handled = false;
1245 process()->sendSync(Messages::WebPage::KeyEventSyncForTesting(event), Messages::WebPage::KeyEventSyncForTesting::Reply(handled), m_pageID);
1246 didReceiveEvent(event.type(), handled);
1247 } else if (m_keyEventQueue.size() == 1) // Otherwise, sent from DidReceiveEvent message handler.
1248 process()->send(Messages::WebPage::KeyEvent(event), m_pageID);
1252 #if ENABLE(GESTURE_EVENTS)
1253 void WebPageProxy::handleGestureEvent(const WebGestureEvent& event)
1258 #if ENABLE(TIZEN_ISF_PORT)
1259 if (event.type() == WebEvent::GestureSingleTap) {
1260 InputMethodContextEfl* inputMethodContext = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->inputMethodContext();
1261 if (inputMethodContext)
1262 inputMethodContext->resetIMFContext();
1266 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1267 if (!isWaitingForJavaScriptPopupReply()) {
1268 m_gestureEventQueue.append(event);
1270 process()->responsivenessTimer()->start();
1271 process()->send(Messages::EventDispatcher::GestureEvent(m_pageID, event), 0);
1273 if (m_gestureEventQueue.isEmpty()) {
1274 bool isEventHandled = false;
1275 m_pageClient->doneWithGestureEvent(event, isEventHandled);
1277 QueuedUIEvents<WebGestureEvent>& lastEvent = m_gestureEventQueue.last();
1278 lastEvent.deferredEvents.append(event);
1282 m_gestureEventQueue.append(event);
1284 process()->responsivenessTimer()->start();
1285 process()->send(Messages::EventDispatcher::GestureEvent(m_pageID, event), 0);
1290 #if ENABLE(TOUCH_EVENTS)
1292 void WebPageProxy::handlePotentialActivation(const IntPoint& touchPoint, const IntSize& touchArea)
1294 process()->send(Messages::WebPage::HighlightPotentialActivation(touchPoint, touchArea), m_pageID);
1298 void WebPageProxy::handleTouchEvent(const NativeWebTouchEvent& event)
1300 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
1301 if (!isValid() || isContentSuspendedByInspector())
1307 // If the page is suspended, which should be the case during panning, pinching
1308 // and animation on the page itself (kinetic scrolling, tap to zoom) etc, then
1309 // we do not send any of the events to the page even if is has listeners.
1310 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1311 if (m_needTouchEvents && !m_isPageSuspended && !isWaitingForJavaScriptPopupReply()) {
1313 if (m_needTouchEvents && !m_isPageSuspended) {
1316 // Do not send the TouchMove event if last TouchMove is not processed yet.
1317 // TouchMove event will be sent too many times without below codes,
1318 // and it will affect Web Applications' performance.
1319 if (event.type() == WebEvent::TouchMove
1320 && !m_touchEventQueue.isEmpty()
1321 && m_touchEventQueue.last().forwardedEvent.type() == event.type())
1324 m_touchEventQueue.append(event);
1325 process()->responsivenessTimer()->start();
1326 if (m_shouldSendEventsSynchronously) {
1327 bool handled = false;
1328 process()->sendSync(Messages::WebPage::TouchEventSyncForTesting(event), Messages::WebPage::TouchEventSyncForTesting::Reply(handled), m_pageID);
1329 didReceiveEvent(event.type(), handled);
1331 process()->send(Messages::WebPage::TouchEvent(event), m_pageID);
1333 if (m_touchEventQueue.isEmpty()) {
1334 bool isEventHandled = false;
1335 m_pageClient->doneWithTouchEvent(event, isEventHandled);
1337 // We attach the incoming events to the newest queued event so that all
1338 // the events are delivered in the correct order when the event is dequed.
1339 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1340 QueuedUIEvents<NativeWebTouchEvent>& lastEvent = m_touchEventQueue.last();
1341 lastEvent.deferredEvents.append(event);
1343 QueuedTouchEvents& lastEvent = m_touchEventQueue.last();
1344 lastEvent.deferredTouchEvents.append(event);
1351 #if ENABLE(SCREEN_ORIENTATION_SUPPORT) && ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT)
1352 void WebPageProxy::lockOrientation(int willLockOrientation, bool& result)
1354 result = m_pageClient->lockOrientation(willLockOrientation);
1356 void WebPageProxy::unlockOrientation()
1358 m_pageClient->unlockOrientation();
1362 void WebPageProxy::scrollBy(ScrollDirection direction, ScrollGranularity granularity)
1367 process()->send(Messages::WebPage::ScrollBy(direction, granularity), m_pageID);
1370 void WebPageProxy::centerSelectionInVisibleArea()
1375 process()->send(Messages::WebPage::CenterSelectionInVisibleArea(), m_pageID);
1378 #if ENABLE(TIZEN_DOWNLOAD_ATTRIBUTE)
1379 void WebPageProxy::startDownload(const ResourceRequest& request, const String& /*suggestedName*/)
1381 // FIXME: suggestedName need to be passed to provide a suggested destination file name
1382 m_process->context()->download(this, request);
1386 void WebPageProxy::receivedPolicyDecision(PolicyAction action, WebFrameProxy* frame, uint64_t listenerID)
1391 if (action == PolicyIgnore)
1392 clearPendingAPIRequestURL();
1394 uint64_t downloadID = 0;
1395 if (action == PolicyDownload) {
1396 // Create a download proxy.
1397 DownloadProxy* download = m_process->context()->createDownloadProxy();
1398 downloadID = download->downloadID();
1399 #if PLATFORM(QT) || PLATFORM(EFL)
1400 // Our design does not suppport downloads without a WebPage.
1401 handleDownloadRequest(download);
1405 // If we received a policy decision while in decidePolicyForResponse the decision will
1406 // be sent back to the web process by decidePolicyForResponse.
1407 if (m_inDecidePolicyForResponse) {
1408 m_syncMimeTypePolicyActionIsValid = true;
1409 m_syncMimeTypePolicyAction = action;
1410 m_syncMimeTypePolicyDownloadID = downloadID;
1414 // If we received a policy decision while in decidePolicyForNavigationAction the decision will
1415 // be sent back to the web process by decidePolicyForNavigationAction.
1416 if (m_inDecidePolicyForNavigationAction) {
1417 m_syncNavigationActionPolicyActionIsValid = true;
1418 m_syncNavigationActionPolicyAction = action;
1419 m_syncNavigationActionPolicyDownloadID = downloadID;
1423 process()->send(Messages::WebPage::DidReceivePolicyDecision(frame->frameID(), listenerID, action, downloadID), m_pageID);
1426 String WebPageProxy::pageTitle() const
1428 // Return the null string if there is no main frame (e.g. nothing has been loaded in the page yet, WebProcess has
1429 // crashed, page has been closed).
1433 return m_mainFrame->title();
1436 void WebPageProxy::setUserAgent(const String& userAgent)
1438 if (m_userAgent == userAgent)
1440 m_userAgent = userAgent;
1444 process()->send(Messages::WebPage::SetUserAgent(m_userAgent), m_pageID);
1447 void WebPageProxy::setApplicationNameForUserAgent(const String& applicationName)
1449 if (m_applicationNameForUserAgent == applicationName)
1452 m_applicationNameForUserAgent = applicationName;
1453 if (!m_customUserAgent.isEmpty())
1456 setUserAgent(standardUserAgent(m_applicationNameForUserAgent));
1459 void WebPageProxy::setCustomUserAgent(const String& customUserAgent)
1461 if (m_customUserAgent == customUserAgent)
1464 m_customUserAgent = customUserAgent;
1466 if (m_customUserAgent.isEmpty()) {
1467 setUserAgent(standardUserAgent(m_applicationNameForUserAgent));
1471 setUserAgent(m_customUserAgent);
1474 void WebPageProxy::resumeActiveDOMObjectsAndAnimations()
1476 if (!isValid() || !m_isPageSuspended)
1479 m_isPageSuspended = false;
1481 process()->send(Messages::WebPage::ResumeActiveDOMObjectsAndAnimations(), m_pageID);
1484 void WebPageProxy::suspendActiveDOMObjectsAndAnimations()
1486 if (!isValid() || m_isPageSuspended)
1489 m_isPageSuspended = true;
1491 process()->send(Messages::WebPage::SuspendActiveDOMObjectsAndAnimations(), m_pageID);
1494 bool WebPageProxy::supportsTextEncoding() const
1496 return !m_mainFrameHasCustomRepresentation && m_mainFrame && !m_mainFrame->isDisplayingStandaloneImageDocument();
1499 void WebPageProxy::setCustomTextEncodingName(const String& encodingName)
1501 if (m_customTextEncodingName == encodingName)
1503 m_customTextEncodingName = encodingName;
1507 process()->send(Messages::WebPage::SetCustomTextEncodingName(encodingName), m_pageID);
1510 void WebPageProxy::terminateProcess()
1512 // NOTE: This uses a check of m_isValid rather than calling isValid() since
1513 // we want this to run even for pages being closed or that already closed.
1517 process()->terminate();
1520 #if !USE(CF) || defined(BUILDING_QT__)
1521 PassRefPtr<WebData> WebPageProxy::sessionStateData(WebPageProxySessionStateFilterCallback, void* context) const
1523 // FIXME: Return session state data for saving Page state.
1527 void WebPageProxy::restoreFromSessionStateData(WebData*)
1529 // FIXME: Restore the Page from the passed in session state data.
1533 bool WebPageProxy::supportsTextZoom() const
1535 if (m_mainFrameHasCustomRepresentation)
1538 // FIXME: This should also return false for standalone media and plug-in documents.
1539 if (!m_mainFrame || m_mainFrame->isDisplayingStandaloneImageDocument())
1545 void WebPageProxy::setTextZoomFactor(double zoomFactor)
1550 if (m_mainFrameHasCustomRepresentation)
1553 if (m_textZoomFactor == zoomFactor)
1556 m_textZoomFactor = zoomFactor;
1557 process()->send(Messages::WebPage::SetTextZoomFactor(m_textZoomFactor), m_pageID);
1560 double WebPageProxy::pageZoomFactor() const
1562 return m_mainFrameHasCustomRepresentation ? m_pageClient->customRepresentationZoomFactor() : m_pageZoomFactor;
1565 void WebPageProxy::setPageZoomFactor(double zoomFactor)
1570 if (m_mainFrameHasCustomRepresentation) {
1571 m_pageClient->setCustomRepresentationZoomFactor(zoomFactor);
1575 if (m_pageZoomFactor == zoomFactor)
1578 m_pageZoomFactor = zoomFactor;
1579 process()->send(Messages::WebPage::SetPageZoomFactor(m_pageZoomFactor), m_pageID);
1582 void WebPageProxy::setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor)
1587 if (m_mainFrameHasCustomRepresentation) {
1588 m_pageClient->setCustomRepresentationZoomFactor(pageZoomFactor);
1592 if (m_pageZoomFactor == pageZoomFactor && m_textZoomFactor == textZoomFactor)
1595 m_pageZoomFactor = pageZoomFactor;
1596 m_textZoomFactor = textZoomFactor;
1597 process()->send(Messages::WebPage::SetPageAndTextZoomFactors(m_pageZoomFactor, m_textZoomFactor), m_pageID);
1600 void WebPageProxy::scalePage(double scale, const IntPoint& origin)
1605 process()->send(Messages::WebPage::ScalePage(scale, origin), m_pageID);
1608 void WebPageProxy::setIntrinsicDeviceScaleFactor(float scaleFactor)
1610 if (m_intrinsicDeviceScaleFactor == scaleFactor)
1613 m_intrinsicDeviceScaleFactor = scaleFactor;
1616 m_drawingArea->deviceScaleFactorDidChange();
1619 void WebPageProxy::windowScreenDidChange(PlatformDisplayID displayID)
1624 process()->send(Messages::WebPage::WindowScreenDidChange(displayID), m_pageID);
1627 float WebPageProxy::deviceScaleFactor() const
1629 if (m_customDeviceScaleFactor)
1630 return m_customDeviceScaleFactor;
1631 return m_intrinsicDeviceScaleFactor;
1634 void WebPageProxy::setCustomDeviceScaleFactor(float customScaleFactor)
1639 if (m_customDeviceScaleFactor == customScaleFactor)
1642 float oldScaleFactor = deviceScaleFactor();
1644 m_customDeviceScaleFactor = customScaleFactor;
1646 if (deviceScaleFactor() != oldScaleFactor)
1647 m_drawingArea->deviceScaleFactorDidChange();
1650 void WebPageProxy::setUseFixedLayout(bool fixed)
1655 // This check is fine as the value is initialized in the web
1656 // process as part of the creation parameters.
1657 if (fixed == m_useFixedLayout)
1660 m_useFixedLayout = fixed;
1662 m_fixedLayoutSize = IntSize();
1663 process()->send(Messages::WebPage::SetUseFixedLayout(fixed), m_pageID);
1666 void WebPageProxy::setFixedLayoutSize(const IntSize& size)
1671 if (size == m_fixedLayoutSize)
1674 m_fixedLayoutSize = size;
1675 process()->send(Messages::WebPage::SetFixedLayoutSize(size), m_pageID);
1678 void WebPageProxy::setPaginationMode(WebCore::Page::Pagination::Mode mode)
1680 if (mode == m_paginationMode)
1683 m_paginationMode = mode;
1687 process()->send(Messages::WebPage::SetPaginationMode(mode), m_pageID);
1690 void WebPageProxy::setPaginationBehavesLikeColumns(bool behavesLikeColumns)
1692 if (behavesLikeColumns == m_paginationBehavesLikeColumns)
1695 m_paginationBehavesLikeColumns = behavesLikeColumns;
1699 process()->send(Messages::WebPage::SetPaginationBehavesLikeColumns(behavesLikeColumns), m_pageID);
1702 void WebPageProxy::setPageLength(double pageLength)
1704 if (pageLength == m_pageLength)
1707 m_pageLength = pageLength;
1711 process()->send(Messages::WebPage::SetPageLength(pageLength), m_pageID);
1714 void WebPageProxy::setGapBetweenPages(double gap)
1716 if (gap == m_gapBetweenPages)
1719 m_gapBetweenPages = gap;
1723 process()->send(Messages::WebPage::SetGapBetweenPages(gap), m_pageID);
1726 void WebPageProxy::pageScaleFactorDidChange(double scaleFactor)
1728 m_pageScaleFactor = scaleFactor;
1729 m_pageClient->pageScaleFactorDidChange();
1732 void WebPageProxy::setMemoryCacheClientCallsEnabled(bool memoryCacheClientCallsEnabled)
1737 if (m_areMemoryCacheClientCallsEnabled == memoryCacheClientCallsEnabled)
1740 m_areMemoryCacheClientCallsEnabled = memoryCacheClientCallsEnabled;
1741 process()->send(Messages::WebPage::SetMemoryCacheMessagesEnabled(memoryCacheClientCallsEnabled), m_pageID);
1744 void WebPageProxy::findStringMatches(const String& string, FindOptions options, unsigned maxMatchCount)
1746 if (string.isEmpty()) {
1747 didFindStringMatches(string, Vector<Vector<WebCore::IntRect> > (), 0);
1751 m_process->send(Messages::WebPage::FindStringMatches(string, options, maxMatchCount), m_pageID);
1754 void WebPageProxy::findString(const String& string, FindOptions options, unsigned maxMatchCount)
1756 if (m_mainFrameHasCustomRepresentation)
1757 m_pageClient->findStringInCustomRepresentation(string, options, maxMatchCount);
1759 process()->send(Messages::WebPage::FindString(string, options, maxMatchCount), m_pageID);
1762 void WebPageProxy::getImageForFindMatch(int32_t matchIndex)
1764 m_process->send(Messages::WebPage::GetImageForFindMatch(matchIndex), m_pageID);
1767 void WebPageProxy::selectFindMatch(int32_t matchIndex)
1769 m_process->send(Messages::WebPage::SelectFindMatch(matchIndex), m_pageID);
1772 void WebPageProxy::hideFindUI()
1774 process()->send(Messages::WebPage::HideFindUI(), m_pageID);
1777 void WebPageProxy::countStringMatches(const String& string, FindOptions options, unsigned maxMatchCount)
1779 if (m_mainFrameHasCustomRepresentation) {
1780 m_pageClient->countStringMatchesInCustomRepresentation(string, options, maxMatchCount);
1787 process()->send(Messages::WebPage::CountStringMatches(string, options, maxMatchCount), m_pageID);
1790 void WebPageProxy::runJavaScriptInMainFrame(const String& script, PassRefPtr<ScriptValueCallback> prpCallback)
1792 RefPtr<ScriptValueCallback> callback = prpCallback;
1794 callback->invalidate();
1798 uint64_t callbackID = callback->callbackID();
1799 m_scriptValueCallbacks.set(callbackID, callback.get());
1800 process()->send(Messages::WebPage::RunJavaScriptInMainFrame(script, callbackID), m_pageID);
1803 void WebPageProxy::getRenderTreeExternalRepresentation(PassRefPtr<StringCallback> prpCallback)
1805 RefPtr<StringCallback> callback = prpCallback;
1807 callback->invalidate();
1811 uint64_t callbackID = callback->callbackID();
1812 m_stringCallbacks.set(callbackID, callback.get());
1813 process()->send(Messages::WebPage::GetRenderTreeExternalRepresentation(callbackID), m_pageID);
1816 void WebPageProxy::getSourceForFrame(WebFrameProxy* frame, PassRefPtr<StringCallback> prpCallback)
1818 RefPtr<StringCallback> callback = prpCallback;
1820 callback->invalidate();
1824 uint64_t callbackID = callback->callbackID();
1825 m_loadDependentStringCallbackIDs.add(callbackID);
1826 m_stringCallbacks.set(callbackID, callback.get());
1827 process()->send(Messages::WebPage::GetSourceForFrame(frame->frameID(), callbackID), m_pageID);
1830 #if ENABLE(WEB_INTENTS)
1831 void WebPageProxy::deliverIntentToFrame(WebFrameProxy* frame, WebIntentData* webIntentData)
1836 process()->send(Messages::WebPage::DeliverIntentToFrame(frame->frameID(), webIntentData->store()), m_pageID);
1840 void WebPageProxy::getContentsAsString(PassRefPtr<StringCallback> prpCallback)
1842 RefPtr<StringCallback> callback = prpCallback;
1844 callback->invalidate();
1848 uint64_t callbackID = callback->callbackID();
1849 m_loadDependentStringCallbackIDs.add(callbackID);
1850 m_stringCallbacks.set(callbackID, callback.get());
1851 process()->send(Messages::WebPage::GetContentsAsString(callbackID), m_pageID);
1855 void WebPageProxy::getContentsAsMHTMLData(PassRefPtr<DataCallback> prpCallback, bool useBinaryEncoding)
1857 RefPtr<DataCallback> callback = prpCallback;
1859 callback->invalidate();
1863 uint64_t callbackID = callback->callbackID();
1864 m_dataCallbacks.set(callbackID, callback.get());
1865 process()->send(Messages::WebPage::GetContentsAsMHTMLData(callbackID, useBinaryEncoding), m_pageID);
1869 void WebPageProxy::getSelectionOrContentsAsString(PassRefPtr<StringCallback> prpCallback)
1871 RefPtr<StringCallback> callback = prpCallback;
1873 callback->invalidate();
1877 uint64_t callbackID = callback->callbackID();
1878 m_stringCallbacks.set(callbackID, callback.get());
1879 process()->send(Messages::WebPage::GetSelectionOrContentsAsString(callbackID), m_pageID);
1882 void WebPageProxy::getMainResourceDataOfFrame(WebFrameProxy* frame, PassRefPtr<DataCallback> prpCallback)
1884 RefPtr<DataCallback> callback = prpCallback;
1886 callback->invalidate();
1890 uint64_t callbackID = callback->callbackID();
1891 m_dataCallbacks.set(callbackID, callback.get());
1892 process()->send(Messages::WebPage::GetMainResourceDataOfFrame(frame->frameID(), callbackID), m_pageID);
1895 void WebPageProxy::getResourceDataFromFrame(WebFrameProxy* frame, WebURL* resourceURL, PassRefPtr<DataCallback> prpCallback)
1897 RefPtr<DataCallback> callback = prpCallback;
1899 callback->invalidate();
1903 uint64_t callbackID = callback->callbackID();
1904 m_dataCallbacks.set(callbackID, callback.get());
1905 process()->send(Messages::WebPage::GetResourceDataFromFrame(frame->frameID(), resourceURL->string(), callbackID), m_pageID);
1908 void WebPageProxy::getWebArchiveOfFrame(WebFrameProxy* frame, PassRefPtr<DataCallback> prpCallback)
1910 RefPtr<DataCallback> callback = prpCallback;
1912 callback->invalidate();
1916 uint64_t callbackID = callback->callbackID();
1917 m_dataCallbacks.set(callbackID, callback.get());
1918 process()->send(Messages::WebPage::GetWebArchiveOfFrame(frame->frameID(), callbackID), m_pageID);
1921 void WebPageProxy::forceRepaint(PassRefPtr<VoidCallback> prpCallback)
1923 RefPtr<VoidCallback> callback = prpCallback;
1925 callback->invalidate();
1929 uint64_t callbackID = callback->callbackID();
1930 m_voidCallbacks.set(callbackID, callback.get());
1931 m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
1932 process()->send(Messages::WebPage::ForceRepaint(callbackID), m_pageID);
1935 void WebPageProxy::preferencesDidChange()
1940 #if ENABLE(INSPECTOR_SERVER)
1941 if (m_pageGroup->preferences()->developerExtrasEnabled())
1942 inspector()->enableRemoteInspection();
1945 // FIXME: It probably makes more sense to send individual preference changes.
1946 // However, WebKitTestRunner depends on getting a preference change notification
1947 // even if nothing changed in UI process, so that overrides get removed.
1949 // Preferences need to be updated during synchronous printing to make "print backgrounds" preference work when toggled from a print dialog checkbox.
1950 process()->send(Messages::WebPage::PreferencesDidChange(pageGroup()->preferences()->store()), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
1953 void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
1955 if (messageID.is<CoreIPC::MessageClassDrawingAreaProxy>()) {
1956 m_drawingArea->didReceiveDrawingAreaProxyMessage(connection, messageID, arguments);
1960 #if USE(UI_SIDE_COMPOSITING)
1961 if (messageID.is<CoreIPC::MessageClassLayerTreeCoordinatorProxy>()) {
1962 m_drawingArea->didReceiveLayerTreeCoordinatorProxyMessage(connection, messageID, arguments);
1967 #if ENABLE(INSPECTOR)
1968 if (messageID.is<CoreIPC::MessageClassWebInspectorProxy>()) {
1969 if (WebInspectorProxy* inspector = this->inspector())
1970 inspector->didReceiveWebInspectorProxyMessage(connection, messageID, arguments);
1975 #if ENABLE(FULLSCREEN_API)
1976 if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) {
1977 fullScreenManager()->didReceiveMessage(connection, messageID, arguments);
1982 didReceiveWebPageProxyMessage(connection, messageID, arguments);
1985 void WebPageProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
1987 #if ENABLE(INSPECTOR)
1988 if (messageID.is<CoreIPC::MessageClassWebInspectorProxy>()) {
1989 if (WebInspectorProxy* inspector = this->inspector())
1990 inspector->didReceiveSyncWebInspectorProxyMessage(connection, messageID, arguments, reply);
1995 #if ENABLE(FULLSCREEN_API)
1996 if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) {
1997 fullScreenManager()->didReceiveSyncMessage(connection, messageID, arguments, reply);
2002 // FIXME: Do something with reply.
2003 didReceiveSyncWebPageProxyMessage(connection, messageID, arguments, reply);
2006 void WebPageProxy::didCreateMainFrame(uint64_t frameID)
2008 MESSAGE_CHECK(!m_mainFrame);
2009 MESSAGE_CHECK(process()->canCreateFrame(frameID));
2011 m_mainFrame = WebFrameProxy::create(this, frameID);
2013 // Add the frame to the process wide map.
2014 process()->frameCreated(frameID, m_mainFrame.get());
2017 void WebPageProxy::didCreateSubframe(uint64_t frameID, uint64_t parentFrameID)
2019 MESSAGE_CHECK(m_mainFrame);
2021 WebFrameProxy* parentFrame = process()->webFrame(parentFrameID);
2022 MESSAGE_CHECK(parentFrame);
2023 MESSAGE_CHECK(parentFrame->isDescendantOf(m_mainFrame.get()));
2025 MESSAGE_CHECK(process()->canCreateFrame(frameID));
2027 RefPtr<WebFrameProxy> subFrame = WebFrameProxy::create(this, frameID);
2029 // Add the frame to the process wide map.
2030 process()->frameCreated(frameID, subFrame.get());
2032 // Insert the frame into the frame hierarchy.
2033 parentFrame->appendChild(subFrame.get());
2036 static bool isDisconnectedFrame(WebFrameProxy* frame)
2038 return !frame->page() || !frame->page()->mainFrame() || !frame->isDescendantOf(frame->page()->mainFrame());
2041 void WebPageProxy::didSaveFrameToPageCache(uint64_t frameID)
2043 MESSAGE_CHECK(m_mainFrame);
2045 WebFrameProxy* subframe = process()->webFrame(frameID);
2046 MESSAGE_CHECK(subframe);
2048 if (isDisconnectedFrame(subframe))
2051 MESSAGE_CHECK(subframe->isDescendantOf(m_mainFrame.get()));
2053 subframe->didRemoveFromHierarchy();
2056 void WebPageProxy::didRestoreFrameFromPageCache(uint64_t frameID, uint64_t parentFrameID)
2058 MESSAGE_CHECK(m_mainFrame);
2060 WebFrameProxy* subframe = process()->webFrame(frameID);
2061 MESSAGE_CHECK(subframe);
2062 MESSAGE_CHECK(!subframe->parentFrame());
2063 MESSAGE_CHECK(subframe->page() == m_mainFrame->page());
2065 WebFrameProxy* parentFrame = process()->webFrame(parentFrameID);
2066 MESSAGE_CHECK(parentFrame);
2067 MESSAGE_CHECK(parentFrame->isDescendantOf(m_mainFrame.get()));
2069 // Insert the frame into the frame hierarchy.
2070 parentFrame->appendChild(subframe);
2074 // Always start progress at initialProgressValue. This helps provide feedback as
2075 // soon as a load starts.
2077 static const double initialProgressValue = 0.1;
2079 double WebPageProxy::estimatedProgress() const
2081 if (!pendingAPIRequestURL().isNull())
2082 return initialProgressValue;
2083 return m_estimatedProgress;
2086 void WebPageProxy::didStartProgress()
2088 m_estimatedProgress = initialProgressValue;
2090 m_loaderClient.didStartProgress(this);
2093 void WebPageProxy::didChangeProgress(double value)
2095 m_estimatedProgress = value;
2097 m_loaderClient.didChangeProgress(this);
2100 void WebPageProxy::didFinishProgress()
2102 m_estimatedProgress = 1.0;
2104 m_loaderClient.didFinishProgress(this);
2107 #if ENABLE(WEB_INTENTS_TAG)
2108 void WebPageProxy::registerIntentServiceForFrame(uint64_t frameID, const IntentServiceInfo& serviceInfo, CoreIPC::ArgumentDecoder* arguments)
2110 RefPtr<APIObject> userData;
2111 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2112 if (!arguments->decode(messageDecoder))
2115 WebFrameProxy* frame = process()->webFrame(frameID);
2116 MESSAGE_CHECK(frame);
2118 RefPtr<WebIntentServiceInfo> webIntentServiceInfo = WebIntentServiceInfo::create(serviceInfo);
2119 m_loaderClient.registerIntentServiceForFrame(this, frame, webIntentServiceInfo.get(), userData.get());
2123 void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::ArgumentDecoder* arguments)
2125 clearPendingAPIRequestURL();
2127 RefPtr<APIObject> userData;
2128 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2129 if (!arguments->decode(messageDecoder))
2132 WebFrameProxy* frame = process()->webFrame(frameID);
2133 MESSAGE_CHECK(frame);
2134 MESSAGE_CHECK_URL(url);
2136 frame->setUnreachableURL(unreachableURL);
2138 frame->didStartProvisionalLoad(url);
2139 m_loaderClient.didStartProvisionalLoadForFrame(this, frame, userData.get());
2142 void WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, const String& url, CoreIPC::ArgumentDecoder* arguments)
2144 RefPtr<APIObject> userData;
2145 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2146 if (!arguments->decode(messageDecoder))
2149 WebFrameProxy* frame = process()->webFrame(frameID);
2150 MESSAGE_CHECK(frame);
2151 MESSAGE_CHECK_URL(url);
2153 frame->didReceiveServerRedirectForProvisionalLoad(url);
2155 m_loaderClient.didReceiveServerRedirectForProvisionalLoadForFrame(this, frame, userData.get());
2158 void WebPageProxy::didFailProvisionalLoadForFrame(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
2160 RefPtr<APIObject> userData;
2161 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2162 if (!arguments->decode(messageDecoder))
2165 WebFrameProxy* frame = process()->webFrame(frameID);
2166 MESSAGE_CHECK(frame);
2168 frame->didFailProvisionalLoad();
2170 m_loaderClient.didFailProvisionalLoadWithErrorForFrame(this, frame, error, userData.get());
2173 void WebPageProxy::clearLoadDependentCallbacks()
2175 Vector<uint64_t> callbackIDsCopy;
2176 copyToVector(m_loadDependentStringCallbackIDs, callbackIDsCopy);
2177 m_loadDependentStringCallbackIDs.clear();
2179 for (size_t i = 0; i < callbackIDsCopy.size(); ++i) {
2180 RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackIDsCopy[i]);
2182 callback->invalidate();
2186 void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, const PlatformCertificateInfo& certificateInfo, CoreIPC::ArgumentDecoder* arguments)
2188 RefPtr<APIObject> userData;
2189 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2190 if (!arguments->decode(messageDecoder))
2193 WebFrameProxy* frame = process()->webFrame(frameID);
2194 MESSAGE_CHECK(frame);
2197 // FIXME (bug 59111): didCommitLoadForFrame comes too late when restoring a page from b/f cache, making us disable secure event mode in password fields.
2198 // FIXME (bug 59121): A load going on in one frame shouldn't affect typing in sibling frames.
2199 m_pageClient->resetTextInputState();
2200 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
2201 // FIXME: Should this be moved inside resetTextInputState()?
2202 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
2203 m_pageClient->dismissDictionaryLookupPanel();
2207 clearLoadDependentCallbacks();
2209 frame->didCommitLoad(mimeType, certificateInfo);
2211 if (frame->isMainFrame()) {
2212 m_mainFrameHasCustomRepresentation = frameHasCustomRepresentation;
2214 if (m_mainFrameHasCustomRepresentation) {
2215 // Always assume that the main frame is pinned here, since the custom representation view will handle
2216 // any wheel events and dispatch them to the WKView when necessary.
2217 m_mainFrameIsPinnedToLeftSide = true;
2218 m_mainFrameIsPinnedToRightSide = true;
2220 m_pageClient->didCommitLoadForMainFrame(frameHasCustomRepresentation);
2223 m_loaderClient.didCommitLoadForFrame(this, frame, userData.get());
2226 void WebPageProxy::didFinishDocumentLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2228 RefPtr<APIObject> userData;
2229 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2230 if (!arguments->decode(messageDecoder))
2233 WebFrameProxy* frame = process()->webFrame(frameID);
2234 MESSAGE_CHECK(frame);
2236 m_loaderClient.didFinishDocumentLoadForFrame(this, frame, userData.get());
2239 #if ENABLE(TIZEN_NATIVE_MEMORY_SNAPSHOT)
2240 const char* isMemorySnapshot = getenv("TIZEN_MEMORY_SNAPSHOT");
2242 void WebPageProxy::didFinishLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2244 RefPtr<APIObject> userData;
2245 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2246 if (!arguments->decode(messageDecoder))
2249 WebFrameProxy* frame = process()->webFrame(frameID);
2250 MESSAGE_CHECK(frame);
2252 frame->didFinishLoad();
2254 m_loaderClient.didFinishLoadForFrame(this, frame, userData.get());
2255 #if ENABLE(TIZEN_NATIVE_MEMORY_SNAPSHOT)
2256 if (isMemorySnapshot && isMemorySnapshot[0] != '0')
2257 dumpMemorySnapshot();
2261 void WebPageProxy::didFailLoadForFrame(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
2263 RefPtr<APIObject> userData;
2264 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2265 if (!arguments->decode(messageDecoder))
2268 WebFrameProxy* frame = process()->webFrame(frameID);
2269 MESSAGE_CHECK(frame);
2271 clearLoadDependentCallbacks();
2273 frame->didFailLoad();
2275 m_loaderClient.didFailLoadWithErrorForFrame(this, frame, error, userData.get());
2278 void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t opaqueSameDocumentNavigationType, const String& url, CoreIPC::ArgumentDecoder* arguments)
2280 RefPtr<APIObject> userData;
2281 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2282 if (!arguments->decode(messageDecoder))
2285 WebFrameProxy* frame = process()->webFrame(frameID);
2286 MESSAGE_CHECK(frame);
2287 MESSAGE_CHECK_URL(url);
2289 clearPendingAPIRequestURL();
2290 frame->didSameDocumentNavigation(url);
2292 m_loaderClient.didSameDocumentNavigationForFrame(this, frame, static_cast<SameDocumentNavigationType>(opaqueSameDocumentNavigationType), userData.get());
2295 void WebPageProxy::didReceiveTitleForFrame(uint64_t frameID, const String& title, CoreIPC::ArgumentDecoder* arguments)
2297 RefPtr<APIObject> userData;
2298 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2299 if (!arguments->decode(messageDecoder))
2302 WebFrameProxy* frame = process()->webFrame(frameID);
2303 MESSAGE_CHECK(frame);
2305 frame->didChangeTitle(title);
2307 m_loaderClient.didReceiveTitleForFrame(this, title, frame, userData.get());
2310 void WebPageProxy::didFirstLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2312 RefPtr<APIObject> userData;
2313 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2314 if (!arguments->decode(messageDecoder))
2317 WebFrameProxy* frame = process()->webFrame(frameID);
2318 MESSAGE_CHECK(frame);
2320 m_loaderClient.didFirstLayoutForFrame(this, frame, userData.get());
2323 void WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2325 RefPtr<APIObject> userData;
2326 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2327 if (!arguments->decode(messageDecoder))
2330 WebFrameProxy* frame = process()->webFrame(frameID);
2331 MESSAGE_CHECK(frame);
2334 if (frame->isMainFrame())
2335 m_pageClient->didFirstVisuallyNonEmptyLayoutForMainFrame();
2338 m_loaderClient.didFirstVisuallyNonEmptyLayoutForFrame(this, frame, userData.get());
2341 void WebPageProxy::didNewFirstVisuallyNonEmptyLayout(CoreIPC::ArgumentDecoder* arguments)
2343 RefPtr<APIObject> userData;
2344 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2345 if (!arguments->decode(messageDecoder))
2348 m_loaderClient.didNewFirstVisuallyNonEmptyLayout(this, userData.get());
2351 void WebPageProxy::didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2353 RefPtr<APIObject> userData;
2354 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2355 if (!arguments->decode(messageDecoder))
2358 WebFrameProxy* frame = process()->webFrame(frameID);
2359 MESSAGE_CHECK(frame);
2361 frame->didRemoveFromHierarchy();
2363 m_loaderClient.didRemoveFrameFromHierarchy(this, frame, userData.get());
2366 void WebPageProxy::didDisplayInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2368 RefPtr<APIObject> userData;
2369 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2370 if (!arguments->decode(messageDecoder))
2373 WebFrameProxy* frame = process()->webFrame(frameID);
2374 MESSAGE_CHECK(frame);
2376 m_loaderClient.didDisplayInsecureContentForFrame(this, frame, userData.get());
2379 void WebPageProxy::didRunInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2381 RefPtr<APIObject> userData;
2382 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2383 if (!arguments->decode(messageDecoder))
2386 WebFrameProxy* frame = process()->webFrame(frameID);
2387 MESSAGE_CHECK(frame);
2389 m_loaderClient.didRunInsecureContentForFrame(this, frame, userData.get());
2392 void WebPageProxy::didDetectXSSForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2394 RefPtr<APIObject> userData;
2395 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2396 if (!arguments->decode(messageDecoder))
2399 WebFrameProxy* frame = process()->webFrame(frameID);
2400 MESSAGE_CHECK(frame);
2402 m_loaderClient.didDetectXSSForFrame(this, frame, userData.get());
2405 #if ENABLE(WEB_INTENTS)
2406 void WebPageProxy::didReceiveIntentForFrame(uint64_t frameID, const IntentData& intentData, CoreIPC::ArgumentDecoder* arguments)
2408 RefPtr<APIObject> userData;
2409 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2410 if (!arguments->decode(messageDecoder))
2413 WebFrameProxy* frame = process()->webFrame(frameID);
2414 MESSAGE_CHECK(frame);
2416 RefPtr<WebIntentData> webIntentData = WebIntentData::create(intentData);
2417 m_loaderClient.didReceiveIntentForFrame(this, frame, webIntentData.get(), userData.get());
2421 void WebPageProxy::frameDidBecomeFrameSet(uint64_t frameID, bool value)
2423 WebFrameProxy* frame = process()->webFrame(frameID);
2424 MESSAGE_CHECK(frame);
2426 frame->setIsFrameSet(value);
2427 if (frame->isMainFrame())
2428 m_frameSetLargestFrame = value ? m_mainFrame : 0;
2432 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)
2434 RefPtr<APIObject> userData;
2435 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2436 if (!arguments->decode(messageDecoder))
2439 if (request.url() != pendingAPIRequestURL())
2440 clearPendingAPIRequestURL();
2442 WebFrameProxy* frame = process()->webFrame(frameID);
2443 MESSAGE_CHECK(frame);
2444 MESSAGE_CHECK_URL(request.url());
2446 NavigationType navigationType = static_cast<NavigationType>(opaqueNavigationType);
2447 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
2448 WebMouseEvent::Button mouseButton = static_cast<WebMouseEvent::Button>(opaqueMouseButton);
2450 RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
2452 ASSERT(!m_inDecidePolicyForNavigationAction);
2454 m_inDecidePolicyForNavigationAction = true;
2455 m_syncNavigationActionPolicyActionIsValid = false;
2457 if (!m_policyClient.decidePolicyForNavigationAction(this, frame, navigationType, modifiers, mouseButton, request, listener.get(), userData.get()))
2460 m_inDecidePolicyForNavigationAction = false;
2462 // Check if we received a policy decision already. If we did, we can just pass it back.
2463 receivedPolicyAction = m_syncNavigationActionPolicyActionIsValid;
2464 if (m_syncNavigationActionPolicyActionIsValid) {
2465 policyAction = m_syncNavigationActionPolicyAction;
2466 downloadID = m_syncNavigationActionPolicyDownloadID;
2470 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)
2472 RefPtr<APIObject> userData;
2473 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2474 if (!arguments->decode(messageDecoder))
2477 WebFrameProxy* frame = process()->webFrame(frameID);
2478 MESSAGE_CHECK(frame);
2479 MESSAGE_CHECK_URL(request.url());
2481 NavigationType navigationType = static_cast<NavigationType>(opaqueNavigationType);
2482 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
2483 WebMouseEvent::Button mouseButton = static_cast<WebMouseEvent::Button>(opaqueMouseButton);
2485 RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
2486 if (!m_policyClient.decidePolicyForNewWindowAction(this, frame, navigationType, modifiers, mouseButton, request, frameName, listener.get(), userData.get()))
2490 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)
2492 RefPtr<APIObject> userData;
2493 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2494 if (!arguments->decode(messageDecoder))
2497 WebFrameProxy* frame = process()->webFrame(frameID);
2498 MESSAGE_CHECK(frame);
2499 MESSAGE_CHECK_URL(request.url());
2500 MESSAGE_CHECK_URL(response.url());
2502 RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
2504 ASSERT(!m_inDecidePolicyForResponse);
2506 m_inDecidePolicyForResponse = true;
2507 m_syncMimeTypePolicyActionIsValid = false;
2509 if (!m_policyClient.decidePolicyForResponse(this, frame, response, request, listener.get(), userData.get()))
2512 m_inDecidePolicyForResponse = false;
2514 // Check if we received a policy decision already. If we did, we can just pass it back.
2515 receivedPolicyAction = m_syncMimeTypePolicyActionIsValid;
2516 if (m_syncMimeTypePolicyActionIsValid) {
2517 policyAction = m_syncMimeTypePolicyAction;
2518 downloadID = m_syncMimeTypePolicyDownloadID;
2522 void WebPageProxy::unableToImplementPolicy(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
2524 RefPtr<APIObject> userData;
2525 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2526 if (!arguments->decode(messageDecoder))
2529 WebFrameProxy* frame = process()->webFrame(frameID);
2530 MESSAGE_CHECK(frame);
2532 m_policyClient.unableToImplementPolicy(this, frame, error, userData.get());
2537 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
2538 void WebPageProxy::willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const StringPairVector& textFieldValues, bool containsPasswordData, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments)
2540 void WebPageProxy::willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const StringPairVector& textFieldValues, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments)
2543 RefPtr<APIObject> userData;
2544 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2545 if (!arguments->decode(messageDecoder))
2548 WebFrameProxy* frame = process()->webFrame(frameID);
2549 MESSAGE_CHECK(frame);
2551 WebFrameProxy* sourceFrame = process()->webFrame(sourceFrameID);
2552 MESSAGE_CHECK(sourceFrame);
2554 RefPtr<WebFormSubmissionListenerProxy> listener = frame->setUpFormSubmissionListenerProxy(listenerID);
2555 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
2556 if (!m_formClient.willSubmitForm(this, frame, sourceFrame, textFieldValues.stringPairVector(), containsPasswordData, userData.get(), listener.get()))
2558 if (!m_formClient.willSubmitForm(this, frame, sourceFrame, textFieldValues.stringPairVector(), userData.get(), listener.get()))
2560 listener->continueSubmission();
2563 // ResourceLoad Client
2565 void WebPageProxy::didInitiateLoadForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceRequest& request, bool pageIsProvisionallyLoading)
2567 WebFrameProxy* frame = process()->webFrame(frameID);
2568 MESSAGE_CHECK(frame);
2569 MESSAGE_CHECK_URL(request.url());
2571 m_resourceLoadClient.didInitiateLoadForResource(this, frame, resourceIdentifier, request, pageIsProvisionallyLoading);
2574 void WebPageProxy::didSendRequestForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceRequest& request, const ResourceResponse& redirectResponse)
2576 WebFrameProxy* frame = process()->webFrame(frameID);
2577 MESSAGE_CHECK(frame);
2578 MESSAGE_CHECK_URL(request.url());
2580 m_resourceLoadClient.didSendRequestForResource(this, frame, resourceIdentifier, request, redirectResponse);
2583 void WebPageProxy::didReceiveResponseForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceResponse& response)
2585 WebFrameProxy* frame = process()->webFrame(frameID);
2586 MESSAGE_CHECK(frame);
2587 MESSAGE_CHECK_URL(response.url());
2589 m_resourceLoadClient.didReceiveResponseForResource(this, frame, resourceIdentifier, response);
2592 void WebPageProxy::didReceiveContentLengthForResource(uint64_t frameID, uint64_t resourceIdentifier, uint64_t contentLength)
2594 WebFrameProxy* frame = process()->webFrame(frameID);
2595 MESSAGE_CHECK(frame);
2597 m_resourceLoadClient.didReceiveContentLengthForResource(this, frame, resourceIdentifier, contentLength);
2600 void WebPageProxy::didFinishLoadForResource(uint64_t frameID, uint64_t resourceIdentifier)
2602 WebFrameProxy* frame = process()->webFrame(frameID);
2603 MESSAGE_CHECK(frame);
2605 m_resourceLoadClient.didFinishLoadForResource(this, frame, resourceIdentifier);
2608 void WebPageProxy::didFailLoadForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceError& error)
2610 WebFrameProxy* frame = process()->webFrame(frameID);
2611 MESSAGE_CHECK(frame);
2613 m_resourceLoadClient.didFailLoadForResource(this, frame, resourceIdentifier, error);
2618 void WebPageProxy::createNewPage(const ResourceRequest& request, const WindowFeatures& windowFeatures, uint32_t opaqueModifiers, int32_t opaqueMouseButton, uint64_t& newPageID, WebPageCreationParameters& newPageParameters)
2620 RefPtr<WebPageProxy> newPage = m_uiClient.createNewPage(this, request, windowFeatures, static_cast<WebEvent::Modifiers>(opaqueModifiers), static_cast<WebMouseEvent::Button>(opaqueMouseButton));
2622 newPageID = newPage->pageID();
2623 newPageParameters = newPage->creationParameters();
2628 void WebPageProxy::showPage()
2630 m_uiClient.showPage(this);
2633 void WebPageProxy::closePage(bool stopResponsivenessTimer)
2635 if (stopResponsivenessTimer)
2636 process()->responsivenessTimer()->stop();
2638 m_pageClient->clearAllEditCommands();
2639 m_uiClient.close(this);
2642 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2643 bool WebPageProxy::isWaitingForJavaScriptPopupReply()
2645 #if ENABLE(TIZEN_SUPPORT_BEFORE_UNLOAD_CONFIRM_PANEL)
2646 return m_alertReply || m_confirmReply || m_promptReply || m_beforeUnloadConfirmPanelReply;
2648 return m_alertReply || m_confirmReply || m_promptReply;
2654 void WebPageProxy::runJavaScriptAlert(uint64_t frameID, const String& message, PassRefPtr<Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply> reply)
2656 WebFrameProxy* frame = process()->webFrame(frameID);
2657 MESSAGE_CHECK(frame);
2659 // Since runJavaScriptAlert() can spin a nested run loop we need to turn off the responsiveness timer.
2660 process()->responsivenessTimer()->stop();
2662 m_alertReply = reply;
2663 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
2664 m_uiClient.notifyPopupReplyWaitingState(this, true);
2666 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2667 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2669 if (!m_uiClient.runJavaScriptAlert(this, message, frame))
2670 replyJavaScriptAlert();
2673 void WebPageProxy::runJavaScriptConfirm(uint64_t frameID, const String& message, PassRefPtr<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply> reply)
2675 WebFrameProxy* frame = process()->webFrame(frameID);
2676 MESSAGE_CHECK(frame);
2678 // Since runJavaScriptConfirm() can spin a nested run loop we need to turn off the responsiveness timer.
2679 process()->responsivenessTimer()->stop();
2681 m_confirmReply = reply;
2682 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
2683 m_uiClient.notifyPopupReplyWaitingState(this, true);
2685 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2686 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2688 if (!m_uiClient.runJavaScriptConfirm(this, message, frame))
2689 replyJavaScriptConfirm(false);
2692 void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const String& message, const String& defaultValue, PassRefPtr<Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply> reply)
2694 WebFrameProxy* frame = process()->webFrame(frameID);
2695 MESSAGE_CHECK(frame);
2697 // Since runJavaScriptPrompt() can spin a nested run loop we need to turn off the responsiveness timer.
2698 process()->responsivenessTimer()->stop();
2700 m_promptReply = reply;
2701 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
2702 m_uiClient.notifyPopupReplyWaitingState(this, true);
2704 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2705 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2707 if (!m_uiClient.runJavaScriptPrompt(this, message, defaultValue, frame))
2708 replyJavaScriptPrompt(String());
2711 void WebPageProxy::runJavaScriptAlert(uint64_t frameID, const String& message)
2713 WebFrameProxy* frame = process()->webFrame(frameID);
2714 MESSAGE_CHECK(frame);
2716 // Since runJavaScriptAlert() can spin a nested run loop we need to turn off the responsiveness timer.
2717 process()->responsivenessTimer()->stop();
2719 m_uiClient.runJavaScriptAlert(this, message, frame);
2722 void WebPageProxy::runJavaScriptConfirm(uint64_t frameID, const String& message, bool& result)
2724 WebFrameProxy* frame = process()->webFrame(frameID);
2725 MESSAGE_CHECK(frame);
2727 // Since runJavaScriptConfirm() can spin a nested run loop we need to turn off the responsiveness timer.
2728 process()->responsivenessTimer()->stop();
2730 result = m_uiClient.runJavaScriptConfirm(this, message, frame);
2733 void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const String& message, const String& defaultValue, String& result)
2735 WebFrameProxy* frame = process()->webFrame(frameID);
2736 MESSAGE_CHECK(frame);
2738 // Since runJavaScriptPrompt() can spin a nested run loop we need to turn off the responsiveness timer.
2739 process()->responsivenessTimer()->stop();
2741 result = m_uiClient.runJavaScriptPrompt(this, message, defaultValue, frame);
2745 void WebPageProxy::shouldInterruptJavaScript(bool& result)
2747 // Since shouldInterruptJavaScript() can spin a nested run loop we need to turn off the responsiveness timer.
2748 process()->responsivenessTimer()->stop();
2750 result = m_uiClient.shouldInterruptJavaScript(this);
2753 void WebPageProxy::setStatusText(const String& text)
2755 m_uiClient.setStatusText(this, text);
2758 void WebPageProxy::mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t opaqueModifiers, CoreIPC::ArgumentDecoder* arguments)
2760 RefPtr<APIObject> userData;
2761 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2762 if (!arguments->decode(messageDecoder))
2765 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
2767 m_uiClient.mouseDidMoveOverElement(this, hitTestResultData, modifiers, userData.get());
2770 void WebPageProxy::unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& url, const String& pluginsPageURL)
2772 MESSAGE_CHECK_URL(url);
2773 MESSAGE_CHECK_URL(pluginsPageURL);
2775 WKPluginUnavailabilityReason pluginUnavailabilityReason = static_cast<WKPluginUnavailabilityReason>(opaquePluginUnavailabilityReason);
2776 m_uiClient.unavailablePluginButtonClicked(this, pluginUnavailabilityReason, mimeType, url, pluginsPageURL);
2779 void WebPageProxy::setToolbarsAreVisible(bool toolbarsAreVisible)
2781 m_uiClient.setToolbarsAreVisible(this, toolbarsAreVisible);
2784 void WebPageProxy::getToolbarsAreVisible(bool& toolbarsAreVisible)
2786 toolbarsAreVisible = m_uiClient.toolbarsAreVisible(this);
2789 void WebPageProxy::setMenuBarIsVisible(bool menuBarIsVisible)
2791 m_uiClient.setMenuBarIsVisible(this, menuBarIsVisible);
2794 void WebPageProxy::getMenuBarIsVisible(bool& menuBarIsVisible)
2796 menuBarIsVisible = m_uiClient.menuBarIsVisible(this);
2799 void WebPageProxy::setStatusBarIsVisible(bool statusBarIsVisible)
2801 m_uiClient.setStatusBarIsVisible(this, statusBarIsVisible);
2804 void WebPageProxy::getStatusBarIsVisible(bool& statusBarIsVisible)
2806 statusBarIsVisible = m_uiClient.statusBarIsVisible(this);
2809 void WebPageProxy::setIsResizable(bool isResizable)
2811 m_uiClient.setIsResizable(this, isResizable);
2814 void WebPageProxy::getIsResizable(bool& isResizable)
2816 isResizable = m_uiClient.isResizable(this);
2819 void WebPageProxy::setWindowFrame(const FloatRect& newWindowFrame)
2821 m_uiClient.setWindowFrame(this, m_pageClient->convertToDeviceSpace(newWindowFrame));
2824 void WebPageProxy::getWindowFrame(FloatRect& newWindowFrame)
2826 newWindowFrame = m_pageClient->convertToUserSpace(m_uiClient.windowFrame(this));
2829 void WebPageProxy::screenToWindow(const IntPoint& screenPoint, IntPoint& windowPoint)
2831 windowPoint = m_pageClient->screenToWindow(screenPoint);
2834 void WebPageProxy::windowToScreen(const IntRect& viewRect, IntRect& result)
2836 result = m_pageClient->windowToScreen(viewRect);
2839 #if ENABLE(TIZEN_SUPPORT_BEFORE_UNLOAD_CONFIRM_PANEL)
2840 void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, PassRefPtr<Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply> reply)
2842 WebFrameProxy* frame = process()->webFrame(frameID);
2843 MESSAGE_CHECK(frame);
2845 // Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer.
2846 process()->responsivenessTimer()->stop();
2848 m_beforeUnloadConfirmPanelReply = reply;
2849 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2850 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2852 if (!m_uiClient.runBeforeUnloadConfirmPanel(this, message, frame))
2853 replyBeforeUnloadConfirmPanel(false);
2856 void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose)
2858 WebFrameProxy* frame = process()->webFrame(frameID);
2859 MESSAGE_CHECK(frame);
2861 // Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer.
2862 process()->responsivenessTimer()->stop();
2864 shouldClose = m_uiClient.runBeforeUnloadConfirmPanel(this, message, frame);
2868 #if USE(TILED_BACKING_STORE)
2869 void WebPageProxy::pageDidRequestScroll(const IntPoint& point)
2871 m_pageClient->pageDidRequestScroll(point);
2875 void WebPageProxy::didChangeViewportProperties(const ViewportAttributes& attr)
2877 m_pageClient->didChangeViewportProperties(attr);
2880 void WebPageProxy::pageDidScroll()
2882 m_uiClient.pageDidScroll(this);
2883 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
2884 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
2888 void WebPageProxy::runOpenPanel(uint64_t frameID, const FileChooserSettings& settings)
2890 if (m_openPanelResultListener) {
2891 m_openPanelResultListener->invalidate();
2892 m_openPanelResultListener = 0;
2895 WebFrameProxy* frame = process()->webFrame(frameID);
2896 MESSAGE_CHECK(frame);
2898 RefPtr<WebOpenPanelParameters> parameters = WebOpenPanelParameters::create(settings);
2899 m_openPanelResultListener = WebOpenPanelResultListenerProxy::create(this);
2901 // Since runOpenPanel() can spin a nested run loop we need to turn off the responsiveness timer.
2902 process()->responsivenessTimer()->stop();
2904 if (!m_uiClient.runOpenPanel(this, frame, parameters.get(), m_openPanelResultListener.get()))
2905 didCancelForOpenPanel();
2908 void WebPageProxy::printFrame(uint64_t frameID)
2910 ASSERT(!m_isPerformingDOMPrintOperation);
2911 m_isPerformingDOMPrintOperation = true;
2913 WebFrameProxy* frame = process()->webFrame(frameID);
2914 MESSAGE_CHECK(frame);
2916 m_uiClient.printFrame(this, frame);
2918 endPrinting(); // Send a message synchronously while m_isPerformingDOMPrintOperation is still true.
2919 m_isPerformingDOMPrintOperation = false;
2922 void WebPageProxy::printMainFrame()
2924 printFrame(m_mainFrame->frameID());
2927 #if ENABLE(TIZEN_REGISTER_PROTOCOL_HANDLER)
2928 void WebPageProxy::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title)
2930 m_pageClient->registerProtocolHandler(scheme, baseURL, url, title);
2934 #if ENABLE(TIZEN_CUSTOM_SCHEME_HANDLER)
2935 void WebPageProxy::isProtocolHandlerRegistered(const String& scheme, const String& baseURL, const String& url, unsigned int& result)
2937 result = m_pageClient->isProtocolHandlerRegistered(scheme, baseURL, url);
2939 void WebPageProxy::unregisterProtocolHandler(const String& scheme, const String& baseURL, const String& url)
2941 m_pageClient->unregisterProtocolHandler(scheme, baseURL, url);
2945 #if ENABLE(TIZEN_REGISTER_CONTENT_HANDLER)
2946 void WebPageProxy::registerContentHandler(const String& mimeType, const String& baseURL, const String& url, const String& title)
2948 m_pageClient->registerContentHandler(mimeType, baseURL, url, title);
2951 void WebPageProxy::isContentHandlerRegistered(const String& mimeType, const String& baseURL, const String& url, unsigned int& result)
2953 result = m_pageClient->isContentHandlerRegistered(mimeType, baseURL, url);
2956 void WebPageProxy::unregisterContentHandler(const String& mimeType, const String& baseURL, const String& url)
2958 m_pageClient->unregisterContentHandler(mimeType, baseURL, url);
2962 #if ENABLE(TIZEN_SEARCH_PROVIDER)
2963 void WebPageProxy::addSearchProvider(const String& baseURL, const String& engineURL)
2965 m_pageClient->addSearchProvider(baseURL, engineURL);
2968 void WebPageProxy::isSearchProviderInstalled(const String& baseURL, const String& engineURL, uint64_t& result)
2970 result = m_pageClient->isSearchProviderInstalled(baseURL, engineURL);
2974 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
2975 void WebPageProxy::getStandaloneStatus(bool& standalone)
2977 standalone = m_pageClient->getStandaloneStatus();
2980 void WebPageProxy::getWebAppCapable(PassRefPtr<BooleanCallback> prpCallback)
2982 RefPtr<BooleanCallback> callback = prpCallback;
2984 callback->invalidate();
2988 uint64_t callbackID = callback->callbackID();
2989 m_booleanCallbacks.set(callbackID, callback.get());
2990 process()->send(Messages::WebPage::GetWebAppCapable(callbackID), m_pageID);
2993 void WebPageProxy::didGetWebAppCapable(const bool capable, uint64_t callbackID)
2995 RefPtr<BooleanCallback> callback = m_booleanCallbacks.take(callbackID);
2996 m_booleanCallbacks.remove(callbackID);
2997 callback->performCallbackWithReturnValue(WebBoolean::create(capable).leakRef());
3000 void WebPageProxy::getWebAppIconURL(PassRefPtr<StringCallback> prpCallback)
3002 RefPtr<StringCallback> callback = prpCallback;
3004 callback->invalidate();
3008 uint64_t callbackID = callback->callbackID();
3009 m_stringCallbacks.set(callbackID, callback.get());
3010 process()->send(Messages::WebPage::GetWebAppIconURL(callbackID), m_pageID);
3013 void WebPageProxy::didGetWebAppIconURL(const String& iconURL, uint64_t callbackID)
3015 RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackID);
3017 // FIXME: Log error or assert.
3018 // this can validly happen if a load invalidated the callback, though
3022 m_stringCallbacks.remove(callbackID);
3023 callback->performCallbackWithReturnValue(iconURL.impl());
3026 void WebPageProxy::getWebAppIconURLs(PassRefPtr<DictionaryCallback> prpCallback)
3028 RefPtr<DictionaryCallback> callback = prpCallback;
3030 callback->invalidate();
3034 uint64_t callbackID = callback->callbackID();
3035 m_dictionaryCallbacks.set(callbackID, callback.get());
3036 process()->send(Messages::WebPage::GetWebAppIconURLs(callbackID), m_pageID);
3039 void WebPageProxy::didGetWebAppIconURLs(const StringPairVector& iconURLs, uint64_t callbackID)
3041 RefPtr<DictionaryCallback> callback = m_dictionaryCallbacks.take(callbackID);
3042 ImmutableDictionary::MapType iconURLList;
3043 size_t iconURLCount = iconURLs.stringPairVector().size();
3044 for (size_t i = 0; i < iconURLCount; ++i)
3045 iconURLList.set(iconURLs.stringPairVector()[i].first, WebString::create(iconURLs.stringPairVector()[i].second));
3047 callback->performCallbackWithReturnValue(ImmutableDictionary::adopt(iconURLList).get());
3051 void WebPageProxy::setMediaVolume(float volume)
3053 if (volume == m_mediaVolume)
3056 m_mediaVolume = volume;
3061 process()->send(Messages::WebPage::SetMediaVolume(volume), m_pageID);
3065 void WebPageProxy::didChangeContentsSize(const IntSize& size)
3067 m_pageClient->didChangeContentsSize(size);
3070 void WebPageProxy::didFindZoomableArea(const IntPoint& target, const IntRect& area)
3072 m_pageClient->didFindZoomableArea(target, area);
3075 void WebPageProxy::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
3080 process()->send(Messages::WebPage::FindZoomableAreaForPoint(point, area), m_pageID);
3083 void WebPageProxy::didReceiveMessageFromNavigatorQtObject(const String& contents)
3085 m_pageClient->didReceiveMessageFromNavigatorQtObject(contents);
3088 void WebPageProxy::authenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password)
3090 m_pageClient->handleAuthenticationRequiredRequest(hostname, realm, prefilledUsername, username, password);
3093 void WebPageProxy::proxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password)
3095 m_pageClient->handleProxyAuthenticationRequiredRequest(hostname, port, prefilledUsername, username, password);
3098 void WebPageProxy::certificateVerificationRequest(const String& hostname, bool& ignoreErrors)
3100 m_pageClient->handleCertificateVerificationRequest(hostname, ignoreErrors);
3102 #endif // PLATFORM(QT).
3105 void WebPageProxy::didFindZoomableArea(const IntPoint& target, const IntRect& area)
3107 m_pageClient->didFindZoomableArea(target, area);
3110 void WebPageProxy::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
3115 process()->send(Messages::WebPage::FindZoomableAreaForPoint(point, area), m_pageID);
3117 #endif // #if OS(TIZEN)
3119 #if PLATFORM(QT) || PLATFORM(EFL)
3120 void WebPageProxy::handleDownloadRequest(DownloadProxy* download)
3122 m_pageClient->handleDownloadRequest(download);
3124 #endif // PLATFORM(QT) || PLATFORM(EFL)
3126 #if ENABLE(TOUCH_EVENTS)
3127 void WebPageProxy::needTouchEvents(bool needTouchEvents)
3129 m_needTouchEvents = needTouchEvents;
3130 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
3131 // We don't have to ask overflow if we need touch events,
3132 // because we will check overflow in the web process when touch event is processed.
3133 m_askOverflow = !m_needTouchEvents;
3138 #if ENABLE(INPUT_TYPE_COLOR)
3139 void WebPageProxy::showColorChooser(const WebCore::Color& initialColor)
3141 ASSERT(!m_colorChooser);
3143 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3144 if (m_colorPickerResultListener) {
3145 m_colorPickerResultListener->invalidate();
3146 m_colorPickerResultListener = nullptr;
3149 m_colorPickerResultListener = WebColorPickerResultListenerProxy::create(this);
3150 m_colorChooser = WebColorChooserProxy::create(this);
3152 if (m_uiClient.showColorPicker(this, initialColor.serialized(), m_colorPickerResultListener.get()))
3156 m_colorChooser = m_pageClient->createColorChooserProxy(this, initialColor);
3157 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3158 if (!m_colorChooser)
3159 didEndColorChooser();
3163 void WebPageProxy::setColorChooserColor(const WebCore::Color& color)
3165 ASSERT(m_colorChooser);
3167 m_colorChooser->setSelectedColor(color);
3170 void WebPageProxy::endColorChooser()
3172 ASSERT(m_colorChooser);
3174 m_colorChooser->endChooser();
3177 void WebPageProxy::didChooseColor(const WebCore::Color& color)
3182 process()->send(Messages::WebPage::DidChooseColor(color), m_pageID);
3185 void WebPageProxy::didEndColorChooser()
3190 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3191 if (m_colorChooser) {
3192 m_colorChooser->invalidate();
3193 m_colorChooser = nullptr;
3196 ASSERT(m_colorChooser);
3198 m_colorChooser->invalidate();
3199 m_colorChooser = nullptr;
3202 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3203 m_process->send(Messages::WebPage::DidEndColorChooser(), m_pageID);
3205 m_colorPickerResultListener->invalidate();
3206 m_colorPickerResultListener = nullptr;
3208 m_uiClient.hideColorPicker(this);
3210 process()->send(Messages::WebPage::DidEndColorChooser(), m_pageID);
3215 void WebPageProxy::didDraw()
3217 m_uiClient.didDraw(this);
3222 #if ENABLE(INSPECTOR)
3224 WebInspectorProxy* WebPageProxy::inspector()
3226 if (isClosed() || !isValid())
3229 m_inspector = WebInspectorProxy::create(this);
3230 return m_inspector.get();
3235 #if ENABLE(FULLSCREEN_API)
3236 WebFullScreenManagerProxy* WebPageProxy::fullScreenManager()
3238 if (!m_fullScreenManager)
3239 m_fullScreenManager = WebFullScreenManagerProxy::create(this);
3240 return m_fullScreenManager.get();
3246 void WebPageProxy::backForwardAddItem(uint64_t itemID)
3248 m_backForwardList->addItem(process()->webBackForwardItem(itemID));
3251 void WebPageProxy::backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle& sandboxExtensionHandle)
3253 WebBackForwardListItem* item = process()->webBackForwardItem(itemID);
3257 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), item->url()), sandboxExtensionHandle);
3258 if (createdExtension)
3259 process()->willAcquireUniversalFileReadSandboxExtension();
3260 m_backForwardList->goToItem(item);
3263 void WebPageProxy::backForwardItemAtIndex(int32_t index, uint64_t& itemID)
3265 WebBackForwardListItem* item = m_backForwardList->itemAtIndex(index);
3266 itemID = item ? item->itemID() : 0;
3269 void WebPageProxy::backForwardBackListCount(int32_t& count)
3271 count = m_backForwardList->backListCount();
3274 void WebPageProxy::backForwardForwardListCount(int32_t& count)
3276 count = m_backForwardList->forwardListCount();
3279 void WebPageProxy::editorStateChanged(const EditorState& editorState)
3282 bool couldChangeSecureInputState = m_editorState.isInPasswordField != editorState.isInPasswordField || m_editorState.selectionIsNone;
3285 m_editorState = editorState;
3288 m_pageClient->updateTextInputState(couldChangeSecureInputState);
3289 #elif PLATFORM(QT) || PLATFORM(EFL)
3290 m_pageClient->updateTextInputState();
3296 void WebPageProxy::registerEditCommandForUndo(uint64_t commandID, uint32_t editAction)
3298 registerEditCommand(WebEditCommandProxy::create(commandID, static_cast<EditAction>(editAction), this), Undo);
3301 void WebPageProxy::canUndoRedo(uint32_t action, bool& result)
3303 result = m_pageClient->canUndoRedo(static_cast<UndoOrRedo>(action));
3306 void WebPageProxy::executeUndoRedo(uint32_t action, bool& result)
3308 m_pageClient->executeUndoRedo(static_cast<UndoOrRedo>(action));
3312 void WebPageProxy::clearAllEditCommands()
3314 m_pageClient->clearAllEditCommands();
3317 void WebPageProxy::didCountStringMatches(const String& string, uint32_t matchCount)
3319 m_findClient.didCountStringMatches(this, string, matchCount);
3322 void WebPageProxy::didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex)
3324 m_findMatchesClient.didGetImageForMatchResult(this, WebImage::create(ShareableBitmap::create(contentImageHandle)).get(), matchIndex);
3327 void WebPageProxy::setFindIndicator(const FloatRect& selectionRectInWindowCoordinates, const Vector<FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut, bool animate)
3329 RefPtr<FindIndicator> findIndicator = FindIndicator::create(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, contentImageScaleFactor, contentImageHandle);
3330 m_pageClient->setFindIndicator(findIndicator.release(), fadeOut, animate);
3333 void WebPageProxy::didFindString(const String& string, uint32_t matchCount)
3335 m_findClient.didFindString(this, string, matchCount);
3338 void WebPageProxy::didFindStringMatches(const String& string, Vector<Vector<WebCore::IntRect> > matchRects, int32_t firstIndexAfterSelection)
3340 Vector<RefPtr<APIObject> > matches;
3341 matches.reserveInitialCapacity(matchRects.size());
3343 for (size_t i = 0; i < matchRects.size(); ++i) {
3344 const Vector<WebCore::IntRect>& rects = matchRects[i];
3345 size_t numRects = matchRects[i].size();
3346 Vector<RefPtr<APIObject> > apiRects;
3347 apiRects.reserveInitialCapacity(numRects);
3349 for (size_t i = 0; i < numRects; ++i)
3350 apiRects.uncheckedAppend(WebRect::create(toAPI(rects[i])));
3351 matches.uncheckedAppend(ImmutableArray::adopt(apiRects));
3353 m_findMatchesClient.didFindStringMatches(this, string, ImmutableArray::adopt(matches).get(), firstIndexAfterSelection);
3356 void WebPageProxy::didFailToFindString(const String& string)
3358 m_findClient.didFailToFindString(this, string);
3361 void WebPageProxy::valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex)
3363 process()->send(Messages::WebPage::DidChangeSelectedIndexForActivePopupMenu(newSelectedIndex), m_pageID);
3366 void WebPageProxy::setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index)
3368 process()->send(Messages::WebPage::SetTextForActivePopupMenu(index), m_pageID);
3371 NativeWebMouseEvent* WebPageProxy::currentlyProcessedMouseDownEvent()
3373 return m_currentlyProcessedMouseDownEvent.get();
3377 void WebPageProxy::failedToShowPopupMenu()
3379 process()->send(Messages::WebPage::FailedToShowPopupMenu(), m_pageID);
3383 void WebPageProxy::showPopupMenu(const IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData& data)
3385 if (m_activePopupMenu) {
3386 m_activePopupMenu->hidePopupMenu();
3387 m_activePopupMenu->invalidate();
3388 m_activePopupMenu = 0;
3391 m_activePopupMenu = m_pageClient->createPopupMenuProxy(this);
3393 // Since showPopupMenu() can spin a nested run loop we need to turn off the responsiveness timer.
3394 process()->responsivenessTimer()->stop();
3396 RefPtr<WebPopupMenuProxy> protectedActivePopupMenu = m_activePopupMenu;
3398 protectedActivePopupMenu->showPopupMenu(rect, static_cast<TextDirection>(textDirection), m_pageScaleFactor, items, data, selectedIndex);
3400 // 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.
3401 #if !PLATFORM(QT) && !PLATFORM(EFL)
3402 protectedActivePopupMenu->invalidate();
3404 protectedActivePopupMenu = 0;
3407 void WebPageProxy::hidePopupMenu()
3409 if (!m_activePopupMenu)
3412 m_activePopupMenu->hidePopupMenu();
3413 m_activePopupMenu->invalidate();
3414 m_activePopupMenu = 0;
3417 #if ENABLE(TIZEN_WEBKIT2_POPUP_INTERNAL)
3418 void WebPageProxy::updatePopupMenu(uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex)
3420 if (!m_activePopupMenu)
3423 m_activePopupMenu->updatePopupMenu(static_cast<TextDirection>(textDirection), items, selectedIndex);
3427 #if ENABLE(CONTEXT_MENUS)
3428 void WebPageProxy::showContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::ArgumentDecoder* arguments)
3430 internalShowContextMenu(menuLocation, hitTestResultData, proposedItems, arguments);
3432 // No matter the result of internalShowContextMenu, always notify the WebProcess that the menu is hidden so it starts handling mouse events again.
3433 process()->send(Messages::WebPage::ContextMenuHidden(), m_pageID);
3436 void WebPageProxy::internalShowContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::ArgumentDecoder* arguments)
3438 RefPtr<APIObject> userData;
3439 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
3440 if (!arguments->decode(messageDecoder))
3443 m_activeContextMenuHitTestResultData = hitTestResultData;
3445 if (m_activeContextMenu) {
3446 m_activeContextMenu->hideContextMenu();
3447 m_activeContextMenu = 0;
3450 m_activeContextMenu = m_pageClient->createContextMenuProxy(this);
3452 // Since showContextMenu() can spin a nested run loop we need to turn off the responsiveness timer.
3453 process()->responsivenessTimer()->stop();
3455 // Give the PageContextMenuClient one last swipe at changing the menu.
3456 Vector<WebContextMenuItemData> items;
3457 if (!m_contextMenuClient.getContextMenuFromProposedMenu(this, proposedItems, items, hitTestResultData, userData.get()))
3458 m_activeContextMenu->showContextMenu(menuLocation, proposedItems);
3460 m_activeContextMenu->showContextMenu(menuLocation, items);
3462 m_contextMenuClient.contextMenuDismissed(this);
3465 void WebPageProxy::contextMenuItemSelected(const WebContextMenuItemData& item)
3467 TIZEN_LOGI("selected item : action(%d), title(%s)", item.action(), item.title().utf8().data());
3468 // Application custom items don't need to round-trip through to WebCore in the WebProcess.
3469 if (item.action() >= ContextMenuItemBaseApplicationTag) {
3470 m_contextMenuClient.customContextMenuItemSelected(this, item);
3471 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
3472 m_pageClient->setIsTextSelectionMode(false);
3478 if (item.action() == ContextMenuItemTagSmartCopyPaste) {
3479 setSmartInsertDeleteEnabled(!isSmartInsertDeleteEnabled());
3482 if (item.action() == ContextMenuItemTagSmartQuotes) {
3483 TextChecker::setAutomaticQuoteSubstitutionEnabled(!TextChecker::state().isAutomaticQuoteSubstitutionEnabled);
3484 process()->updateTextCheckerState();
3487 if (item.action() == ContextMenuItemTagSmartDashes) {
3488 TextChecker::setAutomaticDashSubstitutionEnabled(!TextChecker::state().isAutomaticDashSubstitutionEnabled);
3489 process()->updateTextCheckerState();
3492 if (item.action() == ContextMenuItemTagSmartLinks) {
3493 TextChecker::setAutomaticLinkDetectionEnabled(!TextChecker::state().isAutomaticLinkDetectionEnabled);
3494 process()->updateTextCheckerState();
3497 if (item.action() == ContextMenuItemTagTextReplacement) {
3498 TextChecker::setAutomaticTextReplacementEnabled(!TextChecker::state().isAutomaticTextReplacementEnabled);
3499 process()->updateTextCheckerState();
3502 if (item.action() == ContextMenuItemTagCorrectSpellingAutomatically) {
3503 TextChecker::setAutomaticSpellingCorrectionEnabled(!TextChecker::state().isAutomaticSpellingCorrectionEnabled);
3504 process()->updateTextCheckerState();
3507 if (item.action() == ContextMenuItemTagShowSubstitutions) {
3508 TextChecker::toggleSubstitutionsPanelIsShowing();
3512 if (item.action() == ContextMenuItemTagDownloadImageToDisk) {
3513 m_process->context()->download(this, KURL(KURL(), m_activeContextMenuHitTestResultData.absoluteImageURL));
3516 if (item.action() == ContextMenuItemTagDownloadLinkToDisk) {
3517 m_process->context()->download(this, KURL(KURL(), m_activeContextMenuHitTestResultData.absoluteLinkURL));
3520 if (item.action() == ContextMenuItemTagCheckSpellingWhileTyping) {
3521 TextChecker::setContinuousSpellCheckingEnabled(!TextChecker::state().isContinuousSpellCheckingEnabled);
3522 process()->updateTextCheckerState();
3525 if (item.action() == ContextMenuItemTagCheckGrammarWithSpelling) {
3526 TextChecker::setGrammarCheckingEnabled(!TextChecker::state().isGrammarCheckingEnabled);
3527 process()->updateTextCheckerState();
3530 if (item.action() == ContextMenuItemTagShowSpellingPanel) {
3531 if (!TextChecker::spellingUIIsShowing())
3532 advanceToNextMisspelling(true);
3533 TextChecker::toggleSpellingUIIsShowing();
3536 if (item.action() == ContextMenuItemTagLearnSpelling || item.action() == ContextMenuItemTagIgnoreSpelling)
3537 ++m_pendingLearnOrIgnoreWordMessageCount;
3539 #if ENABLE(TIZEN_WEBKIT2_CLIPBOARD_HELPER)
3540 if (item.action() == ContextMenuItemTagPaste) {
3541 pasteContextMenuSelected();
3546 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_TEXT_SELECTION_MODE)
3547 if (item.action() == ContextMenuItemTagTextSelectionMode) {
3548 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
3549 m_pageClient->setIsTextSelectionMode(true);
3552 evas_object_focus_set(viewWidget(), true);
3553 WebCore::IntPoint positionForSelection = m_activeContextMenu->positionForSelection();
3554 bool result = false;
3555 process()->sendSync(Messages::WebPage::SelectLink(positionForSelection), Messages::WebPage::SelectLink::Reply(result), m_pageID);
3556 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
3557 if (result == false)
3558 m_pageClient->setIsTextSelectionMode(false);
3565 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
3566 if (item.action() == ContextMenuItemTagClipboard) {
3567 clipboardContextMenuSelected();
3572 #if ENABLE(CONTEXT_MENUS)
3573 process()->send(Messages::WebPage::DidSelectItemFromActiveContextMenu(item), m_pageID);
3576 #endif // ENABLE(CONTEXT_MENUS)
3578 void WebPageProxy::didChooseFilesForOpenPanel(const Vector<String>& fileURLs)
3583 #if ENABLE(WEB_PROCESS_SANDBOX)
3584 // FIXME: The sandbox extensions should be sent with the DidChooseFilesForOpenPanel message. This
3585 // is gated on a way of passing SandboxExtension::Handles in a Vector.
3586 for (size_t i = 0; i < fileURLs.size(); ++i) {
3587 SandboxExtension::Handle sandboxExtensionHandle;
3588 SandboxExtension::createHandle(fileURLs[i], SandboxExtension::ReadOnly, sandboxExtensionHandle);
3589 process()->send(Messages::WebPage::ExtendSandboxForFileFromOpenPanel(sandboxExtensionHandle), m_pageID);
3593 process()->send(Messages::WebPage::DidChooseFilesForOpenPanel(fileURLs), m_pageID);
3595 m_openPanelResultListener->invalidate();
3596 m_openPanelResultListener = 0;
3599 void WebPageProxy::didCancelForOpenPanel()
3604 process()->send(Messages::WebPage::DidCancelForOpenPanel(), m_pageID);
3606 m_openPanelResultListener->invalidate();
3607 m_openPanelResultListener = 0;
3610 void WebPageProxy::advanceToNextMisspelling(bool startBeforeSelection) const
3612 process()->send(Messages::WebPage::AdvanceToNextMisspelling(startBeforeSelection), m_pageID);
3615 void WebPageProxy::changeSpellingToWord(const String& word) const
3620 process()->send(Messages::WebPage::ChangeSpellingToWord(word), m_pageID);
3623 void WebPageProxy::registerEditCommand(PassRefPtr<WebEditCommandProxy> commandProxy, UndoOrRedo undoOrRedo)
3625 m_pageClient->registerEditCommand(commandProxy, undoOrRedo);
3628 void WebPageProxy::addEditCommand(WebEditCommandProxy* command)
3630 m_editCommandSet.add(command);
3633 void WebPageProxy::removeEditCommand(WebEditCommandProxy* command)
3635 m_editCommandSet.remove(command);
3639 process()->send(Messages::WebPage::DidRemoveEditCommand(command->commandID()), m_pageID);
3642 bool WebPageProxy::isValidEditCommand(WebEditCommandProxy* command)
3644 return m_editCommandSet.find(command) != m_editCommandSet.end();
3647 int64_t WebPageProxy::spellDocumentTag()
3649 if (!m_hasSpellDocumentTag) {
3650 m_spellDocumentTag = TextChecker::uniqueSpellDocumentTag(this);
3651 m_hasSpellDocumentTag = true;
3654 return m_spellDocumentTag;
3657 #if USE(UNIFIED_TEXT_CHECKING)
3658 void WebPageProxy::checkTextOfParagraph(const String& text, uint64_t checkingTypes, Vector<TextCheckingResult>& results)
3660 results = TextChecker::checkTextOfParagraph(spellDocumentTag(), text.characters(), text.length(), checkingTypes);
3664 void WebPageProxy::checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength)
3666 TextChecker::checkSpellingOfString(spellDocumentTag(), text.characters(), text.length(), misspellingLocation, misspellingLength);
3669 void WebPageProxy::checkGrammarOfString(const String& text, Vector<GrammarDetail>& grammarDetails, int32_t& badGrammarLocation, int32_t& badGrammarLength)
3671 TextChecker::checkGrammarOfString(spellDocumentTag(), text.characters(), text.length(), grammarDetails, badGrammarLocation, badGrammarLength);
3674 void WebPageProxy::spellingUIIsShowing(bool& isShowing)
3676 isShowing = TextChecker::spellingUIIsShowing();
3679 void WebPageProxy::updateSpellingUIWithMisspelledWord(const String& misspelledWord)
3681 TextChecker::updateSpellingUIWithMisspelledWord(spellDocumentTag(), misspelledWord);
3684 void WebPageProxy::updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const GrammarDetail& grammarDetail)
3686 TextChecker::updateSpellingUIWithGrammarString(spellDocumentTag(), badGrammarPhrase, grammarDetail);
3689 void WebPageProxy::getGuessesForWord(const String& word, const String& context, Vector<String>& guesses)
3691 TextChecker::getGuessesForWord(spellDocumentTag(), word, context, guesses);
3694 void WebPageProxy::learnWord(const String& word)
3696 MESSAGE_CHECK(m_pendingLearnOrIgnoreWordMessageCount);
3697 --m_pendingLearnOrIgnoreWordMessageCount;
3699 TextChecker::learnWord(spellDocumentTag(), word);
3702 void WebPageProxy::ignoreWord(const String& word)
3704 MESSAGE_CHECK(m_pendingLearnOrIgnoreWordMessageCount);
3705 --m_pendingLearnOrIgnoreWordMessageCount;
3707 TextChecker::ignoreWord(spellDocumentTag(), word);
3712 void WebPageProxy::setFocus(bool focused)
3715 m_uiClient.focus(this);
3717 m_uiClient.unfocus(this);
3720 void WebPageProxy::takeFocus(uint32_t direction)
3722 m_uiClient.takeFocus(this, (static_cast<FocusDirection>(direction) == FocusDirectionForward) ? kWKFocusDirectionForward : kWKFocusDirectionBackward);
3725 void WebPageProxy::setToolTip(const String& toolTip)
3727 String oldToolTip = m_toolTip;
3728 m_toolTip = toolTip;
3729 m_pageClient->toolTipChanged(oldToolTip, m_toolTip);
3732 void WebPageProxy::setCursor(const WebCore::Cursor& cursor)
3734 m_pageClient->setCursor(cursor);
3737 void WebPageProxy::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
3739 m_pageClient->setCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves);
3742 void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
3744 WebEvent::Type type = static_cast<WebEvent::Type>(opaqueType);
3747 case WebEvent::NoType:
3748 case WebEvent::MouseMove:
3751 case WebEvent::MouseDown:
3752 case WebEvent::MouseUp:
3753 case WebEvent::Wheel:
3754 case WebEvent::KeyDown:
3755 case WebEvent::KeyUp:
3756 case WebEvent::RawKeyDown:
3757 case WebEvent::Char:
3758 #if ENABLE(GESTURE_EVENTS)
3759 case WebEvent::GestureScrollBegin:
3760 case WebEvent::GestureScrollEnd:
3761 case WebEvent::GestureSingleTap:
3763 #if ENABLE(TOUCH_EVENTS)
3764 case WebEvent::TouchStart:
3765 case WebEvent::TouchMove:
3766 case WebEvent::TouchEnd:
3767 case WebEvent::TouchCancel:
3769 process()->responsivenessTimer()->stop();
3774 case WebEvent::NoType:
3776 case WebEvent::MouseMove:
3777 m_processingMouseMoveEvent = false;
3778 if (m_nextMouseMoveEvent) {
3779 handleMouseEvent(*m_nextMouseMoveEvent);
3780 m_nextMouseMoveEvent = nullptr;
3783 case WebEvent::MouseDown:
3785 #if ENABLE(GESTURE_EVENTS)
3786 case WebEvent::GestureScrollBegin:
3787 case WebEvent::GestureScrollEnd:
3788 case WebEvent::GestureSingleTap: {
3789 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3790 QueuedUIEvents<WebGestureEvent> queuedEvents = m_gestureEventQueue.first();
3791 MESSAGE_CHECK(type == queuedEvents.forwardedEvent.type());
3792 m_gestureEventQueue.removeFirst();
3794 m_pageClient->doneWithGestureEvent(queuedEvents.forwardedEvent, handled);
3795 for (size_t i = 0; i < queuedEvents.deferredEvents.size(); ++i) {
3796 bool isEventHandled = false;
3797 m_pageClient->doneWithGestureEvent(queuedEvents.deferredEvents.at(i), isEventHandled);
3800 WebGestureEvent event = m_gestureEventQueue.first();
3801 MESSAGE_CHECK(type == event.type());
3803 m_gestureEventQueue.removeFirst();
3804 m_pageClient->doneWithGestureEvent(event, handled);
3806 #if ENABLE(TIZEN_ISF_PORT)
3807 if (type == WebEvent::GestureSingleTap)
3808 evas_object_focus_set(viewWidget(), true);
3813 case WebEvent::MouseUp:
3814 m_currentlyProcessedMouseDownEvent = nullptr;
3817 case WebEvent::Wheel: {
3818 ASSERT(!m_currentlyProcessedWheelEvents.isEmpty());
3820 OwnPtr<Vector<NativeWebWheelEvent> > oldestCoalescedEvent = m_currentlyProcessedWheelEvents.takeFirst();
3822 // FIXME: Dispatch additional events to the didNotHandleWheelEvent client function.
3823 if (!handled && m_uiClient.implementsDidNotHandleWheelEvent())
3824 m_uiClient.didNotHandleWheelEvent(this, oldestCoalescedEvent->last());
3826 if (!m_wheelEventQueue.isEmpty())
3827 processNextQueuedWheelEvent();
3831 case WebEvent::KeyDown:
3832 case WebEvent::KeyUp:
3833 case WebEvent::RawKeyDown:
3834 case WebEvent::Char: {
3835 LOG(KeyHandling, "WebPageProxy::didReceiveEvent: %s", webKeyboardEventTypeString(type));
3837 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3838 QueuedUIEvents<NativeWebKeyboardEvent> queuedEvents = m_keyEventQueue.first();
3839 NativeWebKeyboardEvent event = queuedEvents.forwardedEvent;
3840 MESSAGE_CHECK(type == event.type());
3841 m_keyEventQueue.removeFirst();
3843 m_pageClient->doneWithKeyEvent(event, handled);
3844 for (size_t i = 0; i < queuedEvents.deferredEvents.size(); ++i) {
3845 bool isEventHandled = false;
3846 m_pageClient->doneWithKeyEvent(queuedEvents.deferredEvents.at(i), isEventHandled);
3849 NativeWebKeyboardEvent event = m_keyEventQueue.first();
3850 MESSAGE_CHECK(type == event.type());
3852 m_keyEventQueue.removeFirst();
3854 if (!m_keyEventQueue.isEmpty())
3855 process()->send(Messages::WebPage::KeyEvent(m_keyEventQueue.first()), m_pageID);
3857 m_pageClient->doneWithKeyEvent(event, handled);
3858 #endif // #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3863 #if ENABLE(TIZEN_ISF_PORT)
3864 InputMethodContextEfl* inputMethodContext = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->inputMethodContext();
3865 if (event.type() == WebEvent::KeyDown && event.keyIdentifier() == "Enter" && inputMethodContext && inputMethodContext->autoCapitalType() == ECORE_IMF_AUTOCAPITAL_TYPE_NONE)
3866 inputMethodContext->hideIMFContext();
3869 if (m_uiClient.implementsDidNotHandleKeyEvent())
3870 m_uiClient.didNotHandleKeyEvent(this, event);
3873 ::TranslateMessage(event.nativeEvent());
3877 #if ENABLE(TOUCH_EVENTS)
3878 case WebEvent::TouchStart:
3879 case WebEvent::TouchMove:
3880 case WebEvent::TouchEnd:
3881 case WebEvent::TouchCancel: {
3882 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3883 QueuedUIEvents<NativeWebTouchEvent> queuedEvents = m_touchEventQueue.first();
3884 MESSAGE_CHECK(type == queuedEvents.forwardedEvent.type());
3885 m_touchEventQueue.removeFirst();
3887 m_pageClient->doneWithTouchEvent(queuedEvents.forwardedEvent, handled);
3888 for (size_t i = 0; i < queuedEvents.deferredEvents.size(); ++i) {
3889 bool isEventHandled = false;
3890 m_pageClient->doneWithTouchEvent(queuedEvents.deferredEvents.at(i), isEventHandled);
3893 QueuedTouchEvents queuedEvents = m_touchEventQueue.first();
3894 MESSAGE_CHECK(type == queuedEvents.forwardedEvent.type());
3895 m_touchEventQueue.removeFirst();
3897 m_pageClient->doneWithTouchEvent(queuedEvents.forwardedEvent, handled);
3898 for (size_t i = 0; i < queuedEvents.deferredTouchEvents.size(); ++i) {
3899 bool isEventHandled = false;
3900 m_pageClient->doneWithTouchEvent(queuedEvents.deferredTouchEvents.at(i), isEventHandled);
3909 void WebPageProxy::stopResponsivenessTimer()
3911 process()->responsivenessTimer()->stop();
3914 void WebPageProxy::voidCallback(uint64_t callbackID)
3916 RefPtr<VoidCallback> callback = m_voidCallbacks.take(callbackID);
3918 // FIXME: Log error or assert.
3922 callback->performCallback();
3925 void WebPageProxy::dataCallback(const CoreIPC::DataReference& dataReference, uint64_t callbackID)
3927 RefPtr<DataCallback> callback = m_dataCallbacks.take(callbackID);
3929 // FIXME: Log error or assert.
3933 callback->performCallbackWithReturnValue(WebData::create(dataReference.data(), dataReference.size()).get());
3936 void WebPageProxy::stringCallback(const String& resultString, uint64_t callbackID)
3938 RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackID);
3940 // FIXME: Log error or assert.
3941 // this can validly happen if a load invalidated the callback, though
3945 m_loadDependentStringCallbackIDs.remove(callbackID);
3947 callback->performCallbackWithReturnValue(resultString.impl());
3950 void WebPageProxy::scriptValueCallback(const CoreIPC::DataReference& dataReference, uint64_t callbackID)
3952 RefPtr<ScriptValueCallback> callback = m_scriptValueCallbacks.take(callbackID);
3954 // FIXME: Log error or assert.
3958 Vector<uint8_t> data;
3959 data.reserveInitialCapacity(dataReference.size());
3960 data.append(dataReference.data(), dataReference.size());
3962 callback->performCallbackWithReturnValue(data.size() ? WebSerializedScriptValue::adopt(data).get() : 0);
3965 void WebPageProxy::computedPagesCallback(const Vector<IntRect>& pageRects, double totalScaleFactorForPrinting, uint64_t callbackID)
3967 RefPtr<ComputedPagesCallback> callback = m_computedPagesCallbacks.take(callbackID);
3969 // FIXME: Log error or assert.
3973 callback->performCallbackWithReturnValue(pageRects, totalScaleFactorForPrinting);
3976 void WebPageProxy::validateCommandCallback(const String& commandName, bool isEnabled, int state, uint64_t callbackID)
3978 RefPtr<ValidateCommandCallback> callback = m_validateCommandCallbacks.take(callbackID);
3980 // FIXME: Log error or assert.
3984 callback->performCallbackWithReturnValue(commandName.impl(), isEnabled, state);
3988 void WebPageProxy::printFinishedCallback(const ResourceError& printError, uint64_t callbackID)
3990 RefPtr<PrintFinishedCallback> callback = m_printFinishedCallbacks.take(callbackID);
3992 // FIXME: Log error or assert.
3996 RefPtr<WebError> error = WebError::create(printError);
3997 callback->performCallbackWithReturnValue(error.get());
4001 void WebPageProxy::focusedFrameChanged(uint64_t frameID)
4008 WebFrameProxy* frame = process()->webFrame(frameID);
4009 MESSAGE_CHECK(frame);
4011 m_focusedFrame = frame;
4014 void WebPageProxy::frameSetLargestFrameChanged(uint64_t frameID)
4017 m_frameSetLargestFrame = 0;
4021 WebFrameProxy* frame = process()->webFrame(frameID);
4022 MESSAGE_CHECK(frame);
4024 m_frameSetLargestFrame = frame;
4027 void WebPageProxy::processDidBecomeUnresponsive()
4032 updateBackingStoreDiscardableState();
4034 m_loaderClient.processDidBecomeUnresponsive(this);
4037 void WebPageProxy::interactionOccurredWhileProcessUnresponsive()
4042 m_loaderClient.interactionOccurredWhileProcessUnresponsive(this);
4045 void WebPageProxy::processDidBecomeResponsive()
4050 updateBackingStoreDiscardableState();
4052 m_loaderClient.processDidBecomeResponsive(this);
4055 void WebPageProxy::processDidCrash()
4057 ASSERT(m_pageClient);
4060 m_isPageSuspended = false;
4063 m_urlAtProcessExit = m_mainFrame->url();
4064 m_loadStateAtProcessExit = m_mainFrame->loadState();
4067 m_mainFrame = nullptr;
4068 m_drawingArea = nullptr;
4070 #if ENABLE(INSPECTOR)
4072 m_inspector->invalidate();
4073 m_inspector = nullptr;
4077 #if ENABLE(FULLSCREEN_API)
4078 if (m_fullScreenManager) {
4079 m_fullScreenManager->invalidate();
4080 m_fullScreenManager = nullptr;
4084 if (m_openPanelResultListener) {
4085 m_openPanelResultListener->invalidate();
4086 m_openPanelResultListener = nullptr;
4089 #if ENABLE(INPUT_TYPE_COLOR)
4090 if (m_colorChooser) {
4091 m_colorChooser->invalidate();
4092 m_colorChooser = nullptr;
4095 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
4096 if (m_colorPickerResultListener) {
4097 m_colorPickerResultListener->invalidate();
4098 m_colorPickerResultListener = nullptr;
4103 #if ENABLE(GEOLOCATION)
4104 m_geolocationPermissionRequestManager.invalidateRequests();
4107 m_notificationPermissionRequestManager.invalidateRequests();
4109 m_toolTip = String();
4111 m_mainFrameHasHorizontalScrollbar = false;
4112 m_mainFrameHasVerticalScrollbar = false;
4114 m_mainFrameIsPinnedToLeftSide = false;
4115 m_mainFrameIsPinnedToRightSide = false;
4117 m_visibleScrollerThumbRect = IntRect();
4119 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
4120 invalidateCallbackMap(m_booleanCallbacks);
4121 invalidateCallbackMap(m_dictionaryCallbacks);
4123 invalidateCallbackMap(m_voidCallbacks);
4124 invalidateCallbackMap(m_dataCallbacks);
4125 invalidateCallbackMap(m_stringCallbacks);
4126 m_loadDependentStringCallbackIDs.clear();
4127 invalidateCallbackMap(m_scriptValueCallbacks);
4128 invalidateCallbackMap(m_computedPagesCallbacks);
4129 invalidateCallbackMap(m_validateCommandCallbacks);
4131 invalidateCallbackMap(m_printFinishedCallbacks);
4134 Vector<WebEditCommandProxy*> editCommandVector;
4135 copyToVector(m_editCommandSet, editCommandVector);
4136 m_editCommandSet.clear();
4137 for (size_t i = 0, size = editCommandVector.size(); i < size; ++i)
4138 editCommandVector[i]->invalidate();
4139 m_pageClient->clearAllEditCommands();
4141 m_activePopupMenu = 0;
4143 m_estimatedProgress = 0.0;
4145 m_pendingLearnOrIgnoreWordMessageCount = 0;
4147 m_pageClient->processDidCrash();
4148 m_loaderClient.processDidCrash(this);
4151 // If the call out to the loader client didn't cause the web process to be relaunched,
4152 // we'll call setNeedsDisplay on the view so that we won't have the old contents showing.
4153 // If the call did cause the web process to be relaunched, we'll keep the old page contents showing
4154 // until the new web process has painted its contents.
4155 setViewNeedsDisplay(IntRect(IntPoint(), viewSize()));
4158 // Can't expect DidReceiveEvent notifications from a crashed web process.
4159 m_keyEventQueue.clear();
4161 m_wheelEventQueue.clear();
4162 m_currentlyProcessedWheelEvents.clear();
4164 m_nextMouseMoveEvent = nullptr;
4165 m_currentlyProcessedMouseDownEvent = nullptr;
4167 m_processingMouseMoveEvent = false;
4169 #if ENABLE(TOUCH_EVENTS)
4170 m_needTouchEvents = false;
4171 m_touchEventQueue.clear();
4174 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4175 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
4176 m_pageClient->dismissDictionaryLookupPanel();
4180 WebPageCreationParameters WebPageProxy::creationParameters() const
4182 WebPageCreationParameters parameters;
4184 parameters.viewSize = m_pageClient->viewSize();
4185 parameters.isActive = m_pageClient->isViewWindowActive();
4186 parameters.isFocused = m_pageClient->isViewFocused();
4187 parameters.isVisible = m_pageClient->isViewVisible();
4188 parameters.isInWindow = m_pageClient->isViewInWindow();
4189 parameters.drawingAreaType = m_drawingArea->type();
4190 parameters.store = m_pageGroup->preferences()->store();
4191 parameters.pageGroupData = m_pageGroup->data();
4192 parameters.drawsBackground = m_drawsBackground;
4193 parameters.drawsTransparentBackground = m_drawsTransparentBackground;
4194 parameters.areMemoryCacheClientCallsEnabled = m_areMemoryCacheClientCallsEnabled;
4195 parameters.useFixedLayout = m_useFixedLayout;
4196 parameters.fixedLayoutSize = m_fixedLayoutSize;
4197 parameters.paginationMode = m_paginationMode;
4198 parameters.paginationBehavesLikeColumns = m_paginationBehavesLikeColumns;
4199 parameters.pageLength = m_pageLength;
4200 parameters.gapBetweenPages = m_gapBetweenPages;
4201 parameters.userAgent = userAgent();
4202 parameters.sessionState = SessionState(m_backForwardList->entries(), m_backForwardList->currentIndex());
4203 parameters.highestUsedBackForwardItemID = WebBackForwardListItem::highedUsedItemID();
4204 parameters.canRunBeforeUnloadConfirmPanel = m_uiClient.canRunBeforeUnloadConfirmPanel();
4205 parameters.canRunModal = m_canRunModal;
4206 parameters.deviceScaleFactor = m_intrinsicDeviceScaleFactor;
4207 parameters.mediaVolume = m_mediaVolume;
4210 parameters.isSmartInsertDeleteEnabled = m_isSmartInsertDeleteEnabled;
4211 parameters.layerHostingMode = m_layerHostingMode;
4212 parameters.colorSpace = m_pageClient->colorSpace();
4216 parameters.nativeWindow = m_pageClient->nativeWindow();
4221 #if USE(ACCELERATED_COMPOSITING)
4222 void WebPageProxy::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
4224 m_pageClient->enterAcceleratedCompositingMode(layerTreeContext);
4227 void WebPageProxy::exitAcceleratedCompositingMode()
4229 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
4230 process()->platformSurfaceTexturePool()->removeAllPlatformSurfaceTextures();
4232 m_pageClient->exitAcceleratedCompositingMode();
4235 void WebPageProxy::updateAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
4237 m_pageClient->updateAcceleratedCompositingMode(layerTreeContext);
4239 #endif // USE(ACCELERATED_COMPOSITING)
4241 void WebPageProxy::backForwardClear()
4243 m_backForwardList->clear();
4246 void WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const ProtectionSpace& coreProtectionSpace, bool& canAuthenticate)
4248 WebFrameProxy* frame = process()->webFrame(frameID);
4249 MESSAGE_CHECK(frame);
4251 RefPtr<WebProtectionSpace> protectionSpace = WebProtectionSpace::create(coreProtectionSpace);
4253 canAuthenticate = m_loaderClient.canAuthenticateAgainstProtectionSpaceInFrame(this, frame, protectionSpace.get());
4256 #if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
4257 void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const AuthenticationChallenge& coreChallenge, uint64_t challengeID, PassRefPtr<Messages::WebPageProxy::DidReceiveAuthenticationChallenge::DelayedReply> reply)
4259 void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const AuthenticationChallenge& coreChallenge, uint64_t challengeID)
4262 WebFrameProxy* frame = process()->webFrame(frameID);
4263 MESSAGE_CHECK(frame);
4265 #if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
4266 RefPtr<AuthenticationChallengeProxy> authenticationChallenge = frame->setUpAuthenticationChallengeProxy(coreChallenge, challengeID, process());
4267 m_AuthReply = reply;
4269 if (!m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get()))
4270 replyReceiveAuthenticationChallengeInFrame(true);
4272 RefPtr<AuthenticationChallengeProxy> authenticationChallenge = AuthenticationChallengeProxy::create(coreChallenge, challengeID, process());
4274 m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get());
4278 #if ENABLE(TIZEN_SQL_DATABASE)
4279 void WebPageProxy::exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& displayName, uint64_t expectedUsage, PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply> allowExceed)
4281 WebFrameProxy* frame = process()->webFrame(frameID);
4282 MESSAGE_CHECK(frame);
4284 // Since exceededDatabaseQuota() can spin a nested run loop we need to turn off the responsiveness timer.
4285 process()->responsivenessTimer()->stop();
4287 m_exceededDatabaseQuotaReply = allowExceed;
4288 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
4289 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
4290 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
4293 if (!m_uiClient.exceededDatabaseQuota(this, frame, origin.get(), displayName, expectedUsage))
4294 replyExceededDatabaseQuota(true);
4297 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)
4299 WebFrameProxy* frame = process()->webFrame(frameID);
4300 MESSAGE_CHECK(frame);
4302 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
4304 newQuota = m_uiClient.exceededDatabaseQuota(this, frame, origin.get(), databaseName, displayName, currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage);
4308 void WebPageProxy::requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier)
4310 WebFrameProxy* frame = process()->webFrame(frameID);
4311 MESSAGE_CHECK(frame);
4313 // FIXME: Geolocation should probably be using toString() as its string representation instead of databaseIdentifier().
4314 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
4315 RefPtr<GeolocationPermissionRequestProxy> request = m_geolocationPermissionRequestManager.createRequest(geolocationID);
4317 if (!m_uiClient.decidePolicyForGeolocationPermissionRequest(this, frame, origin.get(), request.get()))
4321 void WebPageProxy::requestNotificationPermission(uint64_t requestID, const String& originString)
4323 if (!isRequestIDValid(requestID))
4326 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromString(originString);
4327 RefPtr<NotificationPermissionRequest> request = m_notificationPermissionRequestManager.createRequest(requestID);
4329 if (!m_uiClient.decidePolicyForNotificationPermissionRequest(this, origin.get(), request.get()))
4333 void WebPageProxy::showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID)
4335 m_process->context()->notificationManagerProxy()->show(this, title, body, iconURL, tag, originString, notificationID);
4338 #if ENABLE(TIZEN_MEDIA_STREAM)
4339 void WebPageProxy::requestUserMediaPermission(uint64_t requestID)
4341 RefPtr<UserMediaPermissionRequest> request = m_userMediaPermissionRequestManager.createRequest(requestID);
4343 if (!m_tizenClient.decidePolicyForUserMediaPermissionRequest(this, request.get()))
4348 float WebPageProxy::headerHeight(WebFrameProxy* frame)
4350 if (frame->isDisplayingPDFDocument())
4352 return m_uiClient.headerHeight(this, frame);
4355 float WebPageProxy::footerHeight(WebFrameProxy* frame)
4357 if (frame->isDisplayingPDFDocument())
4359 return m_uiClient.footerHeight(this, frame);
4362 void WebPageProxy::drawHeader(WebFrameProxy* frame, const FloatRect& rect)
4364 if (frame->isDisplayingPDFDocument())
4366 m_uiClient.drawHeader(this, frame, rect);
4369 void WebPageProxy::drawFooter(WebFrameProxy* frame, const FloatRect& rect)
4371 if (frame->isDisplayingPDFDocument())
4373 m_uiClient.drawFooter(this, frame, rect);
4376 void WebPageProxy::runModal()
4378 // Since runModal() can (and probably will) spin a nested run loop we need to turn off the responsiveness timer.
4379 process()->responsivenessTimer()->stop();
4381 // Our Connection's run loop might have more messages waiting to be handled after this RunModal message.
4382 // To make sure they are handled inside of the the nested modal run loop we must first signal the Connection's
4383 // run loop so we're guaranteed that it has a chance to wake up.
4384 // See http://webkit.org/b/89590 for more discussion.
4385 process()->connection()->wakeUpRunLoop();
4387 m_uiClient.runModal(this);
4390 void WebPageProxy::notifyScrollerThumbIsVisibleInRect(const IntRect& scrollerThumb)
4392 m_visibleScrollerThumbRect = scrollerThumb;
4395 void WebPageProxy::recommendedScrollbarStyleDidChange(int32_t newStyle)
4398 m_pageClient->recommendedScrollbarStyleDidChange(newStyle);
4402 void WebPageProxy::didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar)
4404 m_mainFrameHasHorizontalScrollbar = hasHorizontalScrollbar;
4405 m_mainFrameHasVerticalScrollbar = hasVerticalScrollbar;
4407 m_pageClient->didChangeScrollbarsForMainFrame();
4410 void WebPageProxy::didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide)
4412 m_mainFrameIsPinnedToLeftSide = pinnedToLeftSide;
4413 m_mainFrameIsPinnedToRightSide = pinnedToRightSide;
4416 void WebPageProxy::didChangePageCount(unsigned pageCount)
4418 m_pageCount = pageCount;
4421 void WebPageProxy::didFailToInitializePlugin(const String& mimeType)
4423 m_loaderClient.didFailToInitializePlugin(this, mimeType);
4426 void WebPageProxy::didBlockInsecurePluginVersion(const String& mimeType, const String& urlString)
4428 String pluginIdentifier;
4429 String pluginVersion;
4430 String newMimeType = mimeType;
4433 PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL(KURL(), urlString));
4435 pluginIdentifier = plugin.bundleIdentifier;
4436 pluginVersion = plugin.versionString;
4439 m_loaderClient.didBlockInsecurePluginVersion(this, newMimeType, pluginIdentifier, pluginVersion);
4442 bool WebPageProxy::willHandleHorizontalScrollEvents() const
4444 return !m_canShortCircuitHorizontalWheelEvents;
4447 void WebPageProxy::didFinishLoadingDataForCustomRepresentation(const String& suggestedFilename, const CoreIPC::DataReference& dataReference)
4449 m_pageClient->didFinishLoadingDataForCustomRepresentation(suggestedFilename, dataReference);
4452 void WebPageProxy::backForwardRemovedItem(uint64_t itemID)
4454 process()->send(Messages::WebPage::DidRemoveBackForwardItem(itemID), m_pageID);
4457 void WebPageProxy::setCanRunModal(bool canRunModal)
4462 // It's only possible to change the state for a WebPage which
4463 // already qualifies for running modal child web pages, otherwise
4464 // there's no other possibility than not allowing it.
4465 m_canRunModal = m_uiClient.canRunModal() && canRunModal;
4466 process()->send(Messages::WebPage::SetCanRunModal(m_canRunModal), m_pageID);
4469 bool WebPageProxy::canRunModal()
4471 return isValid() ? m_canRunModal : false;
4474 void WebPageProxy::beginPrinting(WebFrameProxy* frame, const PrintInfo& printInfo)
4476 if (m_isInPrintingMode)
4479 m_isInPrintingMode = true;
4480 process()->send(Messages::WebPage::BeginPrinting(frame->frameID(), printInfo), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4483 void WebPageProxy::endPrinting()
4485 if (!m_isInPrintingMode)
4488 m_isInPrintingMode = false;
4489 process()->send(Messages::WebPage::EndPrinting(), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4492 void WebPageProxy::computePagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<ComputedPagesCallback> prpCallback)
4494 RefPtr<ComputedPagesCallback> callback = prpCallback;
4496 callback->invalidate();
4500 uint64_t callbackID = callback->callbackID();
4501 m_computedPagesCallbacks.set(callbackID, callback.get());
4502 m_isInPrintingMode = true;
4503 process()->send(Messages::WebPage::ComputePagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4506 #if PLATFORM(MAC) || PLATFORM(WIN)
4507 void WebPageProxy::drawRectToPDF(WebFrameProxy* frame, const PrintInfo& printInfo, const IntRect& rect, PassRefPtr<DataCallback> prpCallback)
4509 RefPtr<DataCallback> callback = prpCallback;
4511 callback->invalidate();
4515 uint64_t callbackID = callback->callbackID();
4516 m_dataCallbacks.set(callbackID, callback.get());
4517 process()->send(Messages::WebPage::DrawRectToPDF(frame->frameID(), printInfo, rect, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4520 void WebPageProxy::drawPagesToPDF(WebFrameProxy* frame, const PrintInfo& printInfo, uint32_t first, uint32_t count, PassRefPtr<DataCallback> prpCallback)
4522 RefPtr<DataCallback> callback = prpCallback;
4524 callback->invalidate();
4528 uint64_t callbackID = callback->callbackID();
4529 m_dataCallbacks.set(callbackID, callback.get());
4530 process()->send(Messages::WebPage::DrawPagesToPDF(frame->frameID(), printInfo, first, count, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4533 void WebPageProxy::drawPagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<PrintFinishedCallback> didPrintCallback)
4535 RefPtr<PrintFinishedCallback> callback = didPrintCallback;
4537 callback->invalidate();
4541 uint64_t callbackID = callback->callbackID();
4542 m_printFinishedCallbacks.set(callbackID, callback.get());
4543 m_isInPrintingMode = true;
4544 process()->send(Messages::WebPage::DrawPagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4548 void WebPageProxy::flashBackingStoreUpdates(const Vector<IntRect>& updateRects)
4550 m_pageClient->flashBackingStoreUpdates(updateRects);
4553 void WebPageProxy::updateBackingStoreDiscardableState()
4559 if (!process()->responsivenessTimer()->isResponsive())
4560 isDiscardable = false;
4562 isDiscardable = !m_pageClient->isViewWindowActive() || !isViewVisible();
4564 m_drawingArea->setBackingStoreIsDiscardable(isDiscardable);
4567 Color WebPageProxy::viewUpdatesFlashColor()
4569 return Color(0, 200, 255);
4572 Color WebPageProxy::backingStoreUpdatesFlashColor()
4574 return Color(200, 0, 255);
4577 void WebPageProxy::saveDataToFileInDownloadsFolder(const String& suggestedFilename, const String& mimeType, const String& originatingURLString, WebData* data)
4579 m_uiClient.saveDataToFileInDownloadsFolder(this, suggestedFilename, mimeType, originatingURLString, data);
4582 void WebPageProxy::linkClicked(const String& url, const WebMouseEvent& event)
4584 process()->send(Messages::WebPage::LinkClicked(url, event), m_pageID, 0);
4589 void WebPageProxy::substitutionsPanelIsShowing(bool& isShowing)
4591 isShowing = TextChecker::substitutionsPanelIsShowing();
4594 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4595 void WebPageProxy::showCorrectionPanel(int32_t panelType, const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings)
4597 m_pageClient->showCorrectionPanel((AlternativeTextType)panelType, boundingBoxOfReplacedString, replacedString, replacementString, alternativeReplacementStrings);
4600 void WebPageProxy::dismissCorrectionPanel(int32_t reason)
4602 m_pageClient->dismissCorrectionPanel((ReasonForDismissingAlternativeText)reason);
4605 void WebPageProxy::dismissCorrectionPanelSoon(int32_t reason, String& result)
4607 result = m_pageClient->dismissCorrectionPanelSoon((ReasonForDismissingAlternativeText)reason);
4610 void WebPageProxy::recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString)
4612 m_pageClient->recordAutocorrectionResponse((AutocorrectionResponseType)responseType, replacedString, replacementString);
4614 #endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4616 void WebPageProxy::handleAlternativeTextUIResult(const String& result)
4618 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4620 process()->send(Messages::WebPage::HandleAlternativeTextUIResult(result), m_pageID, 0);
4624 #if USE(DICTATION_ALTERNATIVES)
4625 void WebPageProxy::showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext)
4627 m_pageClient->showDictationAlternativeUI(boundingBoxOfDictatedText, dictationContext);
4630 void WebPageProxy::dismissDictationAlternativeUI()
4632 m_pageClient->dismissDictationAlternativeUI();
4635 void WebPageProxy::removeDictationAlternatives(uint64_t dictationContext)
4637 m_pageClient->removeDictationAlternatives(dictationContext);
4640 void WebPageProxy::dictationAlternatives(uint64_t dictationContext, Vector<String>& result)
4642 result = m_pageClient->dictationAlternatives(dictationContext);
4646 #endif // PLATFORM(MAC)
4649 void WebPageProxy::didReceiveURIRequest(String uriString, uint64_t requestID)
4651 m_process->context()->soupRequestManagerProxy()->didReceiveURIRequest(uriString, this, requestID);
4655 #if ENABLE(TIZEN_PAGE_VISIBILITY_API)
4656 void WebPageProxy::setPageVisibility(WebCore::PageVisibilityState pageVisibilityState, bool isInitialState)
4658 process()->send(Messages::WebPage::SetVisibilityState(static_cast<uint32_t>(pageVisibilityState), isInitialState), m_pageID);
4662 #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
4663 void WebPageProxy::decidePolicyForCertificateError(const String& url, const String& certificate, int error, PassRefPtr<Messages::WebPageProxy::DecidePolicyForCertificateError::DelayedReply> reply)
4665 m_allowedReply = reply;
4667 if (!m_tizenClient.decidePolicyForCertificateError(this, url, certificate, error))
4668 replyPolicyForCertificateError(true);
4672 #if ENABLE(TIZEN_NATIVE_MEMORY_SNAPSHOT)
4673 void WebPageProxy::dumpMemorySnapshot()
4675 process()->send(Messages::WebPage::DumpMemorySnapshot(), m_pageID);
4679 } // namespace WebKit