2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Corporation. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
24 * THE POSSIBILITY OF SUCH DAMAGE.
28 #include "WebPageProxy.h"
30 #include "AuthenticationChallengeProxy.h"
31 #include "AuthenticationDecisionListener.h"
32 #include "DataReference.h"
33 #include "DownloadProxy.h"
34 #include "DrawingAreaProxy.h"
35 #include "EventDispatcherMessages.h"
36 #include "FindIndicator.h"
37 #include "ImmutableArray.h"
39 #include "MessageID.h"
40 #include "NativeWebKeyboardEvent.h"
41 #include "NativeWebMouseEvent.h"
42 #include "NativeWebWheelEvent.h"
43 #include "NotificationPermissionRequest.h"
44 #include "NotificationPermissionRequestManager.h"
45 #include "PageClient.h"
46 #include "PrintInfo.h"
47 #include "SessionState.h"
48 #include "StringPairVector.h"
49 #include "TextChecker.h"
50 #include "TextCheckerState.h"
51 #include "WKContextPrivate.h"
52 #include "WebBackForwardList.h"
53 #include "WebBackForwardListItem.h"
54 #include "WebCertificateInfo.h"
55 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
56 #include "WebColorPickerResultListenerProxy.h"
58 #include "WebContext.h"
59 #include "WebContextMenuProxy.h"
60 #include "WebContextUserMessageCoders.h"
61 #include "WebCoreArgumentCoders.h"
63 #include "WebEditCommandProxy.h"
65 #include "WebFormSubmissionListenerProxy.h"
66 #include "WebFramePolicyListenerProxy.h"
67 #include "WebFullScreenManagerProxy.h"
68 #include "WebInspectorProxy.h"
69 #include "WebNotificationManagerProxy.h"
70 #include "WebOpenPanelResultListenerProxy.h"
71 #include "WebPageCreationParameters.h"
72 #include "WebPageGroup.h"
73 #include "WebPageGroupData.h"
74 #include "WebPageMessages.h"
75 #include "WebPopupItem.h"
76 #include "WebPopupMenuProxy.h"
77 #include "WebPreferences.h"
78 #include "WebProcessMessages.h"
79 #include "WebProcessProxy.h"
80 #include "WebProtectionSpace.h"
81 #include "WebSecurityOrigin.h"
82 #include "WebURLRequest.h"
83 #include <WebCore/DragController.h>
84 #include <WebCore/DragData.h>
85 #include <WebCore/DragSession.h>
86 #include <WebCore/FloatRect.h>
87 #include <WebCore/FocusDirection.h>
88 #include <WebCore/MIMETypeRegistry.h>
89 #include <WebCore/TextCheckerClient.h>
90 #include <WebCore/WindowFeatures.h>
93 #if ENABLE(WEB_INTENTS)
94 #include "IntentData.h"
95 #include "IntentServiceInfo.h"
96 #include "WebIntentData.h"
97 #include "WebIntentServiceInfo.h"
100 #if USE(UI_SIDE_COMPOSITING)
101 #include "LayerTreeCoordinatorProxyMessages.h"
105 #include "ArgumentCodersQt.h"
109 #include "ArgumentCodersGtk.h"
113 #include "WebSoupRequestManagerProxy.h"
116 #if ENABLE(TIZEN_DRAG_SUPPORT)
117 #include "ArgumentCodersTizen.h"
121 #include <wtf/RefCountedLeakCounter.h>
124 #if ENABLE(TIZEN_ISF_PORT) || ENABLE(TIZEN_GESTURE)
125 #include "EwkViewImpl.h"
126 #include "InputMethodContextEfl.h"
129 #if ENABLE(TIZEN_VIEWPORT_META_TAG)
130 #include <WebCore/EflScreenUtilities.h>
133 // This controls what strategy we use for mouse wheel coalescing.
134 #define MERGE_WHEEL_EVENTS 1
136 #define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, m_process->connection())
137 #define MESSAGE_CHECK_URL(url) MESSAGE_CHECK_BASE(m_process->checkURLReceivedFromWebProcess(url), m_process->connection())
139 using namespace WebCore;
141 // Represents the number of wheel events we can hold in the queue before we start pushing them preemptively.
142 static const unsigned wheelEventQueueSizeThreshold = 10;
146 WKPageDebugPaintFlags WebPageProxy::s_debugPaintFlags = 0;
148 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, webPageProxyCounter, ("WebPageProxy"));
151 static const char* webKeyboardEventTypeString(WebEvent::Type type)
154 case WebEvent::KeyDown:
157 case WebEvent::KeyUp:
160 case WebEvent::RawKeyDown:
167 ASSERT_NOT_REACHED();
171 #endif // !LOG_DISABLED
173 PassRefPtr<WebPageProxy> WebPageProxy::create(PageClient* pageClient, PassRefPtr<WebProcessProxy> process, WebPageGroup* pageGroup, uint64_t pageID)
175 return adoptRef(new WebPageProxy(pageClient, process, pageGroup, pageID));
178 WebPageProxy::WebPageProxy(PageClient* pageClient, PassRefPtr<WebProcessProxy> process, WebPageGroup* pageGroup, uint64_t pageID)
179 : m_pageClient(pageClient)
181 , m_pageGroup(pageGroup)
183 , m_userAgent(standardUserAgent())
184 , m_geolocationPermissionRequestManager(this)
185 , m_notificationPermissionRequestManager(this)
186 #if ENABLE(TIZEN_MEDIA_STREAM)
187 , m_userMediaPermissionRequestManager(this)
189 , m_estimatedProgress(0)
190 , m_isInWindow(m_pageClient->isViewInWindow())
191 , m_isVisible(m_pageClient->isViewVisible())
192 , m_backForwardList(WebBackForwardList::create(this))
193 , m_loadStateAtProcessExit(WebFrameProxy::LoadStateFinished)
194 , m_textZoomFactor(1)
195 , m_pageZoomFactor(1)
196 , m_pageScaleFactor(1)
197 , m_intrinsicDeviceScaleFactor(getMobileDPI() / 160)
198 , m_customDeviceScaleFactor(0)
199 #if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
200 , m_layerHostingMode(LayerHostingModeInWindowServer)
202 , m_layerHostingMode(LayerHostingModeDefault)
204 , m_drawsBackground(true)
205 , m_drawsTransparentBackground(false)
206 , m_areMemoryCacheClientCallsEnabled(true)
207 , m_useFixedLayout(false)
208 , m_paginationMode(Page::Pagination::Unpaginated)
209 , m_paginationBehavesLikeColumns(false)
211 , m_gapBetweenPages(0)
214 , m_canRunModal(false)
215 , m_isInPrintingMode(false)
216 , m_isPerformingDOMPrintOperation(false)
217 , m_inDecidePolicyForResponse(false)
218 , m_syncMimeTypePolicyActionIsValid(false)
219 , m_syncMimeTypePolicyAction(PolicyUse)
220 , m_syncMimeTypePolicyDownloadID(0)
221 , m_inDecidePolicyForNavigationAction(false)
222 , m_syncNavigationActionPolicyActionIsValid(false)
223 , m_syncNavigationActionPolicyAction(PolicyUse)
224 , m_syncNavigationActionPolicyDownloadID(0)
225 , m_processingMouseMoveEvent(false)
226 #if ENABLE(TOUCH_EVENTS)
227 , m_needTouchEvents(false)
229 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
230 , m_askOverflow(true)
233 , m_isPageSuspended(false)
235 , m_isSmartInsertDeleteEnabled(TextChecker::isSmartInsertDeleteEnabled())
237 , m_spellDocumentTag(0)
238 , m_hasSpellDocumentTag(false)
239 , m_pendingLearnOrIgnoreWordMessageCount(0)
240 , m_mainFrameHasCustomRepresentation(false)
241 , m_mainFrameHasHorizontalScrollbar(false)
242 , m_mainFrameHasVerticalScrollbar(false)
243 , m_canShortCircuitHorizontalWheelEvents(true)
244 , m_mainFrameIsPinnedToLeftSide(false)
245 , m_mainFrameIsPinnedToRightSide(false)
247 , m_renderTreeSize(0)
248 , m_shouldSendEventsSynchronously(false)
249 , m_suppressVisibilityUpdates(false)
251 #if ENABLE(PAGE_VISIBILITY_API)
252 , m_visibilityState(PageVisibilityStateVisible)
254 #if ENABLE(TIZEN_REDUCE_KEY_LAGGING)
255 , m_pageContentResumeTimer(0)
257 #if ENABLE(TIZEN_ISF_PORT)
258 , m_didCancelCompositionFromWebProcess(false)
260 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
261 , m_contentSuspendedByInspector(false)
265 webPageProxyCounter.increment();
268 WebContext::statistics().wkPageCount++;
270 m_pageGroup->addPage(this);
273 WebPageProxy::~WebPageProxy()
278 WebContext::statistics().wkPageCount--;
280 if (m_hasSpellDocumentTag)
281 TextChecker::closeSpellDocumentWithTag(m_spellDocumentTag);
283 m_pageGroup->removePage(this);
286 webPageProxyCounter.decrement();
288 #if ENABLE(TIZEN_REDUCE_KEY_LAGGING)
289 if (m_pageContentResumeTimer)
290 ecore_timer_del(m_pageContentResumeTimer);
294 WebProcessProxy* WebPageProxy::process() const
296 return m_process.get();
299 PlatformProcessIdentifier WebPageProxy::processIdentifier() const
304 return m_process->processIdentifier();
307 bool WebPageProxy::isValid()
309 // A page that has been explicitly closed is never valid.
316 void WebPageProxy::initializeLoaderClient(const WKPageLoaderClient* loadClient)
318 m_loaderClient.initialize(loadClient);
323 process()->send(Messages::WebPage::SetWillGoToBackForwardItemCallbackEnabled(loadClient->version > 0), m_pageID);
326 void WebPageProxy::initializePolicyClient(const WKPagePolicyClient* policyClient)
328 m_policyClient.initialize(policyClient);
331 void WebPageProxy::initializeFormClient(const WKPageFormClient* formClient)
333 m_formClient.initialize(formClient);
336 void WebPageProxy::initializeResourceLoadClient(const WKPageResourceLoadClient* client)
338 m_resourceLoadClient.initialize(client);
341 void WebPageProxy::initializeUIClient(const WKPageUIClient* client)
346 m_uiClient.initialize(client);
348 process()->send(Messages::WebPage::SetCanRunBeforeUnloadConfirmPanel(m_uiClient.canRunBeforeUnloadConfirmPanel()), m_pageID);
349 setCanRunModal(m_uiClient.canRunModal());
352 void WebPageProxy::initializeFindClient(const WKPageFindClient* client)
354 m_findClient.initialize(client);
357 void WebPageProxy::initializeFindMatchesClient(const WKPageFindMatchesClient* client)
359 m_findMatchesClient.initialize(client);
362 #if ENABLE(CONTEXT_MENUS)
363 void WebPageProxy::initializeContextMenuClient(const WKPageContextMenuClient* client)
365 m_contextMenuClient.initialize(client);
369 void WebPageProxy::reattachToWebProcess()
375 m_process = m_process->context()->relaunchProcessIfNecessary();
376 process()->addExistingWebPage(this, m_pageID);
380 m_pageClient->didRelaunchProcess();
381 m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
384 void WebPageProxy::reattachToWebProcessWithItem(WebBackForwardListItem* item)
386 if (item && item != m_backForwardList->currentItem())
387 m_backForwardList->goToItem(item);
389 reattachToWebProcess();
394 process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
395 process()->responsivenessTimer()->start();
398 void WebPageProxy::initializeWebPage()
402 BackForwardListItemVector items = m_backForwardList->entries();
403 for (size_t i = 0; i < items.size(); ++i)
404 process()->registerNewWebBackForwardListItem(items[i].get());
406 m_drawingArea = m_pageClient->createDrawingAreaProxy();
407 ASSERT(m_drawingArea);
409 #if ENABLE(INSPECTOR_SERVER)
410 if (m_pageGroup->preferences()->developerExtrasEnabled())
411 inspector()->enableRemoteInspection();
414 process()->send(Messages::WebProcess::CreateWebPage(m_pageID, creationParameters()), 0);
416 #if ENABLE(PAGE_VISIBILITY_API)
417 process()->send(Messages::WebPage::SetVisibilityState(m_visibilityState, /* isInitialState */ true), m_pageID);
421 void WebPageProxy::close()
428 m_backForwardList->pageClosed();
429 m_pageClient->pageClosed();
431 process()->disconnectFramesFromPage(this);
434 #if ENABLE(INSPECTOR)
436 m_inspector->invalidate();
441 #if ENABLE(FULLSCREEN_API)
442 if (m_fullScreenManager) {
443 m_fullScreenManager->invalidate();
444 m_fullScreenManager = 0;
448 if (m_openPanelResultListener) {
449 m_openPanelResultListener->invalidate();
450 m_openPanelResultListener = 0;
453 #if ENABLE(INPUT_TYPE_COLOR)
454 if (m_colorChooser) {
455 m_colorChooser->invalidate();
456 m_colorChooser = nullptr;
459 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
460 if (m_colorPickerResultListener) {
461 m_colorPickerResultListener->invalidate();
462 m_colorPickerResultListener = nullptr;
467 #if ENABLE(GEOLOCATION)
468 m_geolocationPermissionRequestManager.invalidateRequests();
471 m_notificationPermissionRequestManager.invalidateRequests();
472 #if ENABLE(TIZEN_MEDIA_STREAM)
473 m_userMediaPermissionRequestManager.invalidateRequests();
476 m_toolTip = String();
478 m_mainFrameHasHorizontalScrollbar = false;
479 m_mainFrameHasVerticalScrollbar = false;
481 m_mainFrameIsPinnedToLeftSide = false;
482 m_mainFrameIsPinnedToRightSide = false;
484 m_visibleScrollerThumbRect = IntRect();
486 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
487 invalidateCallbackMap(m_booleanCallbacks);
488 invalidateCallbackMap(m_dictionaryCallbacks);
490 invalidateCallbackMap(m_voidCallbacks);
491 invalidateCallbackMap(m_dataCallbacks);
492 invalidateCallbackMap(m_stringCallbacks);
493 m_loadDependentStringCallbackIDs.clear();
494 invalidateCallbackMap(m_scriptValueCallbacks);
495 invalidateCallbackMap(m_computedPagesCallbacks);
497 invalidateCallbackMap(m_printFinishedCallbacks);
500 Vector<WebEditCommandProxy*> editCommandVector;
501 copyToVector(m_editCommandSet, editCommandVector);
502 m_editCommandSet.clear();
503 for (size_t i = 0, size = editCommandVector.size(); i < size; ++i)
504 editCommandVector[i]->invalidate();
506 m_activePopupMenu = 0;
508 m_estimatedProgress = 0.0;
510 m_loaderClient.initialize(0);
511 m_policyClient.initialize(0);
512 m_uiClient.initialize(0);
514 m_drawingArea = nullptr;
516 process()->send(Messages::WebPage::Close(), m_pageID);
517 process()->removeWebPage(m_pageID);
520 bool WebPageProxy::tryClose()
525 process()->send(Messages::WebPage::TryClose(), m_pageID);
526 process()->responsivenessTimer()->start();
530 bool WebPageProxy::maybeInitializeSandboxExtensionHandle(const KURL& url, SandboxExtension::Handle& sandboxExtensionHandle)
532 if (!url.isLocalFile())
535 #if ENABLE(INSPECTOR)
536 // Don't give the inspector full access to the file system.
537 if (WebInspectorProxy::isInspectorPage(this))
541 SandboxExtension::createHandle("/", SandboxExtension::ReadOnly, sandboxExtensionHandle);
545 void WebPageProxy::loadURL(const String& url)
547 setPendingAPIRequestURL(url);
550 reattachToWebProcess();
552 SandboxExtension::Handle sandboxExtensionHandle;
553 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), url), sandboxExtensionHandle);
554 if (createdExtension)
555 process()->willAcquireUniversalFileReadSandboxExtension();
556 process()->send(Messages::WebPage::LoadURL(url, sandboxExtensionHandle), m_pageID);
557 process()->responsivenessTimer()->start();
560 void WebPageProxy::loadURLRequest(WebURLRequest* urlRequest)
562 setPendingAPIRequestURL(urlRequest->resourceRequest().url());
565 reattachToWebProcess();
567 SandboxExtension::Handle sandboxExtensionHandle;
568 bool createdExtension = maybeInitializeSandboxExtensionHandle(urlRequest->resourceRequest().url(), sandboxExtensionHandle);
569 if (createdExtension)
570 process()->willAcquireUniversalFileReadSandboxExtension();
571 process()->send(Messages::WebPage::LoadURLRequest(urlRequest->resourceRequest(), sandboxExtensionHandle), m_pageID);
572 process()->responsivenessTimer()->start();
575 void WebPageProxy::loadHTMLString(const String& htmlString, const String& baseURL)
578 reattachToWebProcess();
580 process()->assumeReadAccessToBaseURL(baseURL);
581 process()->send(Messages::WebPage::LoadHTMLString(htmlString, baseURL), m_pageID);
582 process()->responsivenessTimer()->start();
585 void WebPageProxy::loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL)
588 reattachToWebProcess();
591 m_mainFrame->setUnreachableURL(unreachableURL);
593 process()->assumeReadAccessToBaseURL(baseURL);
594 process()->send(Messages::WebPage::LoadAlternateHTMLString(htmlString, baseURL, unreachableURL), m_pageID);
595 process()->responsivenessTimer()->start();
598 void WebPageProxy::loadPlainTextString(const String& string)
601 reattachToWebProcess();
603 process()->send(Messages::WebPage::LoadPlainTextString(string), m_pageID);
604 process()->responsivenessTimer()->start();
607 void WebPageProxy::loadWebArchiveData(const WebData* webArchiveData)
610 reattachToWebProcess();
612 process()->send(Messages::WebPage::LoadWebArchiveData(webArchiveData->dataReference()), m_pageID);
613 process()->responsivenessTimer()->start();
617 void WebPageProxy::loadContentsbyMimeType(const WebData* contents, const String& mimeType, const String& encoding, const String& baseURL)
620 reattachToWebProcess();
622 process()->assumeReadAccessToBaseURL(baseURL);
623 #if ENABLE(TIZEN_UNIVERSAL_FILE_READ_ACCESS)
624 SandboxExtension::Handle sandboxExtensionHandleEmail;
625 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), baseURL), sandboxExtensionHandleEmail);
626 if (createdExtension)
627 process()->willAcquireUniversalFileReadSandboxExtension();
629 process()->send(Messages::WebPage::LoadContentsbyMimeType(contents->dataReference(), mimeType, encoding, baseURL), m_pageID);
630 process()->responsivenessTimer()->start();
634 void WebPageProxy::stopLoading()
639 process()->send(Messages::WebPage::StopLoading(), m_pageID);
640 process()->responsivenessTimer()->start();
643 void WebPageProxy::reload(bool reloadFromOrigin)
645 SandboxExtension::Handle sandboxExtensionHandle;
647 if (m_backForwardList->currentItem()) {
648 String url = m_backForwardList->currentItem()->url();
649 setPendingAPIRequestURL(url);
651 // We may not have an extension yet if back/forward list was reinstated after a WebProcess crash or a browser relaunch
652 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), url), sandboxExtensionHandle);
653 if (createdExtension)
654 process()->willAcquireUniversalFileReadSandboxExtension();
658 reattachToWebProcessWithItem(m_backForwardList->currentItem());
662 process()->send(Messages::WebPage::Reload(reloadFromOrigin, sandboxExtensionHandle), m_pageID);
663 process()->responsivenessTimer()->start();
666 void WebPageProxy::goForward()
668 if (isValid() && !canGoForward())
671 WebBackForwardListItem* forwardItem = m_backForwardList->forwardItem();
675 setPendingAPIRequestURL(forwardItem->url());
678 reattachToWebProcessWithItem(forwardItem);
682 process()->send(Messages::WebPage::GoForward(forwardItem->itemID()), m_pageID);
683 process()->responsivenessTimer()->start();
686 bool WebPageProxy::canGoForward() const
688 return m_backForwardList->forwardItem();
691 void WebPageProxy::goBack()
693 if (isValid() && !canGoBack())
696 WebBackForwardListItem* backItem = m_backForwardList->backItem();
700 setPendingAPIRequestURL(backItem->url());
703 reattachToWebProcessWithItem(backItem);
707 process()->send(Messages::WebPage::GoBack(backItem->itemID()), m_pageID);
708 process()->responsivenessTimer()->start();
711 bool WebPageProxy::canGoBack() const
713 return m_backForwardList->backItem();
716 void WebPageProxy::goToBackForwardItem(WebBackForwardListItem* item)
719 reattachToWebProcessWithItem(item);
723 setPendingAPIRequestURL(item->url());
725 process()->send(Messages::WebPage::GoToBackForwardItem(item->itemID()), m_pageID);
726 process()->responsivenessTimer()->start();
729 void WebPageProxy::tryRestoreScrollPosition()
734 process()->send(Messages::WebPage::TryRestoreScrollPosition(), m_pageID);
737 void WebPageProxy::didChangeBackForwardList(WebBackForwardListItem* added, Vector<RefPtr<APIObject> >* removed)
739 m_loaderClient.didChangeBackForwardList(this, added, removed);
742 void WebPageProxy::shouldGoToBackForwardListItem(uint64_t itemID, bool& shouldGoToBackForwardItem)
744 WebBackForwardListItem* item = process()->webBackForwardItem(itemID);
745 shouldGoToBackForwardItem = item && m_loaderClient.shouldGoToBackForwardListItem(this, item);
748 void WebPageProxy::willGoToBackForwardListItem(uint64_t itemID, CoreIPC::ArgumentDecoder* arguments)
750 RefPtr<APIObject> userData;
751 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
752 if (!arguments->decode(messageDecoder))
755 if (WebBackForwardListItem* item = process()->webBackForwardItem(itemID))
756 m_loaderClient.willGoToBackForwardListItem(this, item, userData.get());
759 String WebPageProxy::activeURL() const
761 // If there is a currently pending url, it is the active URL,
762 // even when there's no main frame yet, as it might be the
763 // first API request.
764 if (!m_pendingAPIRequestURL.isNull())
765 return m_pendingAPIRequestURL;
770 if (!m_mainFrame->unreachableURL().isEmpty())
771 return m_mainFrame->unreachableURL();
773 switch (m_mainFrame->loadState()) {
774 case WebFrameProxy::LoadStateProvisional:
775 return m_mainFrame->provisionalURL();
776 case WebFrameProxy::LoadStateCommitted:
777 case WebFrameProxy::LoadStateFinished:
778 return m_mainFrame->url();
781 ASSERT_NOT_REACHED();
785 String WebPageProxy::provisionalURL() const
789 return m_mainFrame->provisionalURL();
792 String WebPageProxy::committedURL() const
797 return m_mainFrame->url();
800 bool WebPageProxy::canShowMIMEType(const String& mimeType) const
802 if (MIMETypeRegistry::canShowMIMEType(mimeType))
805 String newMimeType = mimeType;
806 PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL());
807 if (!plugin.path.isNull() && m_pageGroup->preferences()->pluginsEnabled())
813 void WebPageProxy::setDrawsBackground(bool drawsBackground)
815 if (m_drawsBackground == drawsBackground)
818 m_drawsBackground = drawsBackground;
821 process()->send(Messages::WebPage::SetDrawsBackground(drawsBackground), m_pageID);
824 void WebPageProxy::setDrawsTransparentBackground(bool drawsTransparentBackground)
826 if (m_drawsTransparentBackground == drawsTransparentBackground)
829 m_drawsTransparentBackground = drawsTransparentBackground;
832 process()->send(Messages::WebPage::SetDrawsTransparentBackground(drawsTransparentBackground), m_pageID);
835 void WebPageProxy::viewWillStartLiveResize()
839 process()->send(Messages::WebPage::ViewWillStartLiveResize(), m_pageID);
842 void WebPageProxy::viewWillEndLiveResize()
846 process()->send(Messages::WebPage::ViewWillEndLiveResize(), m_pageID);
849 void WebPageProxy::setViewNeedsDisplay(const IntRect& rect)
851 m_pageClient->setViewNeedsDisplay(rect);
854 void WebPageProxy::displayView()
856 m_pageClient->displayView();
859 void WebPageProxy::scrollView(const IntRect& scrollRect, const IntSize& scrollOffset)
861 m_pageClient->scrollView(scrollRect, scrollOffset);
864 void WebPageProxy::viewStateDidChange(ViewStateFlags flags)
869 if (flags & ViewIsFocused)
870 process()->send(Messages::WebPage::SetFocused(m_pageClient->isViewFocused()), m_pageID);
872 if (flags & ViewWindowIsActive)
873 process()->send(Messages::WebPage::SetActive(m_pageClient->isViewWindowActive()), m_pageID);
875 if (flags & ViewIsVisible) {
876 bool isVisible = m_pageClient->isViewVisible();
877 if (isVisible != m_isVisible) {
878 m_isVisible = isVisible;
879 m_drawingArea->visibilityDidChange();
882 // If we've started the responsiveness timer as part of telling the web process to update the backing store
883 // state, it might not send back a reply (since it won't paint anything if the web page is hidden) so we
884 // stop the unresponsiveness timer here.
885 process()->responsivenessTimer()->stop();
890 if (flags & ViewIsInWindow) {
891 bool isInWindow = m_pageClient->isViewInWindow();
892 if (m_isInWindow != isInWindow) {
893 m_isInWindow = isInWindow;
894 process()->send(Messages::WebPage::SetIsInWindow(isInWindow), m_pageID);
898 LayerHostingMode layerHostingMode = m_pageClient->viewLayerHostingMode();
899 if (m_layerHostingMode != layerHostingMode) {
900 m_layerHostingMode = layerHostingMode;
901 m_drawingArea->layerHostingModeDidChange();
906 #if ENABLE(PAGE_VISIBILITY_API)
907 PageVisibilityState visibilityState = PageVisibilityStateHidden;
909 if (m_pageClient->isViewVisible())
910 visibilityState = PageVisibilityStateVisible;
912 if (visibilityState != m_visibilityState) {
913 m_visibilityState = visibilityState;
914 process()->send(Messages::WebPage::SetVisibilityState(visibilityState, false), m_pageID);
918 updateBackingStoreDiscardableState();
921 IntSize WebPageProxy::viewSize() const
923 return m_pageClient->viewSize();
926 void WebPageProxy::setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent& keyboardEvent)
930 process()->send(Messages::WebPage::SetInitialFocus(forward, isKeyboardEventValid, keyboardEvent), m_pageID);
933 void WebPageProxy::setWindowResizerSize(const IntSize& windowResizerSize)
937 process()->send(Messages::WebPage::SetWindowResizerSize(windowResizerSize), m_pageID);
940 void WebPageProxy::clearSelection()
944 process()->send(Messages::WebPage::ClearSelection(), m_pageID);
947 void WebPageProxy::validateCommand(const String& commandName, PassRefPtr<ValidateCommandCallback> callback)
950 callback->invalidate();
954 uint64_t callbackID = callback->callbackID();
955 m_validateCommandCallbacks.set(callbackID, callback.get());
956 process()->send(Messages::WebPage::ValidateCommand(commandName, callbackID), m_pageID);
959 void WebPageProxy::setMaintainsInactiveSelection(bool newValue)
961 m_maintainsInactiveSelection = newValue;
964 void WebPageProxy::executeEditCommand(const String& commandName)
969 DEFINE_STATIC_LOCAL(String, ignoreSpellingCommandName, ("ignoreSpelling"));
970 if (commandName == ignoreSpellingCommandName)
971 ++m_pendingLearnOrIgnoreWordMessageCount;
973 process()->send(Messages::WebPage::ExecuteEditCommand(commandName), m_pageID);
976 #if USE(TILED_BACKING_STORE)
977 void WebPageProxy::setViewportSize(const IntSize& size)
982 process()->send(Messages::WebPage::SetViewportSize(size), m_pageID);
986 #if ENABLE(DRAG_SUPPORT)
987 void WebPageProxy::dragEntered(DragData* dragData, const String& dragStorageName)
989 SandboxExtension::Handle sandboxExtensionHandle;
990 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
991 performDragControllerAction(DragControllerActionEntered, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
994 void WebPageProxy::dragUpdated(DragData* dragData, const String& dragStorageName)
996 SandboxExtension::Handle sandboxExtensionHandle;
997 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
998 performDragControllerAction(DragControllerActionUpdated, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
1001 void WebPageProxy::dragExited(DragData* dragData, const String& dragStorageName)
1003 SandboxExtension::Handle sandboxExtensionHandle;
1004 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
1005 performDragControllerAction(DragControllerActionExited, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
1008 #if ENABLE(TIZEN_DRAG_SUPPORT)
1009 void WebPageProxy::performDrag(DragData* dragData, const String& dragStorageName)
1011 void WebPageProxy::performDrag(DragData* dragData, const String& dragStorageName, const SandboxExtension::Handle& sandboxExtensionHandle, const SandboxExtension::HandleArray& sandboxExtensionsForUpload)
1014 #if ENABLE(TIZEN_DRAG_SUPPORT)
1015 TIZEN_LOGI("dragData (%p)", dragData);
1016 SandboxExtension::Handle sandboxExtensionHandle;
1017 SandboxExtension::HandleArray sandboxExtensionHandleEmptyArray;
1018 performDragControllerAction(DragControllerActionPerformDrag, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionHandleEmptyArray);
1020 performDragControllerAction(DragControllerActionPerformDrag, dragData, dragStorageName, sandboxExtensionHandle, sandboxExtensionsForUpload);
1024 void WebPageProxy::performDragControllerAction(DragControllerAction action, DragData* dragData, const String& dragStorageName, const SandboxExtension::Handle& sandboxExtensionHandle, const SandboxExtension::HandleArray& sandboxExtensionsForUpload)
1029 // FIXME: We should pass the drag data map only on DragEnter.
1030 process()->send(Messages::WebPage::PerformDragControllerAction(action, dragData->clientPosition(), dragData->globalPosition(),
1031 dragData->draggingSourceOperationMask(), dragData->dragDataMap(), dragData->flags()), m_pageID);
1032 #elif PLATFORM(QT) || PLATFORM(GTK) || ENABLE(TIZEN_DRAG_SUPPORT)
1033 process()->send(Messages::WebPage::PerformDragControllerAction(action, *dragData), m_pageID);
1035 process()->send(Messages::WebPage::PerformDragControllerAction(action, dragData->clientPosition(), dragData->globalPosition(), dragData->draggingSourceOperationMask(), dragStorageName, dragData->flags(), sandboxExtensionHandle, sandboxExtensionsForUpload), m_pageID);
1039 void WebPageProxy::didPerformDragControllerAction(WebCore::DragSession dragSession)
1041 m_currentDragSession = dragSession;
1044 #if PLATFORM(QT) || PLATFORM(GTK) || ENABLE(TIZEN_DRAG_SUPPORT)
1045 void WebPageProxy::startDrag(const DragData& dragData, const ShareableBitmap::Handle& dragImageHandle)
1047 TIZEN_LOGI("dragData (%p)", dragData);
1048 RefPtr<ShareableBitmap> dragImage = 0;
1049 if (!dragImageHandle.isNull()) {
1050 dragImage = ShareableBitmap::create(dragImageHandle);
1055 m_pageClient->startDrag(dragData, dragImage.release());
1059 void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& globalPosition, uint64_t operation)
1061 TIZEN_LOGI("clientPosition (%p)", clientPosition);
1064 process()->send(Messages::WebPage::DragEnded(clientPosition, globalPosition, operation), m_pageID);
1066 #endif // ENABLE(DRAG_SUPPORT)
1068 void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event)
1073 // NOTE: This does not start the responsiveness timer because mouse move should not indicate interaction.
1074 if (event.type() != WebEvent::MouseMove)
1075 process()->responsivenessTimer()->start();
1077 if (m_processingMouseMoveEvent) {
1078 m_nextMouseMoveEvent = adoptPtr(new NativeWebMouseEvent(event));
1082 m_processingMouseMoveEvent = true;
1085 // <https://bugs.webkit.org/show_bug.cgi?id=57904> We need to keep track of the mouse down event in the case where we
1086 // display a popup menu for select elements. When the user changes the selected item,
1087 // we fake a mouse up event by using this stored down event. This event gets cleared
1088 // when the mouse up message is received from WebProcess.
1089 if (event.type() == WebEvent::MouseDown)
1090 m_currentlyProcessedMouseDownEvent = adoptPtr(new NativeWebMouseEvent(event));
1092 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
1093 // We have to hide text-selection's context menu when other area is clicked.
1094 // In case of normal context menu, it is hided by elm_ctxpopup's logic.
1095 if (event.type() == WebEvent::MouseDown)
1099 if (m_shouldSendEventsSynchronously) {
1100 bool handled = false;
1101 process()->sendSync(Messages::WebPage::MouseEventSyncForTesting(event), Messages::WebPage::MouseEventSyncForTesting::Reply(handled), m_pageID);
1102 didReceiveEvent(event.type(), handled);
1104 process()->send(Messages::WebPage::MouseEvent(event), m_pageID);
1107 #if MERGE_WHEEL_EVENTS
1108 static bool canCoalesce(const WebWheelEvent& a, const WebWheelEvent& b)
1110 if (a.position() != b.position())
1112 if (a.globalPosition() != b.globalPosition())
1114 if (a.modifiers() != b.modifiers())
1116 if (a.granularity() != b.granularity())
1119 if (a.phase() != b.phase())
1121 if (a.momentumPhase() != b.momentumPhase())
1123 if (a.hasPreciseScrollingDeltas() != b.hasPreciseScrollingDeltas())
1130 static WebWheelEvent coalesce(const WebWheelEvent& a, const WebWheelEvent& b)
1132 ASSERT(canCoalesce(a, b));
1134 FloatSize mergedDelta = a.delta() + b.delta();
1135 FloatSize mergedWheelTicks = a.wheelTicks() + b.wheelTicks();
1138 FloatSize mergedUnacceleratedScrollingDelta = a.unacceleratedScrollingDelta() + b.unacceleratedScrollingDelta();
1140 return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.directionInvertedFromDevice(), b.phase(), b.momentumPhase(), b.hasPreciseScrollingDeltas(), b.scrollCount(), mergedUnacceleratedScrollingDelta, b.modifiers(), b.timestamp());
1142 return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.modifiers(), b.timestamp());
1145 #endif // MERGE_WHEEL_EVENTS
1147 static WebWheelEvent coalescedWheelEvent(Deque<NativeWebWheelEvent>& queue, Vector<NativeWebWheelEvent>& coalescedEvents)
1149 ASSERT(!queue.isEmpty());
1150 ASSERT(coalescedEvents.isEmpty());
1152 #if MERGE_WHEEL_EVENTS
1153 NativeWebWheelEvent firstEvent = queue.takeFirst();
1154 coalescedEvents.append(firstEvent);
1156 WebWheelEvent event = firstEvent;
1157 while (!queue.isEmpty() && canCoalesce(event, queue.first())) {
1158 NativeWebWheelEvent firstEvent = queue.takeFirst();
1159 coalescedEvents.append(firstEvent);
1160 event = coalesce(event, firstEvent);
1165 while (!queue.isEmpty())
1166 coalescedEvents.append(queue.takeFirst());
1167 return coalescedEvents.last();
1171 void WebPageProxy::handleWheelEvent(const NativeWebWheelEvent& event)
1176 if (!m_currentlyProcessedWheelEvents.isEmpty()) {
1177 m_wheelEventQueue.append(event);
1178 if (m_wheelEventQueue.size() < wheelEventQueueSizeThreshold)
1180 // The queue has too many wheel events, so push a new event.
1183 if (!m_wheelEventQueue.isEmpty()) {
1184 processNextQueuedWheelEvent();
1188 OwnPtr<Vector<NativeWebWheelEvent> > coalescedWheelEvent = adoptPtr(new Vector<NativeWebWheelEvent>);
1189 coalescedWheelEvent->append(event);
1190 m_currentlyProcessedWheelEvents.append(coalescedWheelEvent.release());
1191 sendWheelEvent(event);
1194 void WebPageProxy::processNextQueuedWheelEvent()
1196 OwnPtr<Vector<NativeWebWheelEvent> > nextCoalescedEvent = adoptPtr(new Vector<NativeWebWheelEvent>);
1197 WebWheelEvent nextWheelEvent = coalescedWheelEvent(m_wheelEventQueue, *nextCoalescedEvent.get());
1198 m_currentlyProcessedWheelEvents.append(nextCoalescedEvent.release());
1199 sendWheelEvent(nextWheelEvent);
1202 void WebPageProxy::sendWheelEvent(const WebWheelEvent& event)
1204 process()->responsivenessTimer()->start();
1206 if (m_shouldSendEventsSynchronously) {
1207 bool handled = false;
1208 process()->sendSync(Messages::WebPage::WheelEventSyncForTesting(event), Messages::WebPage::WheelEventSyncForTesting::Reply(handled), m_pageID);
1209 didReceiveEvent(event.type(), handled);
1213 process()->send(Messages::EventDispatcher::WheelEvent(m_pageID, event, canGoBack(), canGoForward()), 0);
1216 void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event)
1221 LOG(KeyHandling, "WebPageProxy::handleKeyboardEvent: %s", webKeyboardEventTypeString(event.type()));
1223 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1224 if (!isWaitingForJavaScriptPopupReply()) {
1225 m_keyEventQueue.append(event);
1227 process()->responsivenessTimer()->start();
1228 if (m_shouldSendEventsSynchronously) {
1229 bool handled = false;
1230 process()->sendSync(Messages::WebPage::KeyEventSyncForTesting(event), Messages::WebPage::KeyEventSyncForTesting::Reply(handled), m_pageID);
1231 didReceiveEvent(event.type(), handled);
1233 process()->send(Messages::WebPage::KeyEvent(event), m_pageID);
1235 if (m_keyEventQueue.isEmpty()) {
1236 bool handled = false;
1237 m_pageClient->doneWithKeyEvent(event, handled);
1239 QueuedUIEvents<NativeWebKeyboardEvent>& lastEvent = m_keyEventQueue.last();
1240 lastEvent.deferredEvents.append(event);
1244 m_keyEventQueue.append(event);
1246 process()->responsivenessTimer()->start();
1247 if (m_shouldSendEventsSynchronously) {
1248 bool handled = false;
1249 process()->sendSync(Messages::WebPage::KeyEventSyncForTesting(event), Messages::WebPage::KeyEventSyncForTesting::Reply(handled), m_pageID);
1250 didReceiveEvent(event.type(), handled);
1251 } else if (m_keyEventQueue.size() == 1) // Otherwise, sent from DidReceiveEvent message handler.
1252 process()->send(Messages::WebPage::KeyEvent(event), m_pageID);
1256 #if ENABLE(GESTURE_EVENTS)
1257 void WebPageProxy::handleGestureEvent(const WebGestureEvent& event)
1262 #if ENABLE(TIZEN_ISF_PORT) || ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
1263 if (event.type() == WebEvent::GestureSingleTap) {
1264 #if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
1265 FocusRing* focusRing = ewkViewGetFocusRing(viewWidget());
1267 IntPoint tapPosition = EwkViewImpl::fromEvasObject(viewWidget())->transformToScene().mapPoint(event.position());
1268 focusRing->requestToShow(tapPosition, true);
1272 #if ENABLE(TIZEN_ISF_PORT)
1273 InputMethodContextEfl* inputMethodContext = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->inputMethodContext();
1274 if (inputMethodContext)
1275 inputMethodContext->resetIMFContext();
1280 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1281 if (!isWaitingForJavaScriptPopupReply()) {
1282 m_gestureEventQueue.append(event);
1284 process()->responsivenessTimer()->start();
1285 process()->send(Messages::EventDispatcher::GestureEvent(m_pageID, event), 0);
1287 if (m_gestureEventQueue.isEmpty()) {
1288 bool isEventHandled = false;
1289 m_pageClient->doneWithGestureEvent(event, isEventHandled);
1291 QueuedUIEvents<WebGestureEvent>& lastEvent = m_gestureEventQueue.last();
1292 lastEvent.deferredEvents.append(event);
1296 m_gestureEventQueue.append(event);
1298 process()->responsivenessTimer()->start();
1299 process()->send(Messages::EventDispatcher::GestureEvent(m_pageID, event), 0);
1304 #if ENABLE(TOUCH_EVENTS)
1306 void WebPageProxy::handlePotentialActivation(const IntPoint& touchPoint, const IntSize& touchArea)
1308 process()->send(Messages::WebPage::HighlightPotentialActivation(touchPoint, touchArea), m_pageID);
1312 void WebPageProxy::handleTouchEvent(const NativeWebTouchEvent& event)
1314 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
1315 if (!isValid() || isContentSuspendedByInspector())
1321 // If the page is suspended, which should be the case during panning, pinching
1322 // and animation on the page itself (kinetic scrolling, tap to zoom) etc, then
1323 // we do not send any of the events to the page even if is has listeners.
1324 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1325 if (m_needTouchEvents && !m_isPageSuspended && !isWaitingForJavaScriptPopupReply()) {
1327 if (m_needTouchEvents && !m_isPageSuspended) {
1330 // Do not send the TouchMove event if last TouchMove is not processed yet.
1331 // TouchMove event will be sent too many times without below codes,
1332 // and it will affect Web Applications' performance.
1333 if (event.type() == WebEvent::TouchMove
1334 && !m_touchEventQueue.isEmpty()
1335 && m_touchEventQueue.last().forwardedEvent.type() == event.type())
1338 m_touchEventQueue.append(event);
1339 process()->responsivenessTimer()->start();
1340 if (m_shouldSendEventsSynchronously) {
1341 bool handled = false;
1342 process()->sendSync(Messages::WebPage::TouchEventSyncForTesting(event), Messages::WebPage::TouchEventSyncForTesting::Reply(handled), m_pageID);
1343 didReceiveEvent(event.type(), handled);
1345 process()->send(Messages::WebPage::TouchEvent(event), m_pageID);
1347 if (m_touchEventQueue.isEmpty()) {
1348 bool isEventHandled = false;
1349 m_pageClient->doneWithTouchEvent(event, isEventHandled);
1351 // We attach the incoming events to the newest queued event so that all
1352 // the events are delivered in the correct order when the event is dequed.
1353 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
1354 QueuedUIEvents<NativeWebTouchEvent>& lastEvent = m_touchEventQueue.last();
1355 lastEvent.deferredEvents.append(event);
1357 QueuedTouchEvents& lastEvent = m_touchEventQueue.last();
1358 lastEvent.deferredTouchEvents.append(event);
1365 #if ENABLE(SCREEN_ORIENTATION_SUPPORT) && ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT)
1366 void WebPageProxy::lockOrientation(int willLockOrientation, bool& result)
1368 result = m_pageClient->lockOrientation(willLockOrientation);
1370 void WebPageProxy::unlockOrientation()
1372 m_pageClient->unlockOrientation();
1376 void WebPageProxy::scrollBy(ScrollDirection direction, ScrollGranularity granularity)
1381 process()->send(Messages::WebPage::ScrollBy(direction, granularity), m_pageID);
1384 void WebPageProxy::centerSelectionInVisibleArea()
1389 process()->send(Messages::WebPage::CenterSelectionInVisibleArea(), m_pageID);
1392 #if ENABLE(TIZEN_DOWNLOAD_ATTRIBUTE)
1393 void WebPageProxy::startDownload(const ResourceRequest& request, const String& /*suggestedName*/)
1395 // FIXME: suggestedName need to be passed to provide a suggested destination file name
1396 m_process->context()->download(this, request);
1400 void WebPageProxy::receivedPolicyDecision(PolicyAction action, WebFrameProxy* frame, uint64_t listenerID)
1405 if (action == PolicyIgnore)
1406 clearPendingAPIRequestURL();
1408 uint64_t downloadID = 0;
1409 if (action == PolicyDownload) {
1410 // Create a download proxy.
1411 DownloadProxy* download = m_process->context()->createDownloadProxy();
1412 downloadID = download->downloadID();
1413 #if PLATFORM(QT) || PLATFORM(EFL)
1414 // Our design does not suppport downloads without a WebPage.
1415 handleDownloadRequest(download);
1419 // If we received a policy decision while in decidePolicyForResponse the decision will
1420 // be sent back to the web process by decidePolicyForResponse.
1421 if (m_inDecidePolicyForResponse) {
1422 m_syncMimeTypePolicyActionIsValid = true;
1423 m_syncMimeTypePolicyAction = action;
1424 m_syncMimeTypePolicyDownloadID = downloadID;
1428 // If we received a policy decision while in decidePolicyForNavigationAction the decision will
1429 // be sent back to the web process by decidePolicyForNavigationAction.
1430 if (m_inDecidePolicyForNavigationAction) {
1431 m_syncNavigationActionPolicyActionIsValid = true;
1432 m_syncNavigationActionPolicyAction = action;
1433 m_syncNavigationActionPolicyDownloadID = downloadID;
1437 process()->send(Messages::WebPage::DidReceivePolicyDecision(frame->frameID(), listenerID, action, downloadID), m_pageID);
1440 String WebPageProxy::pageTitle() const
1442 // Return the null string if there is no main frame (e.g. nothing has been loaded in the page yet, WebProcess has
1443 // crashed, page has been closed).
1447 return m_mainFrame->title();
1450 void WebPageProxy::setUserAgent(const String& userAgent)
1452 if (m_userAgent == userAgent)
1454 m_userAgent = userAgent;
1458 process()->send(Messages::WebPage::SetUserAgent(m_userAgent), m_pageID);
1461 void WebPageProxy::setApplicationNameForUserAgent(const String& applicationName)
1463 if (m_applicationNameForUserAgent == applicationName)
1466 m_applicationNameForUserAgent = applicationName;
1467 if (!m_customUserAgent.isEmpty())
1470 setUserAgent(standardUserAgent(m_applicationNameForUserAgent));
1473 void WebPageProxy::setCustomUserAgent(const String& customUserAgent)
1475 if (m_customUserAgent == customUserAgent)
1478 m_customUserAgent = customUserAgent;
1480 if (m_customUserAgent.isEmpty()) {
1481 setUserAgent(standardUserAgent(m_applicationNameForUserAgent));
1485 setUserAgent(m_customUserAgent);
1488 void WebPageProxy::resumeActiveDOMObjectsAndAnimations()
1490 if (!isValid() || !m_isPageSuspended)
1493 m_isPageSuspended = false;
1495 process()->send(Messages::WebPage::ResumeActiveDOMObjectsAndAnimations(), m_pageID);
1498 void WebPageProxy::suspendActiveDOMObjectsAndAnimations()
1500 if (!isValid() || m_isPageSuspended)
1503 m_isPageSuspended = true;
1505 process()->send(Messages::WebPage::SuspendActiveDOMObjectsAndAnimations(), m_pageID);
1508 bool WebPageProxy::supportsTextEncoding() const
1510 return !m_mainFrameHasCustomRepresentation && m_mainFrame && !m_mainFrame->isDisplayingStandaloneImageDocument();
1513 void WebPageProxy::setCustomTextEncodingName(const String& encodingName)
1515 if (m_customTextEncodingName == encodingName)
1517 m_customTextEncodingName = encodingName;
1521 process()->send(Messages::WebPage::SetCustomTextEncodingName(encodingName), m_pageID);
1524 void WebPageProxy::terminateProcess()
1526 // NOTE: This uses a check of m_isValid rather than calling isValid() since
1527 // we want this to run even for pages being closed or that already closed.
1531 process()->terminate();
1534 #if !USE(CF) || defined(BUILDING_QT__)
1535 PassRefPtr<WebData> WebPageProxy::sessionStateData(WebPageProxySessionStateFilterCallback, void* context) const
1537 // FIXME: Return session state data for saving Page state.
1541 void WebPageProxy::restoreFromSessionStateData(WebData*)
1543 // FIXME: Restore the Page from the passed in session state data.
1547 bool WebPageProxy::supportsTextZoom() const
1549 if (m_mainFrameHasCustomRepresentation)
1552 // FIXME: This should also return false for standalone media and plug-in documents.
1553 if (!m_mainFrame || m_mainFrame->isDisplayingStandaloneImageDocument())
1559 void WebPageProxy::setTextZoomFactor(double zoomFactor)
1564 if (m_mainFrameHasCustomRepresentation)
1567 if (m_textZoomFactor == zoomFactor)
1570 m_textZoomFactor = zoomFactor;
1571 process()->send(Messages::WebPage::SetTextZoomFactor(m_textZoomFactor), m_pageID);
1574 double WebPageProxy::pageZoomFactor() const
1576 return m_mainFrameHasCustomRepresentation ? m_pageClient->customRepresentationZoomFactor() : m_pageZoomFactor;
1579 void WebPageProxy::setPageZoomFactor(double zoomFactor)
1584 if (m_mainFrameHasCustomRepresentation) {
1585 m_pageClient->setCustomRepresentationZoomFactor(zoomFactor);
1589 if (m_pageZoomFactor == zoomFactor)
1592 m_pageZoomFactor = zoomFactor;
1593 process()->send(Messages::WebPage::SetPageZoomFactor(m_pageZoomFactor), m_pageID);
1596 void WebPageProxy::setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor)
1601 if (m_mainFrameHasCustomRepresentation) {
1602 m_pageClient->setCustomRepresentationZoomFactor(pageZoomFactor);
1606 if (m_pageZoomFactor == pageZoomFactor && m_textZoomFactor == textZoomFactor)
1609 m_pageZoomFactor = pageZoomFactor;
1610 m_textZoomFactor = textZoomFactor;
1611 process()->send(Messages::WebPage::SetPageAndTextZoomFactors(m_pageZoomFactor, m_textZoomFactor), m_pageID);
1614 void WebPageProxy::scalePage(double scale, const IntPoint& origin)
1619 process()->send(Messages::WebPage::ScalePage(scale, origin), m_pageID);
1622 void WebPageProxy::setIntrinsicDeviceScaleFactor(float scaleFactor)
1624 if (m_intrinsicDeviceScaleFactor == scaleFactor)
1627 m_intrinsicDeviceScaleFactor = scaleFactor;
1630 m_drawingArea->deviceScaleFactorDidChange();
1633 void WebPageProxy::windowScreenDidChange(PlatformDisplayID displayID)
1638 process()->send(Messages::WebPage::WindowScreenDidChange(displayID), m_pageID);
1641 float WebPageProxy::deviceScaleFactor() const
1643 if (m_customDeviceScaleFactor)
1644 return m_customDeviceScaleFactor;
1645 return m_intrinsicDeviceScaleFactor;
1648 void WebPageProxy::setCustomDeviceScaleFactor(float customScaleFactor)
1653 if (m_customDeviceScaleFactor == customScaleFactor)
1656 float oldScaleFactor = deviceScaleFactor();
1658 m_customDeviceScaleFactor = customScaleFactor;
1660 if (deviceScaleFactor() != oldScaleFactor)
1661 m_drawingArea->deviceScaleFactorDidChange();
1664 void WebPageProxy::setUseFixedLayout(bool fixed)
1669 // This check is fine as the value is initialized in the web
1670 // process as part of the creation parameters.
1671 if (fixed == m_useFixedLayout)
1674 m_useFixedLayout = fixed;
1676 m_fixedLayoutSize = IntSize();
1677 process()->send(Messages::WebPage::SetUseFixedLayout(fixed), m_pageID);
1680 void WebPageProxy::setFixedLayoutSize(const IntSize& size)
1685 if (size == m_fixedLayoutSize)
1688 m_fixedLayoutSize = size;
1689 process()->send(Messages::WebPage::SetFixedLayoutSize(size), m_pageID);
1692 void WebPageProxy::setPaginationMode(WebCore::Page::Pagination::Mode mode)
1694 if (mode == m_paginationMode)
1697 m_paginationMode = mode;
1701 process()->send(Messages::WebPage::SetPaginationMode(mode), m_pageID);
1704 void WebPageProxy::setPaginationBehavesLikeColumns(bool behavesLikeColumns)
1706 if (behavesLikeColumns == m_paginationBehavesLikeColumns)
1709 m_paginationBehavesLikeColumns = behavesLikeColumns;
1713 process()->send(Messages::WebPage::SetPaginationBehavesLikeColumns(behavesLikeColumns), m_pageID);
1716 void WebPageProxy::setPageLength(double pageLength)
1718 if (pageLength == m_pageLength)
1721 m_pageLength = pageLength;
1725 process()->send(Messages::WebPage::SetPageLength(pageLength), m_pageID);
1728 void WebPageProxy::setGapBetweenPages(double gap)
1730 if (gap == m_gapBetweenPages)
1733 m_gapBetweenPages = gap;
1737 process()->send(Messages::WebPage::SetGapBetweenPages(gap), m_pageID);
1740 void WebPageProxy::pageScaleFactorDidChange(double scaleFactor)
1742 m_pageScaleFactor = scaleFactor;
1743 m_pageClient->pageScaleFactorDidChange();
1746 void WebPageProxy::setMemoryCacheClientCallsEnabled(bool memoryCacheClientCallsEnabled)
1751 if (m_areMemoryCacheClientCallsEnabled == memoryCacheClientCallsEnabled)
1754 m_areMemoryCacheClientCallsEnabled = memoryCacheClientCallsEnabled;
1755 process()->send(Messages::WebPage::SetMemoryCacheMessagesEnabled(memoryCacheClientCallsEnabled), m_pageID);
1758 void WebPageProxy::findStringMatches(const String& string, FindOptions options, unsigned maxMatchCount)
1760 if (string.isEmpty()) {
1761 didFindStringMatches(string, Vector<Vector<WebCore::IntRect> > (), 0);
1765 m_process->send(Messages::WebPage::FindStringMatches(string, options, maxMatchCount), m_pageID);
1768 void WebPageProxy::findString(const String& string, FindOptions options, unsigned maxMatchCount)
1770 if (m_mainFrameHasCustomRepresentation)
1771 m_pageClient->findStringInCustomRepresentation(string, options, maxMatchCount);
1773 process()->send(Messages::WebPage::FindString(string, options, maxMatchCount), m_pageID);
1776 void WebPageProxy::getImageForFindMatch(int32_t matchIndex)
1778 m_process->send(Messages::WebPage::GetImageForFindMatch(matchIndex), m_pageID);
1781 void WebPageProxy::selectFindMatch(int32_t matchIndex)
1783 m_process->send(Messages::WebPage::SelectFindMatch(matchIndex), m_pageID);
1786 void WebPageProxy::hideFindUI()
1788 process()->send(Messages::WebPage::HideFindUI(), m_pageID);
1791 void WebPageProxy::countStringMatches(const String& string, FindOptions options, unsigned maxMatchCount)
1793 if (m_mainFrameHasCustomRepresentation) {
1794 m_pageClient->countStringMatchesInCustomRepresentation(string, options, maxMatchCount);
1801 process()->send(Messages::WebPage::CountStringMatches(string, options, maxMatchCount), m_pageID);
1804 void WebPageProxy::runJavaScriptInMainFrame(const String& script, PassRefPtr<ScriptValueCallback> prpCallback)
1806 RefPtr<ScriptValueCallback> callback = prpCallback;
1808 callback->invalidate();
1812 uint64_t callbackID = callback->callbackID();
1813 m_scriptValueCallbacks.set(callbackID, callback.get());
1814 process()->send(Messages::WebPage::RunJavaScriptInMainFrame(script, callbackID), m_pageID);
1817 void WebPageProxy::getRenderTreeExternalRepresentation(PassRefPtr<StringCallback> prpCallback)
1819 RefPtr<StringCallback> callback = prpCallback;
1821 callback->invalidate();
1825 uint64_t callbackID = callback->callbackID();
1826 m_stringCallbacks.set(callbackID, callback.get());
1827 process()->send(Messages::WebPage::GetRenderTreeExternalRepresentation(callbackID), m_pageID);
1830 void WebPageProxy::getSourceForFrame(WebFrameProxy* frame, PassRefPtr<StringCallback> prpCallback)
1832 RefPtr<StringCallback> callback = prpCallback;
1834 callback->invalidate();
1838 uint64_t callbackID = callback->callbackID();
1839 m_loadDependentStringCallbackIDs.add(callbackID);
1840 m_stringCallbacks.set(callbackID, callback.get());
1841 process()->send(Messages::WebPage::GetSourceForFrame(frame->frameID(), callbackID), m_pageID);
1844 #if ENABLE(WEB_INTENTS)
1845 void WebPageProxy::deliverIntentToFrame(WebFrameProxy* frame, WebIntentData* webIntentData)
1850 process()->send(Messages::WebPage::DeliverIntentToFrame(frame->frameID(), webIntentData->store()), m_pageID);
1854 void WebPageProxy::getContentsAsString(PassRefPtr<StringCallback> prpCallback)
1856 RefPtr<StringCallback> callback = prpCallback;
1858 callback->invalidate();
1862 uint64_t callbackID = callback->callbackID();
1863 m_loadDependentStringCallbackIDs.add(callbackID);
1864 m_stringCallbacks.set(callbackID, callback.get());
1865 process()->send(Messages::WebPage::GetContentsAsString(callbackID), m_pageID);
1869 void WebPageProxy::getContentsAsMHTMLData(PassRefPtr<DataCallback> prpCallback, bool useBinaryEncoding)
1871 RefPtr<DataCallback> callback = prpCallback;
1873 callback->invalidate();
1877 uint64_t callbackID = callback->callbackID();
1878 m_dataCallbacks.set(callbackID, callback.get());
1879 process()->send(Messages::WebPage::GetContentsAsMHTMLData(callbackID, useBinaryEncoding), m_pageID);
1883 void WebPageProxy::getSelectionOrContentsAsString(PassRefPtr<StringCallback> prpCallback)
1885 RefPtr<StringCallback> callback = prpCallback;
1887 callback->invalidate();
1891 uint64_t callbackID = callback->callbackID();
1892 m_stringCallbacks.set(callbackID, callback.get());
1893 process()->send(Messages::WebPage::GetSelectionOrContentsAsString(callbackID), m_pageID);
1896 void WebPageProxy::getMainResourceDataOfFrame(WebFrameProxy* frame, PassRefPtr<DataCallback> prpCallback)
1898 RefPtr<DataCallback> callback = prpCallback;
1900 callback->invalidate();
1904 uint64_t callbackID = callback->callbackID();
1905 m_dataCallbacks.set(callbackID, callback.get());
1906 process()->send(Messages::WebPage::GetMainResourceDataOfFrame(frame->frameID(), callbackID), m_pageID);
1909 void WebPageProxy::getResourceDataFromFrame(WebFrameProxy* frame, WebURL* resourceURL, PassRefPtr<DataCallback> prpCallback)
1911 RefPtr<DataCallback> callback = prpCallback;
1913 callback->invalidate();
1917 uint64_t callbackID = callback->callbackID();
1918 m_dataCallbacks.set(callbackID, callback.get());
1919 process()->send(Messages::WebPage::GetResourceDataFromFrame(frame->frameID(), resourceURL->string(), callbackID), m_pageID);
1922 void WebPageProxy::getWebArchiveOfFrame(WebFrameProxy* frame, PassRefPtr<DataCallback> prpCallback)
1924 RefPtr<DataCallback> callback = prpCallback;
1926 callback->invalidate();
1930 uint64_t callbackID = callback->callbackID();
1931 m_dataCallbacks.set(callbackID, callback.get());
1932 process()->send(Messages::WebPage::GetWebArchiveOfFrame(frame->frameID(), callbackID), m_pageID);
1935 void WebPageProxy::forceRepaint(PassRefPtr<VoidCallback> prpCallback)
1937 RefPtr<VoidCallback> callback = prpCallback;
1939 callback->invalidate();
1943 uint64_t callbackID = callback->callbackID();
1944 m_voidCallbacks.set(callbackID, callback.get());
1945 m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
1946 process()->send(Messages::WebPage::ForceRepaint(callbackID), m_pageID);
1949 void WebPageProxy::preferencesDidChange()
1954 #if ENABLE(INSPECTOR_SERVER)
1955 if (m_pageGroup->preferences()->developerExtrasEnabled())
1956 inspector()->enableRemoteInspection();
1959 // FIXME: It probably makes more sense to send individual preference changes.
1960 // However, WebKitTestRunner depends on getting a preference change notification
1961 // even if nothing changed in UI process, so that overrides get removed.
1963 // Preferences need to be updated during synchronous printing to make "print backgrounds" preference work when toggled from a print dialog checkbox.
1964 process()->send(Messages::WebPage::PreferencesDidChange(pageGroup()->preferences()->store()), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
1967 void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
1969 if (messageID.is<CoreIPC::MessageClassDrawingAreaProxy>()) {
1970 m_drawingArea->didReceiveDrawingAreaProxyMessage(connection, messageID, arguments);
1974 #if USE(UI_SIDE_COMPOSITING)
1975 if (messageID.is<CoreIPC::MessageClassLayerTreeCoordinatorProxy>()) {
1976 m_drawingArea->didReceiveLayerTreeCoordinatorProxyMessage(connection, messageID, arguments);
1981 #if ENABLE(INSPECTOR)
1982 if (messageID.is<CoreIPC::MessageClassWebInspectorProxy>()) {
1983 if (WebInspectorProxy* inspector = this->inspector())
1984 inspector->didReceiveWebInspectorProxyMessage(connection, messageID, arguments);
1989 #if ENABLE(FULLSCREEN_API)
1990 if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) {
1991 fullScreenManager()->didReceiveMessage(connection, messageID, arguments);
1996 didReceiveWebPageProxyMessage(connection, messageID, arguments);
1999 void WebPageProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
2001 #if ENABLE(INSPECTOR)
2002 if (messageID.is<CoreIPC::MessageClassWebInspectorProxy>()) {
2003 if (WebInspectorProxy* inspector = this->inspector())
2004 inspector->didReceiveSyncWebInspectorProxyMessage(connection, messageID, arguments, reply);
2009 #if ENABLE(FULLSCREEN_API)
2010 if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) {
2011 fullScreenManager()->didReceiveSyncMessage(connection, messageID, arguments, reply);
2016 // FIXME: Do something with reply.
2017 didReceiveSyncWebPageProxyMessage(connection, messageID, arguments, reply);
2020 void WebPageProxy::didCreateMainFrame(uint64_t frameID)
2022 MESSAGE_CHECK(!m_mainFrame);
2023 MESSAGE_CHECK(process()->canCreateFrame(frameID));
2025 m_mainFrame = WebFrameProxy::create(this, frameID);
2027 // Add the frame to the process wide map.
2028 process()->frameCreated(frameID, m_mainFrame.get());
2031 void WebPageProxy::didCreateSubframe(uint64_t frameID, uint64_t parentFrameID)
2033 MESSAGE_CHECK(m_mainFrame);
2035 WebFrameProxy* parentFrame = process()->webFrame(parentFrameID);
2036 MESSAGE_CHECK(parentFrame);
2037 MESSAGE_CHECK(parentFrame->isDescendantOf(m_mainFrame.get()));
2039 MESSAGE_CHECK(process()->canCreateFrame(frameID));
2041 RefPtr<WebFrameProxy> subFrame = WebFrameProxy::create(this, frameID);
2043 // Add the frame to the process wide map.
2044 process()->frameCreated(frameID, subFrame.get());
2046 // Insert the frame into the frame hierarchy.
2047 parentFrame->appendChild(subFrame.get());
2050 static bool isDisconnectedFrame(WebFrameProxy* frame)
2052 return !frame->page() || !frame->page()->mainFrame() || !frame->isDescendantOf(frame->page()->mainFrame());
2055 void WebPageProxy::didSaveFrameToPageCache(uint64_t frameID)
2057 MESSAGE_CHECK(m_mainFrame);
2059 WebFrameProxy* subframe = process()->webFrame(frameID);
2060 MESSAGE_CHECK(subframe);
2062 if (isDisconnectedFrame(subframe))
2065 MESSAGE_CHECK(subframe->isDescendantOf(m_mainFrame.get()));
2067 subframe->didRemoveFromHierarchy();
2070 void WebPageProxy::didRestoreFrameFromPageCache(uint64_t frameID, uint64_t parentFrameID)
2072 MESSAGE_CHECK(m_mainFrame);
2074 WebFrameProxy* subframe = process()->webFrame(frameID);
2075 MESSAGE_CHECK(subframe);
2076 MESSAGE_CHECK(!subframe->parentFrame());
2077 MESSAGE_CHECK(subframe->page() == m_mainFrame->page());
2079 WebFrameProxy* parentFrame = process()->webFrame(parentFrameID);
2080 MESSAGE_CHECK(parentFrame);
2081 MESSAGE_CHECK(parentFrame->isDescendantOf(m_mainFrame.get()));
2083 // Insert the frame into the frame hierarchy.
2084 parentFrame->appendChild(subframe);
2088 // Always start progress at initialProgressValue. This helps provide feedback as
2089 // soon as a load starts.
2091 static const double initialProgressValue = 0.1;
2093 double WebPageProxy::estimatedProgress() const
2095 if (!pendingAPIRequestURL().isNull())
2096 return initialProgressValue;
2097 return m_estimatedProgress;
2100 void WebPageProxy::didStartProgress()
2102 m_estimatedProgress = initialProgressValue;
2104 m_loaderClient.didStartProgress(this);
2107 void WebPageProxy::didChangeProgress(double value)
2109 m_estimatedProgress = value;
2111 m_loaderClient.didChangeProgress(this);
2114 void WebPageProxy::didFinishProgress()
2116 m_estimatedProgress = 1.0;
2118 m_loaderClient.didFinishProgress(this);
2121 #if ENABLE(WEB_INTENTS_TAG)
2122 void WebPageProxy::registerIntentServiceForFrame(uint64_t frameID, const IntentServiceInfo& serviceInfo, CoreIPC::ArgumentDecoder* arguments)
2124 RefPtr<APIObject> userData;
2125 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2126 if (!arguments->decode(messageDecoder))
2129 WebFrameProxy* frame = process()->webFrame(frameID);
2130 MESSAGE_CHECK(frame);
2132 RefPtr<WebIntentServiceInfo> webIntentServiceInfo = WebIntentServiceInfo::create(serviceInfo);
2133 m_loaderClient.registerIntentServiceForFrame(this, frame, webIntentServiceInfo.get(), userData.get());
2137 void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, const String& url, const String& unreachableURL, CoreIPC::ArgumentDecoder* arguments)
2139 clearPendingAPIRequestURL();
2141 RefPtr<APIObject> userData;
2142 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2143 if (!arguments->decode(messageDecoder))
2146 WebFrameProxy* frame = process()->webFrame(frameID);
2147 MESSAGE_CHECK(frame);
2148 MESSAGE_CHECK_URL(url);
2150 frame->setUnreachableURL(unreachableURL);
2152 frame->didStartProvisionalLoad(url);
2153 m_loaderClient.didStartProvisionalLoadForFrame(this, frame, userData.get());
2156 void WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, const String& url, CoreIPC::ArgumentDecoder* arguments)
2158 RefPtr<APIObject> userData;
2159 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2160 if (!arguments->decode(messageDecoder))
2163 WebFrameProxy* frame = process()->webFrame(frameID);
2164 MESSAGE_CHECK(frame);
2165 MESSAGE_CHECK_URL(url);
2167 frame->didReceiveServerRedirectForProvisionalLoad(url);
2169 m_loaderClient.didReceiveServerRedirectForProvisionalLoadForFrame(this, frame, userData.get());
2172 void WebPageProxy::didFailProvisionalLoadForFrame(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
2174 RefPtr<APIObject> userData;
2175 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2176 if (!arguments->decode(messageDecoder))
2179 WebFrameProxy* frame = process()->webFrame(frameID);
2180 MESSAGE_CHECK(frame);
2182 frame->didFailProvisionalLoad();
2184 m_loaderClient.didFailProvisionalLoadWithErrorForFrame(this, frame, error, userData.get());
2187 void WebPageProxy::clearLoadDependentCallbacks()
2189 Vector<uint64_t> callbackIDsCopy;
2190 copyToVector(m_loadDependentStringCallbackIDs, callbackIDsCopy);
2191 m_loadDependentStringCallbackIDs.clear();
2193 for (size_t i = 0; i < callbackIDsCopy.size(); ++i) {
2194 RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackIDsCopy[i]);
2196 callback->invalidate();
2200 void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, const String& mimeType, bool frameHasCustomRepresentation, const PlatformCertificateInfo& certificateInfo, CoreIPC::ArgumentDecoder* arguments)
2202 RefPtr<APIObject> userData;
2203 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2204 if (!arguments->decode(messageDecoder))
2207 WebFrameProxy* frame = process()->webFrame(frameID);
2208 MESSAGE_CHECK(frame);
2211 // FIXME (bug 59111): didCommitLoadForFrame comes too late when restoring a page from b/f cache, making us disable secure event mode in password fields.
2212 // FIXME (bug 59121): A load going on in one frame shouldn't affect typing in sibling frames.
2213 m_pageClient->resetTextInputState();
2214 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
2215 // FIXME: Should this be moved inside resetTextInputState()?
2216 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
2217 m_pageClient->dismissDictionaryLookupPanel();
2221 clearLoadDependentCallbacks();
2223 frame->didCommitLoad(mimeType, certificateInfo);
2225 if (frame->isMainFrame()) {
2226 m_mainFrameHasCustomRepresentation = frameHasCustomRepresentation;
2228 if (m_mainFrameHasCustomRepresentation) {
2229 // Always assume that the main frame is pinned here, since the custom representation view will handle
2230 // any wheel events and dispatch them to the WKView when necessary.
2231 m_mainFrameIsPinnedToLeftSide = true;
2232 m_mainFrameIsPinnedToRightSide = true;
2234 m_pageClient->didCommitLoadForMainFrame(frameHasCustomRepresentation);
2237 m_loaderClient.didCommitLoadForFrame(this, frame, userData.get());
2240 void WebPageProxy::didFinishDocumentLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2242 RefPtr<APIObject> userData;
2243 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2244 if (!arguments->decode(messageDecoder))
2247 WebFrameProxy* frame = process()->webFrame(frameID);
2248 MESSAGE_CHECK(frame);
2250 m_loaderClient.didFinishDocumentLoadForFrame(this, frame, userData.get());
2253 #if ENABLE(TIZEN_NATIVE_MEMORY_SNAPSHOT)
2254 const char* isMemorySnapshot = getenv("TIZEN_MEMORY_SNAPSHOT");
2256 void WebPageProxy::didFinishLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2258 RefPtr<APIObject> userData;
2259 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2260 if (!arguments->decode(messageDecoder))
2263 WebFrameProxy* frame = process()->webFrame(frameID);
2264 MESSAGE_CHECK(frame);
2266 frame->didFinishLoad();
2268 m_loaderClient.didFinishLoadForFrame(this, frame, userData.get());
2269 #if ENABLE(TIZEN_NATIVE_MEMORY_SNAPSHOT)
2270 if (isMemorySnapshot && isMemorySnapshot[0] != '0')
2271 dumpMemorySnapshot();
2275 void WebPageProxy::didFailLoadForFrame(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
2277 RefPtr<APIObject> userData;
2278 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2279 if (!arguments->decode(messageDecoder))
2282 WebFrameProxy* frame = process()->webFrame(frameID);
2283 MESSAGE_CHECK(frame);
2285 clearLoadDependentCallbacks();
2287 frame->didFailLoad();
2289 m_loaderClient.didFailLoadWithErrorForFrame(this, frame, error, userData.get());
2292 void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t opaqueSameDocumentNavigationType, const String& url, CoreIPC::ArgumentDecoder* arguments)
2294 RefPtr<APIObject> userData;
2295 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2296 if (!arguments->decode(messageDecoder))
2299 WebFrameProxy* frame = process()->webFrame(frameID);
2300 MESSAGE_CHECK(frame);
2301 MESSAGE_CHECK_URL(url);
2303 clearPendingAPIRequestURL();
2304 frame->didSameDocumentNavigation(url);
2306 m_loaderClient.didSameDocumentNavigationForFrame(this, frame, static_cast<SameDocumentNavigationType>(opaqueSameDocumentNavigationType), userData.get());
2309 void WebPageProxy::didReceiveTitleForFrame(uint64_t frameID, const String& title, CoreIPC::ArgumentDecoder* arguments)
2311 RefPtr<APIObject> userData;
2312 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2313 if (!arguments->decode(messageDecoder))
2316 WebFrameProxy* frame = process()->webFrame(frameID);
2317 MESSAGE_CHECK(frame);
2319 frame->didChangeTitle(title);
2321 m_loaderClient.didReceiveTitleForFrame(this, title, frame, userData.get());
2324 void WebPageProxy::didFirstLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2326 RefPtr<APIObject> userData;
2327 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2328 if (!arguments->decode(messageDecoder))
2331 WebFrameProxy* frame = process()->webFrame(frameID);
2332 MESSAGE_CHECK(frame);
2334 m_loaderClient.didFirstLayoutForFrame(this, frame, userData.get());
2337 void WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2339 RefPtr<APIObject> userData;
2340 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2341 if (!arguments->decode(messageDecoder))
2344 WebFrameProxy* frame = process()->webFrame(frameID);
2345 MESSAGE_CHECK(frame);
2348 if (frame->isMainFrame())
2349 m_pageClient->didFirstVisuallyNonEmptyLayoutForMainFrame();
2352 m_loaderClient.didFirstVisuallyNonEmptyLayoutForFrame(this, frame, userData.get());
2355 void WebPageProxy::didNewFirstVisuallyNonEmptyLayout(CoreIPC::ArgumentDecoder* arguments)
2357 RefPtr<APIObject> userData;
2358 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2359 if (!arguments->decode(messageDecoder))
2362 m_loaderClient.didNewFirstVisuallyNonEmptyLayout(this, userData.get());
2365 void WebPageProxy::didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2367 RefPtr<APIObject> userData;
2368 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2369 if (!arguments->decode(messageDecoder))
2372 WebFrameProxy* frame = process()->webFrame(frameID);
2373 MESSAGE_CHECK(frame);
2375 frame->didRemoveFromHierarchy();
2377 m_loaderClient.didRemoveFrameFromHierarchy(this, frame, userData.get());
2380 void WebPageProxy::didDisplayInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2382 RefPtr<APIObject> userData;
2383 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2384 if (!arguments->decode(messageDecoder))
2387 WebFrameProxy* frame = process()->webFrame(frameID);
2388 MESSAGE_CHECK(frame);
2390 m_loaderClient.didDisplayInsecureContentForFrame(this, frame, userData.get());
2393 void WebPageProxy::didRunInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
2395 RefPtr<APIObject> userData;
2396 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2397 if (!arguments->decode(messageDecoder))
2400 WebFrameProxy* frame = process()->webFrame(frameID);
2401 MESSAGE_CHECK(frame);
2403 m_loaderClient.didRunInsecureContentForFrame(this, frame, userData.get());
2406 void WebPageProxy::didDetectXSSForFrame(uint64_t frameID, 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 m_loaderClient.didDetectXSSForFrame(this, frame, userData.get());
2419 #if ENABLE(WEB_INTENTS)
2420 void WebPageProxy::didReceiveIntentForFrame(uint64_t frameID, const IntentData& intentData, CoreIPC::ArgumentDecoder* arguments)
2422 RefPtr<APIObject> userData;
2423 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2424 if (!arguments->decode(messageDecoder))
2427 WebFrameProxy* frame = process()->webFrame(frameID);
2428 MESSAGE_CHECK(frame);
2430 RefPtr<WebIntentData> webIntentData = WebIntentData::create(intentData);
2431 m_loaderClient.didReceiveIntentForFrame(this, frame, webIntentData.get(), userData.get());
2435 void WebPageProxy::frameDidBecomeFrameSet(uint64_t frameID, bool value)
2437 WebFrameProxy* frame = process()->webFrame(frameID);
2438 MESSAGE_CHECK(frame);
2440 frame->setIsFrameSet(value);
2441 if (frame->isMainFrame())
2442 m_frameSetLargestFrame = value ? m_mainFrame : 0;
2446 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)
2448 RefPtr<APIObject> userData;
2449 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2450 if (!arguments->decode(messageDecoder))
2453 if (request.url() != pendingAPIRequestURL())
2454 clearPendingAPIRequestURL();
2456 WebFrameProxy* frame = process()->webFrame(frameID);
2457 MESSAGE_CHECK(frame);
2458 MESSAGE_CHECK_URL(request.url());
2460 NavigationType navigationType = static_cast<NavigationType>(opaqueNavigationType);
2461 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
2462 WebMouseEvent::Button mouseButton = static_cast<WebMouseEvent::Button>(opaqueMouseButton);
2464 RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
2466 ASSERT(!m_inDecidePolicyForNavigationAction);
2468 m_inDecidePolicyForNavigationAction = true;
2469 m_syncNavigationActionPolicyActionIsValid = false;
2471 if (!m_policyClient.decidePolicyForNavigationAction(this, frame, navigationType, modifiers, mouseButton, request, listener.get(), userData.get()))
2474 m_inDecidePolicyForNavigationAction = false;
2476 // Check if we received a policy decision already. If we did, we can just pass it back.
2477 receivedPolicyAction = m_syncNavigationActionPolicyActionIsValid;
2478 if (m_syncNavigationActionPolicyActionIsValid) {
2479 policyAction = m_syncNavigationActionPolicyAction;
2480 downloadID = m_syncNavigationActionPolicyDownloadID;
2484 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)
2486 RefPtr<APIObject> userData;
2487 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2488 if (!arguments->decode(messageDecoder))
2491 WebFrameProxy* frame = process()->webFrame(frameID);
2492 MESSAGE_CHECK(frame);
2493 MESSAGE_CHECK_URL(request.url());
2495 NavigationType navigationType = static_cast<NavigationType>(opaqueNavigationType);
2496 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
2497 WebMouseEvent::Button mouseButton = static_cast<WebMouseEvent::Button>(opaqueMouseButton);
2499 RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
2500 if (!m_policyClient.decidePolicyForNewWindowAction(this, frame, navigationType, modifiers, mouseButton, request, frameName, listener.get(), userData.get()))
2504 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)
2506 RefPtr<APIObject> userData;
2507 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2508 if (!arguments->decode(messageDecoder))
2511 WebFrameProxy* frame = process()->webFrame(frameID);
2512 MESSAGE_CHECK(frame);
2513 MESSAGE_CHECK_URL(request.url());
2514 MESSAGE_CHECK_URL(response.url());
2516 RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
2518 ASSERT(!m_inDecidePolicyForResponse);
2520 m_inDecidePolicyForResponse = true;
2521 m_syncMimeTypePolicyActionIsValid = false;
2523 if (!m_policyClient.decidePolicyForResponse(this, frame, response, request, listener.get(), userData.get()))
2526 m_inDecidePolicyForResponse = false;
2528 // Check if we received a policy decision already. If we did, we can just pass it back.
2529 receivedPolicyAction = m_syncMimeTypePolicyActionIsValid;
2530 if (m_syncMimeTypePolicyActionIsValid) {
2531 policyAction = m_syncMimeTypePolicyAction;
2532 downloadID = m_syncMimeTypePolicyDownloadID;
2536 void WebPageProxy::unableToImplementPolicy(uint64_t frameID, const ResourceError& error, CoreIPC::ArgumentDecoder* arguments)
2538 RefPtr<APIObject> userData;
2539 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2540 if (!arguments->decode(messageDecoder))
2543 WebFrameProxy* frame = process()->webFrame(frameID);
2544 MESSAGE_CHECK(frame);
2546 m_policyClient.unableToImplementPolicy(this, frame, error, userData.get());
2551 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
2552 void WebPageProxy::willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const StringPairVector& textFieldValues, bool containsPasswordData, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments)
2554 void WebPageProxy::willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const StringPairVector& textFieldValues, uint64_t listenerID, CoreIPC::ArgumentDecoder* arguments)
2557 RefPtr<APIObject> userData;
2558 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2559 if (!arguments->decode(messageDecoder))
2562 WebFrameProxy* frame = process()->webFrame(frameID);
2563 MESSAGE_CHECK(frame);
2565 WebFrameProxy* sourceFrame = process()->webFrame(sourceFrameID);
2566 MESSAGE_CHECK(sourceFrame);
2568 RefPtr<WebFormSubmissionListenerProxy> listener = frame->setUpFormSubmissionListenerProxy(listenerID);
2569 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
2570 if (!m_formClient.willSubmitForm(this, frame, sourceFrame, textFieldValues.stringPairVector(), containsPasswordData, userData.get(), listener.get()))
2572 if (!m_formClient.willSubmitForm(this, frame, sourceFrame, textFieldValues.stringPairVector(), userData.get(), listener.get()))
2574 listener->continueSubmission();
2577 // ResourceLoad Client
2579 void WebPageProxy::didInitiateLoadForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceRequest& request, bool pageIsProvisionallyLoading)
2581 WebFrameProxy* frame = process()->webFrame(frameID);
2582 MESSAGE_CHECK(frame);
2583 MESSAGE_CHECK_URL(request.url());
2585 m_resourceLoadClient.didInitiateLoadForResource(this, frame, resourceIdentifier, request, pageIsProvisionallyLoading);
2588 void WebPageProxy::didSendRequestForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceRequest& request, const ResourceResponse& redirectResponse)
2590 WebFrameProxy* frame = process()->webFrame(frameID);
2591 MESSAGE_CHECK(frame);
2592 MESSAGE_CHECK_URL(request.url());
2594 m_resourceLoadClient.didSendRequestForResource(this, frame, resourceIdentifier, request, redirectResponse);
2597 void WebPageProxy::didReceiveResponseForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceResponse& response)
2599 WebFrameProxy* frame = process()->webFrame(frameID);
2600 MESSAGE_CHECK(frame);
2601 MESSAGE_CHECK_URL(response.url());
2603 m_resourceLoadClient.didReceiveResponseForResource(this, frame, resourceIdentifier, response);
2606 void WebPageProxy::didReceiveContentLengthForResource(uint64_t frameID, uint64_t resourceIdentifier, uint64_t contentLength)
2608 WebFrameProxy* frame = process()->webFrame(frameID);
2609 MESSAGE_CHECK(frame);
2611 m_resourceLoadClient.didReceiveContentLengthForResource(this, frame, resourceIdentifier, contentLength);
2614 void WebPageProxy::didFinishLoadForResource(uint64_t frameID, uint64_t resourceIdentifier)
2616 WebFrameProxy* frame = process()->webFrame(frameID);
2617 MESSAGE_CHECK(frame);
2619 m_resourceLoadClient.didFinishLoadForResource(this, frame, resourceIdentifier);
2622 void WebPageProxy::didFailLoadForResource(uint64_t frameID, uint64_t resourceIdentifier, const ResourceError& error)
2624 WebFrameProxy* frame = process()->webFrame(frameID);
2625 MESSAGE_CHECK(frame);
2627 m_resourceLoadClient.didFailLoadForResource(this, frame, resourceIdentifier, error);
2632 void WebPageProxy::createNewPage(const ResourceRequest& request, const WindowFeatures& windowFeatures, uint32_t opaqueModifiers, int32_t opaqueMouseButton, uint64_t& newPageID, WebPageCreationParameters& newPageParameters)
2634 RefPtr<WebPageProxy> newPage = m_uiClient.createNewPage(this, request, windowFeatures, static_cast<WebEvent::Modifiers>(opaqueModifiers), static_cast<WebMouseEvent::Button>(opaqueMouseButton));
2636 newPageID = newPage->pageID();
2637 newPageParameters = newPage->creationParameters();
2642 void WebPageProxy::showPage()
2644 m_uiClient.showPage(this);
2647 void WebPageProxy::closePage(bool stopResponsivenessTimer)
2649 if (stopResponsivenessTimer)
2650 process()->responsivenessTimer()->stop();
2652 m_pageClient->clearAllEditCommands();
2653 m_uiClient.close(this);
2656 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2657 bool WebPageProxy::isWaitingForJavaScriptPopupReply()
2659 #if ENABLE(TIZEN_SUPPORT_BEFORE_UNLOAD_CONFIRM_PANEL)
2660 return m_alertReply || m_confirmReply || m_promptReply || m_beforeUnloadConfirmPanelReply;
2662 return m_alertReply || m_confirmReply || m_promptReply;
2668 void WebPageProxy::runJavaScriptAlert(uint64_t frameID, const String& message, PassRefPtr<Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply> reply)
2670 WebFrameProxy* frame = process()->webFrame(frameID);
2671 MESSAGE_CHECK(frame);
2673 // Since runJavaScriptAlert() can spin a nested run loop we need to turn off the responsiveness timer.
2674 process()->responsivenessTimer()->stop();
2676 m_alertReply = reply;
2677 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
2678 m_uiClient.notifyPopupReplyWaitingState(this, true);
2680 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2681 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2683 if (!m_uiClient.runJavaScriptAlert(this, message, frame))
2684 replyJavaScriptAlert();
2687 void WebPageProxy::runJavaScriptConfirm(uint64_t frameID, const String& message, PassRefPtr<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply> reply)
2689 WebFrameProxy* frame = process()->webFrame(frameID);
2690 MESSAGE_CHECK(frame);
2692 // Since runJavaScriptConfirm() can spin a nested run loop we need to turn off the responsiveness timer.
2693 process()->responsivenessTimer()->stop();
2695 m_confirmReply = reply;
2696 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
2697 m_uiClient.notifyPopupReplyWaitingState(this, true);
2699 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2700 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2702 if (!m_uiClient.runJavaScriptConfirm(this, message, frame))
2703 replyJavaScriptConfirm(false);
2706 void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const String& message, const String& defaultValue, PassRefPtr<Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply> reply)
2708 WebFrameProxy* frame = process()->webFrame(frameID);
2709 MESSAGE_CHECK(frame);
2711 // Since runJavaScriptPrompt() can spin a nested run loop we need to turn off the responsiveness timer.
2712 process()->responsivenessTimer()->stop();
2714 m_promptReply = reply;
2715 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
2716 m_uiClient.notifyPopupReplyWaitingState(this, true);
2718 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2719 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2721 if (!m_uiClient.runJavaScriptPrompt(this, message, defaultValue, frame))
2722 replyJavaScriptPrompt(String());
2725 void WebPageProxy::runJavaScriptAlert(uint64_t frameID, const String& message)
2727 WebFrameProxy* frame = process()->webFrame(frameID);
2728 MESSAGE_CHECK(frame);
2730 // Since runJavaScriptAlert() can spin a nested run loop we need to turn off the responsiveness timer.
2731 process()->responsivenessTimer()->stop();
2733 m_uiClient.runJavaScriptAlert(this, message, frame);
2736 void WebPageProxy::runJavaScriptConfirm(uint64_t frameID, const String& message, bool& result)
2738 WebFrameProxy* frame = process()->webFrame(frameID);
2739 MESSAGE_CHECK(frame);
2741 // Since runJavaScriptConfirm() can spin a nested run loop we need to turn off the responsiveness timer.
2742 process()->responsivenessTimer()->stop();
2744 result = m_uiClient.runJavaScriptConfirm(this, message, frame);
2747 void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const String& message, const String& defaultValue, String& result)
2749 WebFrameProxy* frame = process()->webFrame(frameID);
2750 MESSAGE_CHECK(frame);
2752 // Since runJavaScriptPrompt() can spin a nested run loop we need to turn off the responsiveness timer.
2753 process()->responsivenessTimer()->stop();
2755 result = m_uiClient.runJavaScriptPrompt(this, message, defaultValue, frame);
2759 void WebPageProxy::shouldInterruptJavaScript(bool& result)
2761 // Since shouldInterruptJavaScript() can spin a nested run loop we need to turn off the responsiveness timer.
2762 process()->responsivenessTimer()->stop();
2764 result = m_uiClient.shouldInterruptJavaScript(this);
2767 void WebPageProxy::setStatusText(const String& text)
2769 m_uiClient.setStatusText(this, text);
2772 void WebPageProxy::mouseDidMoveOverElement(const WebHitTestResult::Data& hitTestResultData, uint32_t opaqueModifiers, CoreIPC::ArgumentDecoder* arguments)
2774 RefPtr<APIObject> userData;
2775 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
2776 if (!arguments->decode(messageDecoder))
2779 WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
2781 m_uiClient.mouseDidMoveOverElement(this, hitTestResultData, modifiers, userData.get());
2784 void WebPageProxy::unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& url, const String& pluginsPageURL)
2786 MESSAGE_CHECK_URL(url);
2787 MESSAGE_CHECK_URL(pluginsPageURL);
2789 WKPluginUnavailabilityReason pluginUnavailabilityReason = static_cast<WKPluginUnavailabilityReason>(opaquePluginUnavailabilityReason);
2790 m_uiClient.unavailablePluginButtonClicked(this, pluginUnavailabilityReason, mimeType, url, pluginsPageURL);
2793 void WebPageProxy::setToolbarsAreVisible(bool toolbarsAreVisible)
2795 m_uiClient.setToolbarsAreVisible(this, toolbarsAreVisible);
2798 void WebPageProxy::getToolbarsAreVisible(bool& toolbarsAreVisible)
2800 toolbarsAreVisible = m_uiClient.toolbarsAreVisible(this);
2803 void WebPageProxy::setMenuBarIsVisible(bool menuBarIsVisible)
2805 m_uiClient.setMenuBarIsVisible(this, menuBarIsVisible);
2808 void WebPageProxy::getMenuBarIsVisible(bool& menuBarIsVisible)
2810 menuBarIsVisible = m_uiClient.menuBarIsVisible(this);
2813 void WebPageProxy::setStatusBarIsVisible(bool statusBarIsVisible)
2815 m_uiClient.setStatusBarIsVisible(this, statusBarIsVisible);
2818 void WebPageProxy::getStatusBarIsVisible(bool& statusBarIsVisible)
2820 statusBarIsVisible = m_uiClient.statusBarIsVisible(this);
2823 void WebPageProxy::setIsResizable(bool isResizable)
2825 m_uiClient.setIsResizable(this, isResizable);
2828 void WebPageProxy::getIsResizable(bool& isResizable)
2830 isResizable = m_uiClient.isResizable(this);
2833 void WebPageProxy::setWindowFrame(const FloatRect& newWindowFrame)
2835 m_uiClient.setWindowFrame(this, m_pageClient->convertToDeviceSpace(newWindowFrame));
2838 void WebPageProxy::getWindowFrame(FloatRect& newWindowFrame)
2840 newWindowFrame = m_pageClient->convertToUserSpace(m_uiClient.windowFrame(this));
2843 void WebPageProxy::screenToWindow(const IntPoint& screenPoint, IntPoint& windowPoint)
2845 windowPoint = m_pageClient->screenToWindow(screenPoint);
2848 void WebPageProxy::windowToScreen(const IntRect& viewRect, IntRect& result)
2850 result = m_pageClient->windowToScreen(viewRect);
2853 #if ENABLE(TIZEN_SUPPORT_BEFORE_UNLOAD_CONFIRM_PANEL)
2854 void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, PassRefPtr<Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply> reply)
2856 WebFrameProxy* frame = process()->webFrame(frameID);
2857 MESSAGE_CHECK(frame);
2859 // Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer.
2860 process()->responsivenessTimer()->stop();
2862 m_beforeUnloadConfirmPanelReply = reply;
2863 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
2864 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
2866 if (!m_uiClient.runBeforeUnloadConfirmPanel(this, message, frame))
2867 replyBeforeUnloadConfirmPanel(false);
2870 void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose)
2872 WebFrameProxy* frame = process()->webFrame(frameID);
2873 MESSAGE_CHECK(frame);
2875 // Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer.
2876 process()->responsivenessTimer()->stop();
2878 shouldClose = m_uiClient.runBeforeUnloadConfirmPanel(this, message, frame);
2882 #if USE(TILED_BACKING_STORE)
2883 void WebPageProxy::pageDidRequestScroll(const IntPoint& point)
2885 m_pageClient->pageDidRequestScroll(point);
2889 void WebPageProxy::didChangeViewportProperties(const ViewportAttributes& attr)
2891 m_pageClient->didChangeViewportProperties(attr);
2894 void WebPageProxy::pageDidScroll()
2896 m_uiClient.pageDidScroll(this);
2897 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
2898 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
2902 void WebPageProxy::runOpenPanel(uint64_t frameID, const FileChooserSettings& settings)
2904 if (m_openPanelResultListener) {
2905 m_openPanelResultListener->invalidate();
2906 m_openPanelResultListener = 0;
2909 WebFrameProxy* frame = process()->webFrame(frameID);
2910 MESSAGE_CHECK(frame);
2912 RefPtr<WebOpenPanelParameters> parameters = WebOpenPanelParameters::create(settings);
2913 m_openPanelResultListener = WebOpenPanelResultListenerProxy::create(this);
2915 // Since runOpenPanel() can spin a nested run loop we need to turn off the responsiveness timer.
2916 process()->responsivenessTimer()->stop();
2918 if (!m_uiClient.runOpenPanel(this, frame, parameters.get(), m_openPanelResultListener.get()))
2919 didCancelForOpenPanel();
2922 void WebPageProxy::printFrame(uint64_t frameID)
2924 ASSERT(!m_isPerformingDOMPrintOperation);
2925 m_isPerformingDOMPrintOperation = true;
2927 WebFrameProxy* frame = process()->webFrame(frameID);
2928 MESSAGE_CHECK(frame);
2930 m_uiClient.printFrame(this, frame);
2932 endPrinting(); // Send a message synchronously while m_isPerformingDOMPrintOperation is still true.
2933 m_isPerformingDOMPrintOperation = false;
2936 void WebPageProxy::printMainFrame()
2938 printFrame(m_mainFrame->frameID());
2941 #if ENABLE(TIZEN_REGISTER_PROTOCOL_HANDLER)
2942 void WebPageProxy::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title)
2944 m_pageClient->registerProtocolHandler(scheme, baseURL, url, title);
2948 #if ENABLE(TIZEN_CUSTOM_SCHEME_HANDLER)
2949 void WebPageProxy::isProtocolHandlerRegistered(const String& scheme, const String& baseURL, const String& url, unsigned int& result)
2951 result = m_pageClient->isProtocolHandlerRegistered(scheme, baseURL, url);
2953 void WebPageProxy::unregisterProtocolHandler(const String& scheme, const String& baseURL, const String& url)
2955 m_pageClient->unregisterProtocolHandler(scheme, baseURL, url);
2959 #if ENABLE(TIZEN_REGISTER_CONTENT_HANDLER)
2960 void WebPageProxy::registerContentHandler(const String& mimeType, const String& baseURL, const String& url, const String& title)
2962 m_pageClient->registerContentHandler(mimeType, baseURL, url, title);
2965 void WebPageProxy::isContentHandlerRegistered(const String& mimeType, const String& baseURL, const String& url, unsigned int& result)
2967 result = m_pageClient->isContentHandlerRegistered(mimeType, baseURL, url);
2970 void WebPageProxy::unregisterContentHandler(const String& mimeType, const String& baseURL, const String& url)
2972 m_pageClient->unregisterContentHandler(mimeType, baseURL, url);
2976 #if ENABLE(TIZEN_SEARCH_PROVIDER)
2977 void WebPageProxy::addSearchProvider(const String& baseURL, const String& engineURL)
2979 m_pageClient->addSearchProvider(baseURL, engineURL);
2982 void WebPageProxy::isSearchProviderInstalled(const String& baseURL, const String& engineURL, uint64_t& result)
2984 result = m_pageClient->isSearchProviderInstalled(baseURL, engineURL);
2988 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
2989 void WebPageProxy::getStandaloneStatus(bool& standalone)
2991 standalone = m_pageClient->getStandaloneStatus();
2994 void WebPageProxy::getWebAppCapable(PassRefPtr<BooleanCallback> prpCallback)
2996 RefPtr<BooleanCallback> callback = prpCallback;
2998 callback->invalidate();
3002 uint64_t callbackID = callback->callbackID();
3003 m_booleanCallbacks.set(callbackID, callback.get());
3004 process()->send(Messages::WebPage::GetWebAppCapable(callbackID), m_pageID);
3007 void WebPageProxy::didGetWebAppCapable(const bool capable, uint64_t callbackID)
3009 RefPtr<BooleanCallback> callback = m_booleanCallbacks.take(callbackID);
3010 m_booleanCallbacks.remove(callbackID);
3011 callback->performCallbackWithReturnValue(WebBoolean::create(capable).leakRef());
3014 void WebPageProxy::getWebAppIconURL(PassRefPtr<StringCallback> prpCallback)
3016 RefPtr<StringCallback> callback = prpCallback;
3018 callback->invalidate();
3022 uint64_t callbackID = callback->callbackID();
3023 m_stringCallbacks.set(callbackID, callback.get());
3024 process()->send(Messages::WebPage::GetWebAppIconURL(callbackID), m_pageID);
3027 void WebPageProxy::didGetWebAppIconURL(const String& iconURL, uint64_t callbackID)
3029 RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackID);
3031 // FIXME: Log error or assert.
3032 // this can validly happen if a load invalidated the callback, though
3036 m_stringCallbacks.remove(callbackID);
3037 callback->performCallbackWithReturnValue(iconURL.impl());
3040 void WebPageProxy::getWebAppIconURLs(PassRefPtr<DictionaryCallback> prpCallback)
3042 RefPtr<DictionaryCallback> callback = prpCallback;
3044 callback->invalidate();
3048 uint64_t callbackID = callback->callbackID();
3049 m_dictionaryCallbacks.set(callbackID, callback.get());
3050 process()->send(Messages::WebPage::GetWebAppIconURLs(callbackID), m_pageID);
3053 void WebPageProxy::didGetWebAppIconURLs(const StringPairVector& iconURLs, uint64_t callbackID)
3055 RefPtr<DictionaryCallback> callback = m_dictionaryCallbacks.take(callbackID);
3056 ImmutableDictionary::MapType iconURLList;
3057 size_t iconURLCount = iconURLs.stringPairVector().size();
3058 for (size_t i = 0; i < iconURLCount; ++i)
3059 iconURLList.set(iconURLs.stringPairVector()[i].first, WebString::create(iconURLs.stringPairVector()[i].second));
3061 callback->performCallbackWithReturnValue(ImmutableDictionary::adopt(iconURLList).get());
3065 void WebPageProxy::setMediaVolume(float volume)
3067 if (volume == m_mediaVolume)
3070 m_mediaVolume = volume;
3075 process()->send(Messages::WebPage::SetMediaVolume(volume), m_pageID);
3079 void WebPageProxy::didChangeContentsSize(const IntSize& size)
3081 m_pageClient->didChangeContentsSize(size);
3084 void WebPageProxy::didFindZoomableArea(const IntPoint& target, const IntRect& area)
3086 m_pageClient->didFindZoomableArea(target, area);
3089 void WebPageProxy::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
3094 process()->send(Messages::WebPage::FindZoomableAreaForPoint(point, area), m_pageID);
3097 void WebPageProxy::didReceiveMessageFromNavigatorQtObject(const String& contents)
3099 m_pageClient->didReceiveMessageFromNavigatorQtObject(contents);
3102 void WebPageProxy::authenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password)
3104 m_pageClient->handleAuthenticationRequiredRequest(hostname, realm, prefilledUsername, username, password);
3107 void WebPageProxy::proxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password)
3109 m_pageClient->handleProxyAuthenticationRequiredRequest(hostname, port, prefilledUsername, username, password);
3112 void WebPageProxy::certificateVerificationRequest(const String& hostname, bool& ignoreErrors)
3114 m_pageClient->handleCertificateVerificationRequest(hostname, ignoreErrors);
3116 #endif // PLATFORM(QT).
3119 void WebPageProxy::didFindZoomableArea(const IntPoint& target, const IntRect& area)
3121 m_pageClient->didFindZoomableArea(target, area);
3124 void WebPageProxy::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
3129 process()->send(Messages::WebPage::FindZoomableAreaForPoint(point, area), m_pageID);
3131 #endif // #if OS(TIZEN)
3133 #if PLATFORM(QT) || PLATFORM(EFL)
3134 void WebPageProxy::handleDownloadRequest(DownloadProxy* download)
3136 m_pageClient->handleDownloadRequest(download);
3138 #endif // PLATFORM(QT) || PLATFORM(EFL)
3140 #if ENABLE(TOUCH_EVENTS)
3141 void WebPageProxy::needTouchEvents(bool needTouchEvents)
3143 m_needTouchEvents = needTouchEvents;
3144 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
3145 // We don't have to ask overflow if we need touch events,
3146 // because we will check overflow in the web process when touch event is processed.
3147 m_askOverflow = !m_needTouchEvents;
3152 #if ENABLE(INPUT_TYPE_COLOR)
3153 void WebPageProxy::showColorChooser(const WebCore::Color& initialColor)
3155 ASSERT(!m_colorChooser);
3157 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3158 if (m_colorPickerResultListener) {
3159 m_colorPickerResultListener->invalidate();
3160 m_colorPickerResultListener = nullptr;
3163 m_colorPickerResultListener = WebColorPickerResultListenerProxy::create(this);
3164 m_colorChooser = WebColorChooserProxy::create(this);
3166 if (m_uiClient.showColorPicker(this, initialColor.serialized(), m_colorPickerResultListener.get()))
3170 m_colorChooser = m_pageClient->createColorChooserProxy(this, initialColor);
3171 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3172 if (!m_colorChooser)
3173 didEndColorChooser();
3177 void WebPageProxy::setColorChooserColor(const WebCore::Color& color)
3179 ASSERT(m_colorChooser);
3181 m_colorChooser->setSelectedColor(color);
3184 void WebPageProxy::endColorChooser()
3186 ASSERT(m_colorChooser);
3188 m_colorChooser->endChooser();
3191 void WebPageProxy::didChooseColor(const WebCore::Color& color)
3196 process()->send(Messages::WebPage::DidChooseColor(color), m_pageID);
3199 void WebPageProxy::didEndColorChooser()
3204 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3205 if (m_colorChooser) {
3206 m_colorChooser->invalidate();
3207 m_colorChooser = nullptr;
3210 ASSERT(m_colorChooser);
3212 m_colorChooser->invalidate();
3213 m_colorChooser = nullptr;
3216 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
3217 m_process->send(Messages::WebPage::DidEndColorChooser(), m_pageID);
3219 m_colorPickerResultListener->invalidate();
3220 m_colorPickerResultListener = nullptr;
3222 m_uiClient.hideColorPicker(this);
3224 process()->send(Messages::WebPage::DidEndColorChooser(), m_pageID);
3229 void WebPageProxy::didDraw()
3231 m_uiClient.didDraw(this);
3236 #if ENABLE(INSPECTOR)
3238 WebInspectorProxy* WebPageProxy::inspector()
3240 if (isClosed() || !isValid())
3243 m_inspector = WebInspectorProxy::create(this);
3244 return m_inspector.get();
3249 #if ENABLE(FULLSCREEN_API)
3250 WebFullScreenManagerProxy* WebPageProxy::fullScreenManager()
3252 if (!m_fullScreenManager)
3253 m_fullScreenManager = WebFullScreenManagerProxy::create(this);
3254 return m_fullScreenManager.get();
3260 void WebPageProxy::backForwardAddItem(uint64_t itemID)
3262 m_backForwardList->addItem(process()->webBackForwardItem(itemID));
3265 void WebPageProxy::backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle& sandboxExtensionHandle)
3267 WebBackForwardListItem* item = process()->webBackForwardItem(itemID);
3271 bool createdExtension = maybeInitializeSandboxExtensionHandle(KURL(KURL(), item->url()), sandboxExtensionHandle);
3272 if (createdExtension)
3273 process()->willAcquireUniversalFileReadSandboxExtension();
3274 m_backForwardList->goToItem(item);
3277 void WebPageProxy::backForwardItemAtIndex(int32_t index, uint64_t& itemID)
3279 WebBackForwardListItem* item = m_backForwardList->itemAtIndex(index);
3280 itemID = item ? item->itemID() : 0;
3283 void WebPageProxy::backForwardBackListCount(int32_t& count)
3285 count = m_backForwardList->backListCount();
3288 void WebPageProxy::backForwardForwardListCount(int32_t& count)
3290 count = m_backForwardList->forwardListCount();
3293 void WebPageProxy::editorStateChanged(const EditorState& editorState)
3296 bool couldChangeSecureInputState = m_editorState.isInPasswordField != editorState.isInPasswordField || m_editorState.selectionIsNone;
3299 m_editorState = editorState;
3302 m_pageClient->updateTextInputState(couldChangeSecureInputState);
3303 #elif PLATFORM(QT) || PLATFORM(EFL)
3304 m_pageClient->updateTextInputState();
3310 void WebPageProxy::registerEditCommandForUndo(uint64_t commandID, uint32_t editAction)
3312 registerEditCommand(WebEditCommandProxy::create(commandID, static_cast<EditAction>(editAction), this), Undo);
3315 void WebPageProxy::canUndoRedo(uint32_t action, bool& result)
3317 result = m_pageClient->canUndoRedo(static_cast<UndoOrRedo>(action));
3320 void WebPageProxy::executeUndoRedo(uint32_t action, bool& result)
3322 m_pageClient->executeUndoRedo(static_cast<UndoOrRedo>(action));
3326 void WebPageProxy::clearAllEditCommands()
3328 m_pageClient->clearAllEditCommands();
3331 void WebPageProxy::didCountStringMatches(const String& string, uint32_t matchCount)
3333 m_findClient.didCountStringMatches(this, string, matchCount);
3336 void WebPageProxy::didGetImageForFindMatch(const ShareableBitmap::Handle& contentImageHandle, uint32_t matchIndex)
3338 m_findMatchesClient.didGetImageForMatchResult(this, WebImage::create(ShareableBitmap::create(contentImageHandle)).get(), matchIndex);
3341 void WebPageProxy::setFindIndicator(const FloatRect& selectionRectInWindowCoordinates, const Vector<FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut, bool animate)
3343 RefPtr<FindIndicator> findIndicator = FindIndicator::create(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, contentImageScaleFactor, contentImageHandle);
3344 m_pageClient->setFindIndicator(findIndicator.release(), fadeOut, animate);
3347 void WebPageProxy::didFindString(const String& string, uint32_t matchCount)
3349 m_findClient.didFindString(this, string, matchCount);
3352 void WebPageProxy::didFindStringMatches(const String& string, Vector<Vector<WebCore::IntRect> > matchRects, int32_t firstIndexAfterSelection)
3354 Vector<RefPtr<APIObject> > matches;
3355 matches.reserveInitialCapacity(matchRects.size());
3357 for (size_t i = 0; i < matchRects.size(); ++i) {
3358 const Vector<WebCore::IntRect>& rects = matchRects[i];
3359 size_t numRects = matchRects[i].size();
3360 Vector<RefPtr<APIObject> > apiRects;
3361 apiRects.reserveInitialCapacity(numRects);
3363 for (size_t i = 0; i < numRects; ++i)
3364 apiRects.uncheckedAppend(WebRect::create(toAPI(rects[i])));
3365 matches.uncheckedAppend(ImmutableArray::adopt(apiRects));
3367 m_findMatchesClient.didFindStringMatches(this, string, ImmutableArray::adopt(matches).get(), firstIndexAfterSelection);
3370 void WebPageProxy::didFailToFindString(const String& string)
3372 m_findClient.didFailToFindString(this, string);
3375 void WebPageProxy::valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex)
3377 process()->send(Messages::WebPage::DidChangeSelectedIndexForActivePopupMenu(newSelectedIndex), m_pageID);
3380 void WebPageProxy::setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index)
3382 process()->send(Messages::WebPage::SetTextForActivePopupMenu(index), m_pageID);
3385 NativeWebMouseEvent* WebPageProxy::currentlyProcessedMouseDownEvent()
3387 return m_currentlyProcessedMouseDownEvent.get();
3391 void WebPageProxy::failedToShowPopupMenu()
3393 process()->send(Messages::WebPage::FailedToShowPopupMenu(), m_pageID);
3397 void WebPageProxy::showPopupMenu(const IntRect& rect, uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex, const PlatformPopupMenuData& data)
3399 if (m_activePopupMenu) {
3400 m_activePopupMenu->hidePopupMenu();
3401 m_activePopupMenu->invalidate();
3402 m_activePopupMenu = 0;
3405 m_activePopupMenu = m_pageClient->createPopupMenuProxy(this);
3407 // Since showPopupMenu() can spin a nested run loop we need to turn off the responsiveness timer.
3408 process()->responsivenessTimer()->stop();
3410 RefPtr<WebPopupMenuProxy> protectedActivePopupMenu = m_activePopupMenu;
3412 protectedActivePopupMenu->showPopupMenu(rect, static_cast<TextDirection>(textDirection), m_pageScaleFactor, items, data, selectedIndex);
3414 // 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.
3415 #if !PLATFORM(QT) && !PLATFORM(EFL)
3416 protectedActivePopupMenu->invalidate();
3418 protectedActivePopupMenu = 0;
3421 void WebPageProxy::hidePopupMenu()
3423 if (!m_activePopupMenu)
3426 m_activePopupMenu->hidePopupMenu();
3427 m_activePopupMenu->invalidate();
3428 m_activePopupMenu = 0;
3431 #if ENABLE(TIZEN_WEBKIT2_POPUP_INTERNAL)
3432 void WebPageProxy::updatePopupMenu(uint64_t textDirection, const Vector<WebPopupItem>& items, int32_t selectedIndex)
3434 if (!m_activePopupMenu)
3437 m_activePopupMenu->updatePopupMenu(static_cast<TextDirection>(textDirection), items, selectedIndex);
3441 #if ENABLE(CONTEXT_MENUS)
3442 void WebPageProxy::showContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::ArgumentDecoder* arguments)
3444 internalShowContextMenu(menuLocation, hitTestResultData, proposedItems, arguments);
3446 // No matter the result of internalShowContextMenu, always notify the WebProcess that the menu is hidden so it starts handling mouse events again.
3447 process()->send(Messages::WebPage::ContextMenuHidden(), m_pageID);
3450 void WebPageProxy::internalShowContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::ArgumentDecoder* arguments)
3452 RefPtr<APIObject> userData;
3453 WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
3454 if (!arguments->decode(messageDecoder))
3457 m_activeContextMenuHitTestResultData = hitTestResultData;
3459 if (m_activeContextMenu) {
3460 m_activeContextMenu->hideContextMenu();
3461 m_activeContextMenu = 0;
3464 m_activeContextMenu = m_pageClient->createContextMenuProxy(this);
3466 // Since showContextMenu() can spin a nested run loop we need to turn off the responsiveness timer.
3467 process()->responsivenessTimer()->stop();
3469 // Give the PageContextMenuClient one last swipe at changing the menu.
3470 Vector<WebContextMenuItemData> items;
3471 if (!m_contextMenuClient.getContextMenuFromProposedMenu(this, proposedItems, items, hitTestResultData, userData.get()))
3472 m_activeContextMenu->showContextMenu(menuLocation, proposedItems);
3474 m_activeContextMenu->showContextMenu(menuLocation, items);
3476 m_contextMenuClient.contextMenuDismissed(this);
3479 void WebPageProxy::contextMenuItemSelected(const WebContextMenuItemData& item)
3481 TIZEN_LOGI("selected item : action(%d), title(%s)", item.action(), item.title().utf8().data());
3482 // Application custom items don't need to round-trip through to WebCore in the WebProcess.
3483 if (item.action() >= ContextMenuItemBaseApplicationTag) {
3484 m_contextMenuClient.customContextMenuItemSelected(this, item);
3485 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
3486 m_pageClient->setIsTextSelectionMode(false);
3492 if (item.action() == ContextMenuItemTagSmartCopyPaste) {
3493 setSmartInsertDeleteEnabled(!isSmartInsertDeleteEnabled());
3496 if (item.action() == ContextMenuItemTagSmartQuotes) {
3497 TextChecker::setAutomaticQuoteSubstitutionEnabled(!TextChecker::state().isAutomaticQuoteSubstitutionEnabled);
3498 process()->updateTextCheckerState();
3501 if (item.action() == ContextMenuItemTagSmartDashes) {
3502 TextChecker::setAutomaticDashSubstitutionEnabled(!TextChecker::state().isAutomaticDashSubstitutionEnabled);
3503 process()->updateTextCheckerState();
3506 if (item.action() == ContextMenuItemTagSmartLinks) {
3507 TextChecker::setAutomaticLinkDetectionEnabled(!TextChecker::state().isAutomaticLinkDetectionEnabled);
3508 process()->updateTextCheckerState();
3511 if (item.action() == ContextMenuItemTagTextReplacement) {
3512 TextChecker::setAutomaticTextReplacementEnabled(!TextChecker::state().isAutomaticTextReplacementEnabled);
3513 process()->updateTextCheckerState();
3516 if (item.action() == ContextMenuItemTagCorrectSpellingAutomatically) {
3517 TextChecker::setAutomaticSpellingCorrectionEnabled(!TextChecker::state().isAutomaticSpellingCorrectionEnabled);
3518 process()->updateTextCheckerState();
3521 if (item.action() == ContextMenuItemTagShowSubstitutions) {
3522 TextChecker::toggleSubstitutionsPanelIsShowing();
3526 if (item.action() == ContextMenuItemTagDownloadImageToDisk) {
3527 m_process->context()->download(this, KURL(KURL(), m_activeContextMenuHitTestResultData.absoluteImageURL));
3530 if (item.action() == ContextMenuItemTagDownloadLinkToDisk) {
3531 m_process->context()->download(this, KURL(KURL(), m_activeContextMenuHitTestResultData.absoluteLinkURL));
3534 if (item.action() == ContextMenuItemTagCheckSpellingWhileTyping) {
3535 TextChecker::setContinuousSpellCheckingEnabled(!TextChecker::state().isContinuousSpellCheckingEnabled);
3536 process()->updateTextCheckerState();
3539 if (item.action() == ContextMenuItemTagCheckGrammarWithSpelling) {
3540 TextChecker::setGrammarCheckingEnabled(!TextChecker::state().isGrammarCheckingEnabled);
3541 process()->updateTextCheckerState();
3544 if (item.action() == ContextMenuItemTagShowSpellingPanel) {
3545 if (!TextChecker::spellingUIIsShowing())
3546 advanceToNextMisspelling(true);
3547 TextChecker::toggleSpellingUIIsShowing();
3550 if (item.action() == ContextMenuItemTagLearnSpelling || item.action() == ContextMenuItemTagIgnoreSpelling)
3551 ++m_pendingLearnOrIgnoreWordMessageCount;
3553 #if ENABLE(TIZEN_WEBKIT2_CLIPBOARD_HELPER)
3554 if (item.action() == ContextMenuItemTagPaste) {
3555 pasteContextMenuSelected();
3560 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_TEXT_SELECTION_MODE)
3561 if (item.action() == ContextMenuItemTagTextSelectionMode) {
3562 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
3563 m_pageClient->setIsTextSelectionMode(true);
3566 evas_object_focus_set(viewWidget(), true);
3567 WebCore::IntPoint positionForSelection = m_activeContextMenu->positionForSelection();
3568 bool result = false;
3569 process()->sendSync(Messages::WebPage::SelectLink(positionForSelection), Messages::WebPage::SelectLink::Reply(result), m_pageID);
3570 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
3571 if (result == false)
3572 m_pageClient->setIsTextSelectionMode(false);
3579 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
3580 if (item.action() == ContextMenuItemTagClipboard) {
3581 clipboardContextMenuSelected();
3586 #if ENABLE(CONTEXT_MENUS)
3587 process()->send(Messages::WebPage::DidSelectItemFromActiveContextMenu(item), m_pageID);
3590 #endif // ENABLE(CONTEXT_MENUS)
3592 void WebPageProxy::didChooseFilesForOpenPanel(const Vector<String>& fileURLs)
3597 #if ENABLE(WEB_PROCESS_SANDBOX)
3598 // FIXME: The sandbox extensions should be sent with the DidChooseFilesForOpenPanel message. This
3599 // is gated on a way of passing SandboxExtension::Handles in a Vector.
3600 for (size_t i = 0; i < fileURLs.size(); ++i) {
3601 SandboxExtension::Handle sandboxExtensionHandle;
3602 SandboxExtension::createHandle(fileURLs[i], SandboxExtension::ReadOnly, sandboxExtensionHandle);
3603 process()->send(Messages::WebPage::ExtendSandboxForFileFromOpenPanel(sandboxExtensionHandle), m_pageID);
3607 process()->send(Messages::WebPage::DidChooseFilesForOpenPanel(fileURLs), m_pageID);
3609 m_openPanelResultListener->invalidate();
3610 m_openPanelResultListener = 0;
3613 void WebPageProxy::didCancelForOpenPanel()
3618 process()->send(Messages::WebPage::DidCancelForOpenPanel(), m_pageID);
3620 m_openPanelResultListener->invalidate();
3621 m_openPanelResultListener = 0;
3624 void WebPageProxy::advanceToNextMisspelling(bool startBeforeSelection) const
3626 process()->send(Messages::WebPage::AdvanceToNextMisspelling(startBeforeSelection), m_pageID);
3629 void WebPageProxy::changeSpellingToWord(const String& word) const
3634 process()->send(Messages::WebPage::ChangeSpellingToWord(word), m_pageID);
3637 void WebPageProxy::registerEditCommand(PassRefPtr<WebEditCommandProxy> commandProxy, UndoOrRedo undoOrRedo)
3639 m_pageClient->registerEditCommand(commandProxy, undoOrRedo);
3642 void WebPageProxy::addEditCommand(WebEditCommandProxy* command)
3644 m_editCommandSet.add(command);
3647 void WebPageProxy::removeEditCommand(WebEditCommandProxy* command)
3649 m_editCommandSet.remove(command);
3653 process()->send(Messages::WebPage::DidRemoveEditCommand(command->commandID()), m_pageID);
3656 bool WebPageProxy::isValidEditCommand(WebEditCommandProxy* command)
3658 return m_editCommandSet.find(command) != m_editCommandSet.end();
3661 int64_t WebPageProxy::spellDocumentTag()
3663 if (!m_hasSpellDocumentTag) {
3664 m_spellDocumentTag = TextChecker::uniqueSpellDocumentTag(this);
3665 m_hasSpellDocumentTag = true;
3668 return m_spellDocumentTag;
3671 #if USE(UNIFIED_TEXT_CHECKING)
3672 void WebPageProxy::checkTextOfParagraph(const String& text, uint64_t checkingTypes, Vector<TextCheckingResult>& results)
3674 results = TextChecker::checkTextOfParagraph(spellDocumentTag(), text.characters(), text.length(), checkingTypes);
3678 void WebPageProxy::checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength)
3680 TextChecker::checkSpellingOfString(spellDocumentTag(), text.characters(), text.length(), misspellingLocation, misspellingLength);
3683 void WebPageProxy::checkGrammarOfString(const String& text, Vector<GrammarDetail>& grammarDetails, int32_t& badGrammarLocation, int32_t& badGrammarLength)
3685 TextChecker::checkGrammarOfString(spellDocumentTag(), text.characters(), text.length(), grammarDetails, badGrammarLocation, badGrammarLength);
3688 void WebPageProxy::spellingUIIsShowing(bool& isShowing)
3690 isShowing = TextChecker::spellingUIIsShowing();
3693 void WebPageProxy::updateSpellingUIWithMisspelledWord(const String& misspelledWord)
3695 TextChecker::updateSpellingUIWithMisspelledWord(spellDocumentTag(), misspelledWord);
3698 void WebPageProxy::updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const GrammarDetail& grammarDetail)
3700 TextChecker::updateSpellingUIWithGrammarString(spellDocumentTag(), badGrammarPhrase, grammarDetail);
3703 void WebPageProxy::getGuessesForWord(const String& word, const String& context, Vector<String>& guesses)
3705 TextChecker::getGuessesForWord(spellDocumentTag(), word, context, guesses);
3708 void WebPageProxy::learnWord(const String& word)
3710 MESSAGE_CHECK(m_pendingLearnOrIgnoreWordMessageCount);
3711 --m_pendingLearnOrIgnoreWordMessageCount;
3713 TextChecker::learnWord(spellDocumentTag(), word);
3716 void WebPageProxy::ignoreWord(const String& word)
3718 MESSAGE_CHECK(m_pendingLearnOrIgnoreWordMessageCount);
3719 --m_pendingLearnOrIgnoreWordMessageCount;
3721 TextChecker::ignoreWord(spellDocumentTag(), word);
3726 void WebPageProxy::setFocus(bool focused)
3729 m_uiClient.focus(this);
3731 m_uiClient.unfocus(this);
3734 void WebPageProxy::takeFocus(uint32_t direction)
3736 m_uiClient.takeFocus(this, (static_cast<FocusDirection>(direction) == FocusDirectionForward) ? kWKFocusDirectionForward : kWKFocusDirectionBackward);
3739 void WebPageProxy::setToolTip(const String& toolTip)
3741 String oldToolTip = m_toolTip;
3742 m_toolTip = toolTip;
3743 m_pageClient->toolTipChanged(oldToolTip, m_toolTip);
3746 void WebPageProxy::setCursor(const WebCore::Cursor& cursor)
3748 m_pageClient->setCursor(cursor);
3751 void WebPageProxy::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
3753 m_pageClient->setCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves);
3756 void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
3758 WebEvent::Type type = static_cast<WebEvent::Type>(opaqueType);
3761 case WebEvent::NoType:
3762 case WebEvent::MouseMove:
3765 case WebEvent::MouseDown:
3766 case WebEvent::MouseUp:
3767 case WebEvent::Wheel:
3768 case WebEvent::KeyDown:
3769 case WebEvent::KeyUp:
3770 case WebEvent::RawKeyDown:
3771 case WebEvent::Char:
3772 #if ENABLE(GESTURE_EVENTS)
3773 case WebEvent::GestureScrollBegin:
3774 case WebEvent::GestureScrollEnd:
3775 case WebEvent::GestureSingleTap:
3777 #if ENABLE(TOUCH_EVENTS)
3778 case WebEvent::TouchStart:
3779 case WebEvent::TouchMove:
3780 case WebEvent::TouchEnd:
3781 case WebEvent::TouchCancel:
3783 process()->responsivenessTimer()->stop();
3788 case WebEvent::NoType:
3790 case WebEvent::MouseMove:
3791 m_processingMouseMoveEvent = false;
3792 if (m_nextMouseMoveEvent) {
3793 handleMouseEvent(*m_nextMouseMoveEvent);
3794 m_nextMouseMoveEvent = nullptr;
3797 case WebEvent::MouseDown:
3799 #if ENABLE(GESTURE_EVENTS)
3800 case WebEvent::GestureScrollBegin:
3801 case WebEvent::GestureScrollEnd:
3802 case WebEvent::GestureSingleTap: {
3803 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3804 QueuedUIEvents<WebGestureEvent> queuedEvents = m_gestureEventQueue.first();
3805 MESSAGE_CHECK(type == queuedEvents.forwardedEvent.type());
3806 m_gestureEventQueue.removeFirst();
3808 m_pageClient->doneWithGestureEvent(queuedEvents.forwardedEvent, handled);
3809 for (size_t i = 0; i < queuedEvents.deferredEvents.size(); ++i) {
3810 bool isEventHandled = false;
3811 m_pageClient->doneWithGestureEvent(queuedEvents.deferredEvents.at(i), isEventHandled);
3814 WebGestureEvent event = m_gestureEventQueue.first();
3815 MESSAGE_CHECK(type == event.type());
3817 m_gestureEventQueue.removeFirst();
3818 m_pageClient->doneWithGestureEvent(event, handled);
3820 #if ENABLE(TIZEN_ISF_PORT)
3821 if (m_isVisible && type == WebEvent::GestureSingleTap && m_editorState.isContentEditable) {
3822 #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
3823 if (m_editorState.inputMethodHints == "date"
3824 || m_editorState.inputMethodHints == "datetime"
3825 || m_editorState.inputMethodHints == "datetime-local"
3826 || m_editorState.inputMethodHints == "month"
3827 || m_editorState.inputMethodHints == "time"
3828 || m_editorState.inputMethodHints == "week") {
3829 InputMethodContextEfl* inputMethodContext = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->inputMethodContext();
3830 if (inputMethodContext->inputPickerType() == -1)
3834 evas_object_focus_set(viewWidget(), true);
3840 case WebEvent::MouseUp:
3841 m_currentlyProcessedMouseDownEvent = nullptr;
3844 case WebEvent::Wheel: {
3845 ASSERT(!m_currentlyProcessedWheelEvents.isEmpty());
3847 OwnPtr<Vector<NativeWebWheelEvent> > oldestCoalescedEvent = m_currentlyProcessedWheelEvents.takeFirst();
3849 // FIXME: Dispatch additional events to the didNotHandleWheelEvent client function.
3850 if (!handled && m_uiClient.implementsDidNotHandleWheelEvent())
3851 m_uiClient.didNotHandleWheelEvent(this, oldestCoalescedEvent->last());
3853 if (!m_wheelEventQueue.isEmpty())
3854 processNextQueuedWheelEvent();
3858 case WebEvent::KeyDown:
3859 case WebEvent::KeyUp:
3860 case WebEvent::RawKeyDown:
3861 case WebEvent::Char: {
3862 LOG(KeyHandling, "WebPageProxy::didReceiveEvent: %s", webKeyboardEventTypeString(type));
3864 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3865 QueuedUIEvents<NativeWebKeyboardEvent> queuedEvents = m_keyEventQueue.first();
3866 NativeWebKeyboardEvent event = queuedEvents.forwardedEvent;
3867 MESSAGE_CHECK(type == event.type());
3868 m_keyEventQueue.removeFirst();
3870 m_pageClient->doneWithKeyEvent(event, handled);
3871 for (size_t i = 0; i < queuedEvents.deferredEvents.size(); ++i) {
3872 bool isEventHandled = false;
3873 m_pageClient->doneWithKeyEvent(queuedEvents.deferredEvents.at(i), isEventHandled);
3876 NativeWebKeyboardEvent event = m_keyEventQueue.first();
3877 MESSAGE_CHECK(type == event.type());
3879 m_keyEventQueue.removeFirst();
3881 if (!m_keyEventQueue.isEmpty())
3882 process()->send(Messages::WebPage::KeyEvent(m_keyEventQueue.first()), m_pageID);
3884 m_pageClient->doneWithKeyEvent(event, handled);
3885 #endif // #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3890 #if ENABLE(TIZEN_ISF_PORT)
3891 InputMethodContextEfl* inputMethodContext = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->inputMethodContext();
3892 if (event.type() == WebEvent::KeyDown && event.keyIdentifier() == "Enter" && inputMethodContext && inputMethodContext->autoCapitalType() == ECORE_IMF_AUTOCAPITAL_TYPE_NONE)
3893 inputMethodContext->hideIMFContext();
3896 if (m_uiClient.implementsDidNotHandleKeyEvent())
3897 m_uiClient.didNotHandleKeyEvent(this, event);
3900 ::TranslateMessage(event.nativeEvent());
3904 #if ENABLE(TOUCH_EVENTS)
3905 case WebEvent::TouchStart:
3906 case WebEvent::TouchMove:
3907 case WebEvent::TouchEnd:
3908 case WebEvent::TouchCancel: {
3909 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
3910 QueuedUIEvents<NativeWebTouchEvent> queuedEvents = m_touchEventQueue.first();
3911 MESSAGE_CHECK(type == queuedEvents.forwardedEvent.type());
3912 m_touchEventQueue.removeFirst();
3914 m_pageClient->doneWithTouchEvent(queuedEvents.forwardedEvent, handled);
3915 for (size_t i = 0; i < queuedEvents.deferredEvents.size(); ++i) {
3916 bool isEventHandled = false;
3917 m_pageClient->doneWithTouchEvent(queuedEvents.deferredEvents.at(i), isEventHandled);
3920 QueuedTouchEvents queuedEvents = m_touchEventQueue.first();
3921 MESSAGE_CHECK(type == queuedEvents.forwardedEvent.type());
3922 m_touchEventQueue.removeFirst();
3924 m_pageClient->doneWithTouchEvent(queuedEvents.forwardedEvent, handled);
3925 for (size_t i = 0; i < queuedEvents.deferredTouchEvents.size(); ++i) {
3926 bool isEventHandled = false;
3927 m_pageClient->doneWithTouchEvent(queuedEvents.deferredTouchEvents.at(i), isEventHandled);
3936 void WebPageProxy::stopResponsivenessTimer()
3938 process()->responsivenessTimer()->stop();
3941 void WebPageProxy::voidCallback(uint64_t callbackID)
3943 RefPtr<VoidCallback> callback = m_voidCallbacks.take(callbackID);
3945 // FIXME: Log error or assert.
3949 callback->performCallback();
3952 void WebPageProxy::dataCallback(const CoreIPC::DataReference& dataReference, uint64_t callbackID)
3954 RefPtr<DataCallback> callback = m_dataCallbacks.take(callbackID);
3956 // FIXME: Log error or assert.
3960 callback->performCallbackWithReturnValue(WebData::create(dataReference.data(), dataReference.size()).get());
3963 void WebPageProxy::stringCallback(const String& resultString, uint64_t callbackID)
3965 RefPtr<StringCallback> callback = m_stringCallbacks.take(callbackID);
3967 // FIXME: Log error or assert.
3968 // this can validly happen if a load invalidated the callback, though
3972 m_loadDependentStringCallbackIDs.remove(callbackID);
3974 callback->performCallbackWithReturnValue(resultString.impl());
3977 void WebPageProxy::scriptValueCallback(const CoreIPC::DataReference& dataReference, uint64_t callbackID)
3979 RefPtr<ScriptValueCallback> callback = m_scriptValueCallbacks.take(callbackID);
3981 // FIXME: Log error or assert.
3985 Vector<uint8_t> data;
3986 data.reserveInitialCapacity(dataReference.size());
3987 data.append(dataReference.data(), dataReference.size());
3989 callback->performCallbackWithReturnValue(data.size() ? WebSerializedScriptValue::adopt(data).get() : 0);
3992 void WebPageProxy::computedPagesCallback(const Vector<IntRect>& pageRects, double totalScaleFactorForPrinting, uint64_t callbackID)
3994 RefPtr<ComputedPagesCallback> callback = m_computedPagesCallbacks.take(callbackID);
3996 // FIXME: Log error or assert.
4000 callback->performCallbackWithReturnValue(pageRects, totalScaleFactorForPrinting);
4003 void WebPageProxy::validateCommandCallback(const String& commandName, bool isEnabled, int state, uint64_t callbackID)
4005 RefPtr<ValidateCommandCallback> callback = m_validateCommandCallbacks.take(callbackID);
4007 // FIXME: Log error or assert.
4011 callback->performCallbackWithReturnValue(commandName.impl(), isEnabled, state);
4015 void WebPageProxy::printFinishedCallback(const ResourceError& printError, uint64_t callbackID)
4017 RefPtr<PrintFinishedCallback> callback = m_printFinishedCallbacks.take(callbackID);
4019 // FIXME: Log error or assert.
4023 RefPtr<WebError> error = WebError::create(printError);
4024 callback->performCallbackWithReturnValue(error.get());
4028 void WebPageProxy::focusedFrameChanged(uint64_t frameID)
4035 WebFrameProxy* frame = process()->webFrame(frameID);
4036 MESSAGE_CHECK(frame);
4038 m_focusedFrame = frame;
4041 void WebPageProxy::frameSetLargestFrameChanged(uint64_t frameID)
4044 m_frameSetLargestFrame = 0;
4048 WebFrameProxy* frame = process()->webFrame(frameID);
4049 MESSAGE_CHECK(frame);
4051 m_frameSetLargestFrame = frame;
4054 void WebPageProxy::processDidBecomeUnresponsive()
4059 updateBackingStoreDiscardableState();
4061 m_loaderClient.processDidBecomeUnresponsive(this);
4064 void WebPageProxy::interactionOccurredWhileProcessUnresponsive()
4069 m_loaderClient.interactionOccurredWhileProcessUnresponsive(this);
4072 void WebPageProxy::processDidBecomeResponsive()
4077 updateBackingStoreDiscardableState();
4079 m_loaderClient.processDidBecomeResponsive(this);
4082 void WebPageProxy::processDidCrash()
4084 ASSERT(m_pageClient);
4087 m_isPageSuspended = false;
4090 m_urlAtProcessExit = m_mainFrame->url();
4091 m_loadStateAtProcessExit = m_mainFrame->loadState();
4094 m_mainFrame = nullptr;
4095 m_drawingArea = nullptr;
4097 #if ENABLE(INSPECTOR)
4099 m_inspector->invalidate();
4100 m_inspector = nullptr;
4104 #if ENABLE(FULLSCREEN_API)
4105 if (m_fullScreenManager) {
4106 m_fullScreenManager->invalidate();
4107 m_fullScreenManager = nullptr;
4111 if (m_openPanelResultListener) {
4112 m_openPanelResultListener->invalidate();
4113 m_openPanelResultListener = nullptr;
4116 #if ENABLE(INPUT_TYPE_COLOR)
4117 if (m_colorChooser) {
4118 m_colorChooser->invalidate();
4119 m_colorChooser = nullptr;
4122 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
4123 if (m_colorPickerResultListener) {
4124 m_colorPickerResultListener->invalidate();
4125 m_colorPickerResultListener = nullptr;
4130 #if ENABLE(GEOLOCATION)
4131 m_geolocationPermissionRequestManager.invalidateRequests();
4134 m_notificationPermissionRequestManager.invalidateRequests();
4136 m_toolTip = String();
4138 m_mainFrameHasHorizontalScrollbar = false;
4139 m_mainFrameHasVerticalScrollbar = false;
4141 m_mainFrameIsPinnedToLeftSide = false;
4142 m_mainFrameIsPinnedToRightSide = false;
4144 m_visibleScrollerThumbRect = IntRect();
4146 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
4147 invalidateCallbackMap(m_booleanCallbacks);
4148 invalidateCallbackMap(m_dictionaryCallbacks);
4150 invalidateCallbackMap(m_voidCallbacks);
4151 invalidateCallbackMap(m_dataCallbacks);
4152 invalidateCallbackMap(m_stringCallbacks);
4153 m_loadDependentStringCallbackIDs.clear();
4154 invalidateCallbackMap(m_scriptValueCallbacks);
4155 invalidateCallbackMap(m_computedPagesCallbacks);
4156 invalidateCallbackMap(m_validateCommandCallbacks);
4158 invalidateCallbackMap(m_printFinishedCallbacks);
4161 Vector<WebEditCommandProxy*> editCommandVector;
4162 copyToVector(m_editCommandSet, editCommandVector);
4163 m_editCommandSet.clear();
4164 for (size_t i = 0, size = editCommandVector.size(); i < size; ++i)
4165 editCommandVector[i]->invalidate();
4166 m_pageClient->clearAllEditCommands();
4168 m_activePopupMenu = 0;
4170 m_estimatedProgress = 0.0;
4172 m_pendingLearnOrIgnoreWordMessageCount = 0;
4174 m_pageClient->processDidCrash();
4175 m_loaderClient.processDidCrash(this);
4178 // If the call out to the loader client didn't cause the web process to be relaunched,
4179 // we'll call setNeedsDisplay on the view so that we won't have the old contents showing.
4180 // If the call did cause the web process to be relaunched, we'll keep the old page contents showing
4181 // until the new web process has painted its contents.
4182 setViewNeedsDisplay(IntRect(IntPoint(), viewSize()));
4185 // Can't expect DidReceiveEvent notifications from a crashed web process.
4186 m_keyEventQueue.clear();
4188 m_wheelEventQueue.clear();
4189 m_currentlyProcessedWheelEvents.clear();
4191 m_nextMouseMoveEvent = nullptr;
4192 m_currentlyProcessedMouseDownEvent = nullptr;
4194 m_processingMouseMoveEvent = false;
4196 #if ENABLE(TOUCH_EVENTS)
4197 m_needTouchEvents = false;
4198 m_touchEventQueue.clear();
4201 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4202 dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
4203 m_pageClient->dismissDictionaryLookupPanel();
4207 WebPageCreationParameters WebPageProxy::creationParameters() const
4209 WebPageCreationParameters parameters;
4211 parameters.viewSize = m_pageClient->viewSize();
4212 parameters.isActive = m_pageClient->isViewWindowActive();
4213 parameters.isFocused = m_pageClient->isViewFocused();
4214 parameters.isVisible = m_pageClient->isViewVisible();
4215 parameters.isInWindow = m_pageClient->isViewInWindow();
4216 parameters.drawingAreaType = m_drawingArea->type();
4217 parameters.store = m_pageGroup->preferences()->store();
4218 parameters.pageGroupData = m_pageGroup->data();
4219 parameters.drawsBackground = m_drawsBackground;
4220 parameters.drawsTransparentBackground = m_drawsTransparentBackground;
4221 parameters.areMemoryCacheClientCallsEnabled = m_areMemoryCacheClientCallsEnabled;
4222 parameters.useFixedLayout = m_useFixedLayout;
4223 parameters.fixedLayoutSize = m_fixedLayoutSize;
4224 parameters.paginationMode = m_paginationMode;
4225 parameters.paginationBehavesLikeColumns = m_paginationBehavesLikeColumns;
4226 parameters.pageLength = m_pageLength;
4227 parameters.gapBetweenPages = m_gapBetweenPages;
4228 parameters.userAgent = userAgent();
4229 parameters.sessionState = SessionState(m_backForwardList->entries(), m_backForwardList->currentIndex());
4230 parameters.highestUsedBackForwardItemID = WebBackForwardListItem::highedUsedItemID();
4231 parameters.canRunBeforeUnloadConfirmPanel = m_uiClient.canRunBeforeUnloadConfirmPanel();
4232 parameters.canRunModal = m_canRunModal;
4233 parameters.deviceScaleFactor = m_intrinsicDeviceScaleFactor;
4234 parameters.mediaVolume = m_mediaVolume;
4237 parameters.isSmartInsertDeleteEnabled = m_isSmartInsertDeleteEnabled;
4238 parameters.layerHostingMode = m_layerHostingMode;
4239 parameters.colorSpace = m_pageClient->colorSpace();
4243 parameters.nativeWindow = m_pageClient->nativeWindow();
4248 #if USE(ACCELERATED_COMPOSITING)
4249 void WebPageProxy::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
4251 m_pageClient->enterAcceleratedCompositingMode(layerTreeContext);
4254 void WebPageProxy::exitAcceleratedCompositingMode()
4256 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
4257 process()->platformSurfaceTexturePool()->removeAllPlatformSurfaceTextures();
4259 m_pageClient->exitAcceleratedCompositingMode();
4262 void WebPageProxy::updateAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
4264 m_pageClient->updateAcceleratedCompositingMode(layerTreeContext);
4266 #endif // USE(ACCELERATED_COMPOSITING)
4268 void WebPageProxy::backForwardClear()
4270 m_backForwardList->clear();
4273 void WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const ProtectionSpace& coreProtectionSpace, bool& canAuthenticate)
4275 WebFrameProxy* frame = process()->webFrame(frameID);
4276 MESSAGE_CHECK(frame);
4278 RefPtr<WebProtectionSpace> protectionSpace = WebProtectionSpace::create(coreProtectionSpace);
4280 canAuthenticate = m_loaderClient.canAuthenticateAgainstProtectionSpaceInFrame(this, frame, protectionSpace.get());
4283 #if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
4284 void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const AuthenticationChallenge& coreChallenge, uint64_t challengeID, PassRefPtr<Messages::WebPageProxy::DidReceiveAuthenticationChallenge::DelayedReply> reply)
4286 void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const AuthenticationChallenge& coreChallenge, uint64_t challengeID)
4289 WebFrameProxy* frame = process()->webFrame(frameID);
4290 MESSAGE_CHECK(frame);
4292 #if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
4293 RefPtr<AuthenticationChallengeProxy> authenticationChallenge = frame->setUpAuthenticationChallengeProxy(coreChallenge, challengeID, process());
4294 m_AuthReply = reply;
4296 if (!m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get()))
4297 replyReceiveAuthenticationChallengeInFrame(true);
4299 RefPtr<AuthenticationChallengeProxy> authenticationChallenge = AuthenticationChallengeProxy::create(coreChallenge, challengeID, process());
4301 m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get());
4305 #if ENABLE(TIZEN_SQL_DATABASE)
4306 void WebPageProxy::exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& displayName, uint64_t expectedUsage, PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply> allowExceed)
4308 WebFrameProxy* frame = process()->webFrame(frameID);
4309 MESSAGE_CHECK(frame);
4311 // Since exceededDatabaseQuota() can spin a nested run loop we need to turn off the responsiveness timer.
4312 process()->responsivenessTimer()->stop();
4314 m_exceededDatabaseQuotaReply = allowExceed;
4315 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
4316 #if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
4317 process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
4320 if (!m_uiClient.exceededDatabaseQuota(this, frame, origin.get(), displayName, expectedUsage))
4321 replyExceededDatabaseQuota(true);
4324 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)
4326 WebFrameProxy* frame = process()->webFrame(frameID);
4327 MESSAGE_CHECK(frame);
4329 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
4331 newQuota = m_uiClient.exceededDatabaseQuota(this, frame, origin.get(), databaseName, displayName, currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage);
4335 void WebPageProxy::requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier)
4337 WebFrameProxy* frame = process()->webFrame(frameID);
4338 MESSAGE_CHECK(frame);
4340 // FIXME: Geolocation should probably be using toString() as its string representation instead of databaseIdentifier().
4341 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
4342 RefPtr<GeolocationPermissionRequestProxy> request = m_geolocationPermissionRequestManager.createRequest(geolocationID);
4344 if (!m_uiClient.decidePolicyForGeolocationPermissionRequest(this, frame, origin.get(), request.get()))
4348 void WebPageProxy::requestNotificationPermission(uint64_t requestID, const String& originString)
4350 if (!isRequestIDValid(requestID))
4353 RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::createFromString(originString);
4354 RefPtr<NotificationPermissionRequest> request = m_notificationPermissionRequestManager.createRequest(requestID);
4356 if (!m_uiClient.decidePolicyForNotificationPermissionRequest(this, origin.get(), request.get()))
4360 void WebPageProxy::showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& originString, uint64_t notificationID)
4362 m_process->context()->notificationManagerProxy()->show(this, title, body, iconURL, tag, originString, notificationID);
4365 #if ENABLE(TIZEN_MEDIA_STREAM)
4366 void WebPageProxy::requestUserMediaPermission(uint64_t requestID)
4368 RefPtr<UserMediaPermissionRequest> request = m_userMediaPermissionRequestManager.createRequest(requestID);
4370 if (!m_tizenClient.decidePolicyForUserMediaPermissionRequest(this, request.get()))
4375 float WebPageProxy::headerHeight(WebFrameProxy* frame)
4377 if (frame->isDisplayingPDFDocument())
4379 return m_uiClient.headerHeight(this, frame);
4382 float WebPageProxy::footerHeight(WebFrameProxy* frame)
4384 if (frame->isDisplayingPDFDocument())
4386 return m_uiClient.footerHeight(this, frame);
4389 void WebPageProxy::drawHeader(WebFrameProxy* frame, const FloatRect& rect)
4391 if (frame->isDisplayingPDFDocument())
4393 m_uiClient.drawHeader(this, frame, rect);
4396 void WebPageProxy::drawFooter(WebFrameProxy* frame, const FloatRect& rect)
4398 if (frame->isDisplayingPDFDocument())
4400 m_uiClient.drawFooter(this, frame, rect);
4403 void WebPageProxy::runModal()
4405 // Since runModal() can (and probably will) spin a nested run loop we need to turn off the responsiveness timer.
4406 process()->responsivenessTimer()->stop();
4408 // Our Connection's run loop might have more messages waiting to be handled after this RunModal message.
4409 // To make sure they are handled inside of the the nested modal run loop we must first signal the Connection's
4410 // run loop so we're guaranteed that it has a chance to wake up.
4411 // See http://webkit.org/b/89590 for more discussion.
4412 process()->connection()->wakeUpRunLoop();
4414 m_uiClient.runModal(this);
4417 void WebPageProxy::notifyScrollerThumbIsVisibleInRect(const IntRect& scrollerThumb)
4419 m_visibleScrollerThumbRect = scrollerThumb;
4422 void WebPageProxy::recommendedScrollbarStyleDidChange(int32_t newStyle)
4425 m_pageClient->recommendedScrollbarStyleDidChange(newStyle);
4429 void WebPageProxy::didChangeScrollbarsForMainFrame(bool hasHorizontalScrollbar, bool hasVerticalScrollbar)
4431 m_mainFrameHasHorizontalScrollbar = hasHorizontalScrollbar;
4432 m_mainFrameHasVerticalScrollbar = hasVerticalScrollbar;
4434 m_pageClient->didChangeScrollbarsForMainFrame();
4437 void WebPageProxy::didChangeScrollOffsetPinningForMainFrame(bool pinnedToLeftSide, bool pinnedToRightSide)
4439 m_mainFrameIsPinnedToLeftSide = pinnedToLeftSide;
4440 m_mainFrameIsPinnedToRightSide = pinnedToRightSide;
4443 void WebPageProxy::didChangePageCount(unsigned pageCount)
4445 m_pageCount = pageCount;
4448 void WebPageProxy::didFailToInitializePlugin(const String& mimeType)
4450 m_loaderClient.didFailToInitializePlugin(this, mimeType);
4453 void WebPageProxy::didBlockInsecurePluginVersion(const String& mimeType, const String& urlString)
4455 String pluginIdentifier;
4456 String pluginVersion;
4457 String newMimeType = mimeType;
4460 PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL(KURL(), urlString));
4462 pluginIdentifier = plugin.bundleIdentifier;
4463 pluginVersion = plugin.versionString;
4466 m_loaderClient.didBlockInsecurePluginVersion(this, newMimeType, pluginIdentifier, pluginVersion);
4469 bool WebPageProxy::willHandleHorizontalScrollEvents() const
4471 return !m_canShortCircuitHorizontalWheelEvents;
4474 void WebPageProxy::didFinishLoadingDataForCustomRepresentation(const String& suggestedFilename, const CoreIPC::DataReference& dataReference)
4476 m_pageClient->didFinishLoadingDataForCustomRepresentation(suggestedFilename, dataReference);
4479 void WebPageProxy::backForwardRemovedItem(uint64_t itemID)
4481 process()->send(Messages::WebPage::DidRemoveBackForwardItem(itemID), m_pageID);
4484 void WebPageProxy::setCanRunModal(bool canRunModal)
4489 // It's only possible to change the state for a WebPage which
4490 // already qualifies for running modal child web pages, otherwise
4491 // there's no other possibility than not allowing it.
4492 m_canRunModal = m_uiClient.canRunModal() && canRunModal;
4493 process()->send(Messages::WebPage::SetCanRunModal(m_canRunModal), m_pageID);
4496 bool WebPageProxy::canRunModal()
4498 return isValid() ? m_canRunModal : false;
4501 void WebPageProxy::beginPrinting(WebFrameProxy* frame, const PrintInfo& printInfo)
4503 if (m_isInPrintingMode)
4506 m_isInPrintingMode = true;
4507 process()->send(Messages::WebPage::BeginPrinting(frame->frameID(), printInfo), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4510 void WebPageProxy::endPrinting()
4512 if (!m_isInPrintingMode)
4515 m_isInPrintingMode = false;
4516 process()->send(Messages::WebPage::EndPrinting(), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4519 void WebPageProxy::computePagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<ComputedPagesCallback> prpCallback)
4521 RefPtr<ComputedPagesCallback> callback = prpCallback;
4523 callback->invalidate();
4527 uint64_t callbackID = callback->callbackID();
4528 m_computedPagesCallbacks.set(callbackID, callback.get());
4529 m_isInPrintingMode = true;
4530 process()->send(Messages::WebPage::ComputePagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4533 #if PLATFORM(MAC) || PLATFORM(WIN)
4534 void WebPageProxy::drawRectToPDF(WebFrameProxy* frame, const PrintInfo& printInfo, const IntRect& rect, PassRefPtr<DataCallback> prpCallback)
4536 RefPtr<DataCallback> callback = prpCallback;
4538 callback->invalidate();
4542 uint64_t callbackID = callback->callbackID();
4543 m_dataCallbacks.set(callbackID, callback.get());
4544 process()->send(Messages::WebPage::DrawRectToPDF(frame->frameID(), printInfo, rect, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4547 void WebPageProxy::drawPagesToPDF(WebFrameProxy* frame, const PrintInfo& printInfo, uint32_t first, uint32_t count, PassRefPtr<DataCallback> prpCallback)
4549 RefPtr<DataCallback> callback = prpCallback;
4551 callback->invalidate();
4555 uint64_t callbackID = callback->callbackID();
4556 m_dataCallbacks.set(callbackID, callback.get());
4557 process()->send(Messages::WebPage::DrawPagesToPDF(frame->frameID(), printInfo, first, count, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4560 void WebPageProxy::drawPagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<PrintFinishedCallback> didPrintCallback)
4562 RefPtr<PrintFinishedCallback> callback = didPrintCallback;
4564 callback->invalidate();
4568 uint64_t callbackID = callback->callbackID();
4569 m_printFinishedCallbacks.set(callbackID, callback.get());
4570 m_isInPrintingMode = true;
4571 process()->send(Messages::WebPage::DrawPagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
4575 void WebPageProxy::flashBackingStoreUpdates(const Vector<IntRect>& updateRects)
4577 m_pageClient->flashBackingStoreUpdates(updateRects);
4580 void WebPageProxy::updateBackingStoreDiscardableState()
4586 if (!process()->responsivenessTimer()->isResponsive())
4587 isDiscardable = false;
4589 isDiscardable = !m_pageClient->isViewWindowActive() || !isViewVisible();
4591 m_drawingArea->setBackingStoreIsDiscardable(isDiscardable);
4594 Color WebPageProxy::viewUpdatesFlashColor()
4596 return Color(0, 200, 255);
4599 Color WebPageProxy::backingStoreUpdatesFlashColor()
4601 return Color(200, 0, 255);
4604 void WebPageProxy::saveDataToFileInDownloadsFolder(const String& suggestedFilename, const String& mimeType, const String& originatingURLString, WebData* data)
4606 m_uiClient.saveDataToFileInDownloadsFolder(this, suggestedFilename, mimeType, originatingURLString, data);
4609 void WebPageProxy::linkClicked(const String& url, const WebMouseEvent& event)
4611 process()->send(Messages::WebPage::LinkClicked(url, event), m_pageID, 0);
4616 void WebPageProxy::substitutionsPanelIsShowing(bool& isShowing)
4618 isShowing = TextChecker::substitutionsPanelIsShowing();
4621 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4622 void WebPageProxy::showCorrectionPanel(int32_t panelType, const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings)
4624 m_pageClient->showCorrectionPanel((AlternativeTextType)panelType, boundingBoxOfReplacedString, replacedString, replacementString, alternativeReplacementStrings);
4627 void WebPageProxy::dismissCorrectionPanel(int32_t reason)
4629 m_pageClient->dismissCorrectionPanel((ReasonForDismissingAlternativeText)reason);
4632 void WebPageProxy::dismissCorrectionPanelSoon(int32_t reason, String& result)
4634 result = m_pageClient->dismissCorrectionPanelSoon((ReasonForDismissingAlternativeText)reason);
4637 void WebPageProxy::recordAutocorrectionResponse(int32_t responseType, const String& replacedString, const String& replacementString)
4639 m_pageClient->recordAutocorrectionResponse((AutocorrectionResponseType)responseType, replacedString, replacementString);
4641 #endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4643 void WebPageProxy::handleAlternativeTextUIResult(const String& result)
4645 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
4647 process()->send(Messages::WebPage::HandleAlternativeTextUIResult(result), m_pageID, 0);
4651 #if USE(DICTATION_ALTERNATIVES)
4652 void WebPageProxy::showDictationAlternativeUI(const WebCore::FloatRect& boundingBoxOfDictatedText, uint64_t dictationContext)
4654 m_pageClient->showDictationAlternativeUI(boundingBoxOfDictatedText, dictationContext);
4657 void WebPageProxy::dismissDictationAlternativeUI()
4659 m_pageClient->dismissDictationAlternativeUI();
4662 void WebPageProxy::removeDictationAlternatives(uint64_t dictationContext)
4664 m_pageClient->removeDictationAlternatives(dictationContext);
4667 void WebPageProxy::dictationAlternatives(uint64_t dictationContext, Vector<String>& result)
4669 result = m_pageClient->dictationAlternatives(dictationContext);
4673 #endif // PLATFORM(MAC)
4676 void WebPageProxy::didReceiveURIRequest(String uriString, uint64_t requestID)
4678 m_process->context()->soupRequestManagerProxy()->didReceiveURIRequest(uriString, this, requestID);
4682 #if ENABLE(TIZEN_PAGE_VISIBILITY_API)
4683 void WebPageProxy::setPageVisibility(WebCore::PageVisibilityState pageVisibilityState, bool isInitialState)
4685 process()->send(Messages::WebPage::SetVisibilityState(static_cast<uint32_t>(pageVisibilityState), isInitialState), m_pageID);
4689 #if ENABLE(TIZEN_CERTIFICATE_HANDLING)
4690 void WebPageProxy::decidePolicyForCertificateError(const String& url, const String& certificate, int error, PassRefPtr<Messages::WebPageProxy::DecidePolicyForCertificateError::DelayedReply> reply)
4692 m_allowedReply = reply;
4694 if (!m_tizenClient.decidePolicyForCertificateError(this, url, certificate, error))
4695 replyPolicyForCertificateError(true);
4699 #if ENABLE(TIZEN_NATIVE_MEMORY_SNAPSHOT)
4700 void WebPageProxy::dumpMemorySnapshot()
4702 process()->send(Messages::WebPage::DumpMemorySnapshot(), m_pageID);
4706 } // namespace WebKit