2 * Copyright (C) 2010-2017 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
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 "WebChromeClient.h"
31 #include "APISecurityOrigin.h"
32 #include "DrawingArea.h"
33 #include "FindController.h"
34 #include "FrameInfoData.h"
35 #include "HangDetectionDisabler.h"
36 #include "InjectedBundleNavigationAction.h"
37 #include "InjectedBundleNodeHandle.h"
38 #include "NavigationActionData.h"
39 #include "PageBanner.h"
41 #include "WebColorChooser.h"
42 #include "WebCoreArgumentCoders.h"
43 #include "WebDataListSuggestionPicker.h"
45 #include "WebFrameLoaderClient.h"
46 #include "WebFullScreenManager.h"
47 #include "WebHitTestResultData.h"
49 #include "WebOpenPanelResultListener.h"
51 #include "WebPageCreationParameters.h"
52 #include "WebPageProxyMessages.h"
53 #include "WebPopupMenu.h"
54 #include "WebProcess.h"
55 #include "WebProcessPoolMessages.h"
56 #include "WebProcessProxyMessages.h"
57 #include "WebSearchPopupMenu.h"
58 #include <WebCore/ApplicationCacheStorage.h>
59 #include <WebCore/AXObjectCache.h>
60 #include <WebCore/ColorChooser.h>
61 #include <WebCore/DataListSuggestionPicker.h>
62 #include <WebCore/DatabaseTracker.h>
63 #include <WebCore/DocumentLoader.h>
64 #include <WebCore/FileChooser.h>
65 #include <WebCore/FileIconLoader.h>
66 #include <WebCore/Frame.h>
67 #include <WebCore/FrameLoadRequest.h>
68 #include <WebCore/FrameLoader.h>
69 #include <WebCore/FrameView.h>
70 #include <WebCore/HTMLInputElement.h>
71 #include <WebCore/HTMLNames.h>
72 #include <WebCore/HTMLParserIdioms.h>
73 #include <WebCore/HTMLPlugInImageElement.h>
74 #include <WebCore/Icon.h>
75 #include <WebCore/NotImplemented.h>
76 #include <WebCore/Page.h>
77 #include <WebCore/ScriptController.h>
78 #include <WebCore/SecurityOrigin.h>
79 #include <WebCore/SecurityOriginData.h>
80 #include <WebCore/Settings.h>
82 #if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
83 #include "PlaybackSessionManager.h"
84 #include "VideoFullscreenManager.h"
87 #if ENABLE(ASYNC_SCROLLING)
88 #include "RemoteScrollingCoordinator.h"
92 #include "PrinterListGtk.h"
96 using namespace WebCore;
97 using namespace HTMLNames;
99 static double area(WebFrame* frame)
101 IntSize size = frame->visibleContentBoundsExcludingScrollbars().size();
102 return static_cast<double>(size.height()) * size.width();
105 static WebFrame* findLargestFrameInFrameSet(WebPage& page)
107 // Approximate what a user could consider a default target frame for application menu operations.
109 WebFrame* mainFrame = page.mainWebFrame();
110 if (!mainFrame || !mainFrame->isFrameSet())
113 WebFrame* largestSoFar = nullptr;
115 Ref<API::Array> frameChildren = mainFrame->childFrames();
116 size_t count = frameChildren->size();
117 for (size_t i = 0; i < count; ++i) {
118 auto* childFrame = frameChildren->at<WebFrame>(i);
119 if (!largestSoFar || area(childFrame) > area(largestSoFar))
120 largestSoFar = childFrame;
126 WebChromeClient::WebChromeClient(WebPage& page)
131 void WebChromeClient::didInsertMenuElement(HTMLMenuElement& element)
133 m_page.didInsertMenuElement(element);
136 void WebChromeClient::didRemoveMenuElement(HTMLMenuElement& element)
138 m_page.didRemoveMenuElement(element);
141 void WebChromeClient::didInsertMenuItemElement(HTMLMenuItemElement& element)
143 m_page.didInsertMenuItemElement(element);
146 void WebChromeClient::didRemoveMenuItemElement(HTMLMenuItemElement& element)
148 m_page.didRemoveMenuItemElement(element);
151 inline WebChromeClient::~WebChromeClient()
155 void WebChromeClient::chromeDestroyed()
160 void WebChromeClient::setWindowRect(const FloatRect& windowFrame)
162 m_page.sendSetWindowFrame(windowFrame);
165 FloatRect WebChromeClient::windowRect()
167 #if PLATFORM(IOS_FAMILY)
171 if (m_page.hasCachedWindowFrame())
172 return m_page.windowFrameInUnflippedScreenCoordinates();
175 FloatRect newWindowFrame;
177 if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetWindowFrame(), Messages::WebPageProxy::GetWindowFrame::Reply(newWindowFrame), m_page.pageID()))
180 return newWindowFrame;
184 FloatRect WebChromeClient::pageRect()
186 return FloatRect(FloatPoint(), m_page.size());
189 void WebChromeClient::focus()
191 m_page.send(Messages::WebPageProxy::SetFocus(true));
194 void WebChromeClient::unfocus()
196 m_page.send(Messages::WebPageProxy::SetFocus(false));
201 void WebChromeClient::elementDidFocus(Element& element)
203 m_page.elementDidFocus(&element);
206 void WebChromeClient::elementDidBlur(Element& element)
208 m_page.elementDidBlur(&element);
211 void WebChromeClient::makeFirstResponder()
213 m_page.send(Messages::WebPageProxy::MakeFirstResponder());
216 void WebChromeClient::assistiveTechnologyMakeFirstResponder()
218 m_page.send(Messages::WebPageProxy::AssistiveTechnologyMakeFirstResponder());
223 bool WebChromeClient::canTakeFocus(FocusDirection)
229 void WebChromeClient::takeFocus(FocusDirection direction)
231 m_page.send(Messages::WebPageProxy::TakeFocus(direction));
234 void WebChromeClient::focusedElementChanged(Element* element)
236 if (!is<HTMLInputElement>(element))
239 HTMLInputElement& inputElement = downcast<HTMLInputElement>(*element);
240 if (!inputElement.isText())
243 WebFrame* webFrame = WebFrame::fromCoreFrame(*element->document().frame());
245 m_page.injectedBundleFormClient().didFocusTextField(&m_page, &inputElement, webFrame);
248 void WebChromeClient::focusedFrameChanged(Frame* frame)
250 WebFrame* webFrame = frame ? WebFrame::fromCoreFrame(*frame) : nullptr;
252 WebProcess::singleton().parentProcessConnection()->send(Messages::WebPageProxy::FocusedFrameChanged(webFrame ? webFrame->frameID() : 0), m_page.pageID());
255 Page* WebChromeClient::createWindow(Frame& frame, const FrameLoadRequest& request, const WindowFeatures& windowFeatures, const NavigationAction& navigationAction)
257 #if ENABLE(FULLSCREEN_API)
258 if (frame.document() && frame.document()->webkitCurrentFullScreenElement())
259 frame.document()->webkitCancelFullScreen();
262 auto& webProcess = WebProcess::singleton();
264 NavigationActionData navigationActionData;
265 navigationActionData.navigationType = navigationAction.type();
266 navigationActionData.modifiers = InjectedBundleNavigationAction::modifiersForNavigationAction(navigationAction);
267 navigationActionData.mouseButton = InjectedBundleNavigationAction::mouseButtonForNavigationAction(navigationAction);
268 navigationActionData.syntheticClickType = InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction(navigationAction);
269 navigationActionData.clickLocationInRootViewCoordinates = InjectedBundleNavigationAction::clickLocationInRootViewCoordinatesForNavigationAction(navigationAction);
270 navigationActionData.userGestureTokenIdentifier = webProcess.userGestureTokenIdentifier(navigationAction.userGestureToken());
271 navigationActionData.canHandleRequest = m_page.canHandleRequest(request.resourceRequest());
272 navigationActionData.shouldOpenExternalURLsPolicy = navigationAction.shouldOpenExternalURLsPolicy();
273 navigationActionData.downloadAttribute = navigationAction.downloadAttribute();
275 WebFrame* webFrame = WebFrame::fromCoreFrame(frame);
277 uint64_t newPageID = 0;
278 WebPageCreationParameters parameters;
279 if (!webProcess.parentProcessConnection()->sendSync(Messages::WebPageProxy::CreateNewPage(webFrame->info(), webFrame->page()->pageID(), request.resourceRequest(), windowFeatures, navigationActionData), Messages::WebPageProxy::CreateNewPage::Reply(newPageID, parameters), m_page.pageID()))
285 webProcess.createWebPage(newPageID, WTFMove(parameters));
286 return webProcess.webPage(newPageID)->corePage();
289 void WebChromeClient::show()
294 bool WebChromeClient::canRunModal()
296 return m_page.canRunModal();
299 void WebChromeClient::runModal()
304 void WebChromeClient::reportProcessCPUTime(Seconds cpuTime, ActivityStateForCPUSampling activityState)
306 WebProcess::singleton().send(Messages::WebProcessPool::ReportWebContentCPUTime(cpuTime, static_cast<uint64_t>(activityState)), 0);
309 void WebChromeClient::setToolbarsVisible(bool toolbarsAreVisible)
311 m_page.send(Messages::WebPageProxy::SetToolbarsAreVisible(toolbarsAreVisible));
314 bool WebChromeClient::toolbarsVisible()
316 API::InjectedBundle::PageUIClient::UIElementVisibility toolbarsVisibility = m_page.injectedBundleUIClient().toolbarsAreVisible(&m_page);
317 if (toolbarsVisibility != API::InjectedBundle::PageUIClient::UIElementVisibility::Unknown)
318 return toolbarsVisibility == API::InjectedBundle::PageUIClient::UIElementVisibility::Visible;
320 bool toolbarsAreVisible = true;
321 if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetToolbarsAreVisible(), Messages::WebPageProxy::GetToolbarsAreVisible::Reply(toolbarsAreVisible), m_page.pageID()))
324 return toolbarsAreVisible;
327 void WebChromeClient::setStatusbarVisible(bool statusBarIsVisible)
329 m_page.send(Messages::WebPageProxy::SetStatusBarIsVisible(statusBarIsVisible));
332 bool WebChromeClient::statusbarVisible()
334 API::InjectedBundle::PageUIClient::UIElementVisibility statusbarVisibility = m_page.injectedBundleUIClient().statusBarIsVisible(&m_page);
335 if (statusbarVisibility != API::InjectedBundle::PageUIClient::UIElementVisibility::Unknown)
336 return statusbarVisibility == API::InjectedBundle::PageUIClient::UIElementVisibility::Visible;
338 bool statusBarIsVisible = true;
339 if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetStatusBarIsVisible(), Messages::WebPageProxy::GetStatusBarIsVisible::Reply(statusBarIsVisible), m_page.pageID()))
342 return statusBarIsVisible;
345 void WebChromeClient::setScrollbarsVisible(bool)
350 bool WebChromeClient::scrollbarsVisible()
356 void WebChromeClient::setMenubarVisible(bool menuBarVisible)
358 m_page.send(Messages::WebPageProxy::SetMenuBarIsVisible(menuBarVisible));
361 bool WebChromeClient::menubarVisible()
363 API::InjectedBundle::PageUIClient::UIElementVisibility menubarVisibility = m_page.injectedBundleUIClient().menuBarIsVisible(&m_page);
364 if (menubarVisibility != API::InjectedBundle::PageUIClient::UIElementVisibility::Unknown)
365 return menubarVisibility == API::InjectedBundle::PageUIClient::UIElementVisibility::Visible;
367 bool menuBarIsVisible = true;
368 if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetMenuBarIsVisible(), Messages::WebPageProxy::GetMenuBarIsVisible::Reply(menuBarIsVisible), m_page.pageID()))
371 return menuBarIsVisible;
374 void WebChromeClient::setResizable(bool resizable)
376 m_page.send(Messages::WebPageProxy::SetIsResizable(resizable));
379 void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, unsigned columnNumber, const String& sourceID)
381 // Notify the bundle client.
382 m_page.injectedBundleUIClient().willAddMessageToConsole(&m_page, source, level, message, lineNumber, columnNumber, sourceID);
385 bool WebChromeClient::canRunBeforeUnloadConfirmPanel()
387 return m_page.canRunBeforeUnloadConfirmPanel();
390 bool WebChromeClient::runBeforeUnloadConfirmPanel(const String& message, Frame& frame)
392 WebFrame* webFrame = WebFrame::fromCoreFrame(frame);
394 bool shouldClose = false;
396 HangDetectionDisabler hangDetectionDisabler;
398 if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunBeforeUnloadConfirmPanel(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), message), Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::Reply(shouldClose), m_page.pageID(), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend))
404 void WebChromeClient::closeWindowSoon()
406 // FIXME: This code assumes that the client will respond to a close page
407 // message by actually closing the page. Safari does this, but there is
408 // no guarantee that other applications will, which will leave this page
409 // half detached. This approach is an inherent limitation making parts of
410 // a close execute synchronously as part of window.close, but other parts
413 m_page.corePage()->setGroupName(String());
415 if (WebFrame* frame = m_page.mainWebFrame()) {
416 if (Frame* coreFrame = frame->coreFrame())
417 coreFrame->loader().stopForUserCancel();
423 static bool shouldSuppressJavaScriptDialogs(Frame& frame)
425 if (frame.loader().opener() && frame.loader().stateMachine().isDisplayingInitialEmptyDocument() && frame.loader().provisionalDocumentLoader())
431 void WebChromeClient::runJavaScriptAlert(Frame& frame, const String& alertText)
433 if (shouldSuppressJavaScriptDialogs(frame))
436 WebFrame* webFrame = WebFrame::fromCoreFrame(frame);
439 // Notify the bundle client.
440 m_page.injectedBundleUIClient().willRunJavaScriptAlert(&m_page, alertText, webFrame);
442 HangDetectionDisabler hangDetectionDisabler;
444 WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply(), m_page.pageID(), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
447 bool WebChromeClient::runJavaScriptConfirm(Frame& frame, const String& message)
449 if (shouldSuppressJavaScriptDialogs(frame))
452 WebFrame* webFrame = WebFrame::fromCoreFrame(frame);
455 // Notify the bundle client.
456 m_page.injectedBundleUIClient().willRunJavaScriptConfirm(&m_page, message, webFrame);
458 HangDetectionDisabler hangDetectionDisabler;
461 if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptConfirm(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), message), Messages::WebPageProxy::RunJavaScriptConfirm::Reply(result), m_page.pageID(), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend))
467 bool WebChromeClient::runJavaScriptPrompt(Frame& frame, const String& message, const String& defaultValue, String& result)
469 if (shouldSuppressJavaScriptDialogs(frame))
472 WebFrame* webFrame = WebFrame::fromCoreFrame(frame);
475 // Notify the bundle client.
476 m_page.injectedBundleUIClient().willRunJavaScriptPrompt(&m_page, message, defaultValue, webFrame);
478 HangDetectionDisabler hangDetectionDisabler;
480 if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptPrompt(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), message, defaultValue), Messages::WebPageProxy::RunJavaScriptPrompt::Reply(result), m_page.pageID(), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend))
483 return !result.isNull();
486 void WebChromeClient::setStatusbarText(const String& statusbarText)
488 // Notify the bundle client.
489 m_page.injectedBundleUIClient().willSetStatusbarText(&m_page, statusbarText);
491 m_page.send(Messages::WebPageProxy::SetStatusText(statusbarText));
494 KeyboardUIMode WebChromeClient::keyboardUIMode()
496 return m_page.keyboardUIMode();
499 #if ENABLE(POINTER_LOCK)
501 bool WebChromeClient::requestPointerLock()
503 m_page.send(Messages::WebPageProxy::RequestPointerLock());
507 void WebChromeClient::requestPointerUnlock()
509 m_page.send(Messages::WebPageProxy::RequestPointerUnlock());
514 void WebChromeClient::invalidateRootView(const IntRect&)
516 // Do nothing here, there's no concept of invalidating the window in the web process.
519 void WebChromeClient::invalidateContentsAndRootView(const IntRect& rect)
521 if (Document* document = m_page.corePage()->mainFrame().document()) {
522 if (document->printing())
526 m_page.drawingArea()->setNeedsDisplayInRect(rect);
529 void WebChromeClient::invalidateContentsForSlowScroll(const IntRect& rect)
531 if (Document* document = m_page.corePage()->mainFrame().document()) {
532 if (document->printing())
536 m_page.pageDidScroll();
537 #if USE(COORDINATED_GRAPHICS)
538 FrameView* frameView = m_page.mainFrame()->view();
539 if (frameView && frameView->delegatesScrolling()) {
540 m_page.drawingArea()->scroll(rect, IntSize());
544 m_page.drawingArea()->setNeedsDisplayInRect(rect);
547 void WebChromeClient::scroll(const IntSize& scrollDelta, const IntRect& scrollRect, const IntRect& clipRect)
549 m_page.pageDidScroll();
550 m_page.drawingArea()->scroll(intersection(scrollRect, clipRect), scrollDelta);
553 IntPoint WebChromeClient::screenToRootView(const IntPoint& point) const
555 return m_page.screenToRootView(point);
558 IntRect WebChromeClient::rootViewToScreen(const IntRect& rect) const
560 return m_page.rootViewToScreen(rect);
563 #if PLATFORM(IOS_FAMILY)
564 IntPoint WebChromeClient::accessibilityScreenToRootView(const IntPoint& point) const
566 return m_page.accessibilityScreenToRootView(point);
569 IntRect WebChromeClient::rootViewToAccessibilityScreen(const IntRect& rect) const
571 return m_page.rootViewToAccessibilityScreen(rect);
575 PlatformPageClient WebChromeClient::platformPageClient() const
581 void WebChromeClient::contentsSizeChanged(Frame& frame, const IntSize& size) const
583 FrameView* frameView = frame.view();
585 if (frameView && frameView->effectiveFrameFlattening() == FrameFlattening::Disabled) {
586 WebFrame* largestFrame = findLargestFrameInFrameSet(m_page);
587 if (largestFrame != m_cachedFrameSetLargestFrame.get()) {
588 m_cachedFrameSetLargestFrame = largestFrame;
589 m_page.send(Messages::WebPageProxy::FrameSetLargestFrameChanged(largestFrame ? largestFrame->frameID() : 0));
593 if (&frame.page()->mainFrame() != &frame)
596 m_page.send(Messages::WebPageProxy::DidChangeContentSize(size));
598 m_page.drawingArea()->mainFrameContentSizeChanged(size);
600 if (frameView && !frameView->delegatesScrolling()) {
601 bool hasHorizontalScrollbar = frameView->horizontalScrollbar();
602 bool hasVerticalScrollbar = frameView->verticalScrollbar();
604 if (hasHorizontalScrollbar != m_cachedMainFrameHasHorizontalScrollbar || hasVerticalScrollbar != m_cachedMainFrameHasVerticalScrollbar) {
605 m_page.send(Messages::WebPageProxy::DidChangeScrollbarsForMainFrame(hasHorizontalScrollbar, hasVerticalScrollbar));
607 m_cachedMainFrameHasHorizontalScrollbar = hasHorizontalScrollbar;
608 m_cachedMainFrameHasVerticalScrollbar = hasVerticalScrollbar;
613 void WebChromeClient::scrollRectIntoView(const IntRect&) const
618 bool WebChromeClient::shouldUnavailablePluginMessageBeButton(RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) const
620 switch (pluginUnavailabilityReason) {
621 case RenderEmbeddedObject::PluginMissing:
622 // FIXME: <rdar://problem/8794397> We should only return true when there is a
623 // missingPluginButtonClicked callback defined on the Page UI client.
624 case RenderEmbeddedObject::InsecurePluginVersion:
628 case RenderEmbeddedObject::PluginCrashed:
629 case RenderEmbeddedObject::PluginBlockedByContentSecurityPolicy:
630 case RenderEmbeddedObject::UnsupportedPlugin:
634 ASSERT_NOT_REACHED();
638 void WebChromeClient::unavailablePluginButtonClicked(Element& element, RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) const
640 #if ENABLE(NETSCAPE_PLUGIN_API)
641 ASSERT(element.hasTagName(objectTag) || element.hasTagName(embedTag) || element.hasTagName(appletTag));
642 ASSERT(pluginUnavailabilityReason == RenderEmbeddedObject::PluginMissing || pluginUnavailabilityReason == RenderEmbeddedObject::InsecurePluginVersion || pluginUnavailabilityReason);
644 auto& pluginElement = downcast<HTMLPlugInImageElement>(element);
646 String frameURLString = pluginElement.document().frame()->loader().documentLoader()->responseURL().string();
647 String pageURLString = m_page.mainFrame()->loader().documentLoader()->responseURL().string();
648 String pluginURLString = pluginElement.document().completeURL(pluginElement.url()).string();
649 URL pluginspageAttributeURL = pluginElement.document().completeURL(stripLeadingAndTrailingHTMLSpaces(pluginElement.attributeWithoutSynchronization(pluginspageAttr)));
650 if (!pluginspageAttributeURL.protocolIsInHTTPFamily())
651 pluginspageAttributeURL = URL();
652 m_page.send(Messages::WebPageProxy::UnavailablePluginButtonClicked(pluginUnavailabilityReason, pluginElement.serviceType(), pluginURLString, pluginspageAttributeURL.string(), frameURLString, pageURLString));
654 UNUSED_PARAM(element);
655 UNUSED_PARAM(pluginUnavailabilityReason);
656 #endif // ENABLE(NETSCAPE_PLUGIN_API)
659 void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& hitTestResult, unsigned modifierFlags)
661 RefPtr<API::Object> userData;
663 // Notify the bundle client.
664 m_page.injectedBundleUIClient().mouseDidMoveOverElement(&m_page, hitTestResult, static_cast<WebEvent::Modifiers>(modifierFlags), userData);
666 // Notify the UIProcess.
667 WebHitTestResultData webHitTestResultData(hitTestResult);
668 m_page.send(Messages::WebPageProxy::MouseDidMoveOverElement(webHitTestResultData, modifierFlags, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
671 void WebChromeClient::setToolTip(const String& toolTip, TextDirection)
673 // Only send a tool tip to the WebProcess if it has changed since the last time this function was called.
675 if (toolTip == m_cachedToolTip)
677 m_cachedToolTip = toolTip;
679 m_page.send(Messages::WebPageProxy::SetToolTip(m_cachedToolTip));
682 void WebChromeClient::print(Frame& frame)
684 WebFrame* webFrame = WebFrame::fromCoreFrame(frame);
687 #if PLATFORM(GTK) && HAVE(GTK_UNIX_PRINTING)
688 // When printing synchronously in GTK+ we need to make sure that we have a list of Printers before starting the print operation.
689 // Getting the list of printers is done synchronously by GTK+, but using a nested main loop that might process IPC messages
690 // comming from the UI process like EndPrinting. When the EndPriting message is received while the printer list is being populated,
691 // the print operation is finished unexpectely and the web process crashes, see https://bugs.webkit.org/show_bug.cgi?id=126979.
692 // The PrinterListGtk class gets the list of printers in the constructor so we just need to ensure there's an instance alive
693 // during the synchronous print operation.
694 RefPtr<PrinterListGtk> printerList = PrinterListGtk::getOrCreate();
696 // PrinterListGtk::getOrCreate() returns nullptr when called while a printers enumeration is ongoing.
697 // This can happen if a synchronous print is started by a JavaScript and another one is inmeditaley started
698 // from a JavaScript event listener. The second print operation is handled by the nested main loop used by GTK+
699 // to enumerate the printers, and we end up here trying to get a reference of an object that is being constructed.
700 // It's very unlikely that the user wants to print twice in a row, and other browsers don't do two print operations
701 // in this particular case either. So, the safest solution is to return early here and ignore the second print.
702 // See https://bugs.webkit.org/show_bug.cgi?id=141035
707 m_page.sendSync(Messages::WebPageProxy::PrintFrame(webFrame->frameID()), Messages::WebPageProxy::PrintFrame::Reply(), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
710 void WebChromeClient::exceededDatabaseQuota(Frame& frame, const String& databaseName, DatabaseDetails details)
712 WebFrame* webFrame = WebFrame::fromCoreFrame(frame);
715 auto& origin = frame.document()->securityOrigin();
716 auto& originData = origin.data();
717 auto& tracker = DatabaseTracker::singleton();
718 auto currentQuota = tracker.quota(originData);
719 auto currentOriginUsage = tracker.usage(originData);
720 uint64_t newQuota = 0;
721 RefPtr<API::SecurityOrigin> securityOrigin = API::SecurityOrigin::create(SecurityOriginData::fromDatabaseIdentifier(originData.databaseIdentifier())->securityOrigin());
722 newQuota = m_page.injectedBundleUIClient().didExceedDatabaseQuota(&m_page, securityOrigin.get(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage());
725 WebProcess::singleton().parentProcessConnection()->sendSync(
726 Messages::WebPageProxy::ExceededDatabaseQuota(webFrame->frameID(), originData.databaseIdentifier(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage()),
727 Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page.pageID(), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
730 tracker.setQuota(originData, newQuota);
733 void WebChromeClient::reachedMaxAppCacheSize(int64_t)
738 void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin& origin, int64_t totalBytesNeeded)
740 RefPtr<API::SecurityOrigin> securityOrigin = API::SecurityOrigin::createFromString(origin.toString());
741 if (m_page.injectedBundleUIClient().didReachApplicationCacheOriginQuota(&m_page, securityOrigin.get(), totalBytesNeeded))
744 auto& cacheStorage = m_page.corePage()->applicationCacheStorage();
745 int64_t currentQuota = 0;
746 if (!cacheStorage.calculateQuotaForOrigin(origin, currentQuota))
749 uint64_t newQuota = 0;
750 WebProcess::singleton().parentProcessConnection()->sendSync(
751 Messages::WebPageProxy::ReachedApplicationCacheOriginQuota(origin.data().databaseIdentifier(), currentQuota, totalBytesNeeded),
752 Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::Reply(newQuota), m_page.pageID(), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
754 cacheStorage.storeUpdatedQuotaForOrigin(&origin, newQuota);
757 #if ENABLE(DASHBOARD_SUPPORT)
759 void WebChromeClient::annotatedRegionsChanged()
766 bool WebChromeClient::shouldReplaceWithGeneratedFileForUpload(const String& path, String& generatedFilename)
768 generatedFilename = m_page.injectedBundleUIClient().shouldGenerateFileForUpload(&m_page, path);
769 return !generatedFilename.isNull();
772 String WebChromeClient::generateReplacementFile(const String& path)
774 return m_page.injectedBundleUIClient().generateFileForUpload(&m_page, path);
777 #if ENABLE(INPUT_TYPE_COLOR)
779 std::unique_ptr<ColorChooser> WebChromeClient::createColorChooser(ColorChooserClient& client, const Color& initialColor)
781 return std::make_unique<WebColorChooser>(&m_page, &client, initialColor);
786 #if ENABLE(DATALIST_ELEMENT)
788 std::unique_ptr<DataListSuggestionPicker> WebChromeClient::createDataListSuggestionPicker(DataListSuggestionsClient& client)
790 return std::make_unique<WebDataListSuggestionPicker>(&m_page, &client);
795 void WebChromeClient::runOpenPanel(Frame& frame, FileChooser& fileChooser)
797 if (m_page.activeOpenPanelResultListener())
800 m_page.setActiveOpenPanelResultListener(WebOpenPanelResultListener::create(m_page, fileChooser));
802 auto* webFrame = WebFrame::fromCoreFrame(frame);
804 m_page.send(Messages::WebPageProxy::RunOpenPanel(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), fileChooser.settings()));
807 void WebChromeClient::showShareSheet(ShareDataWithParsedURL& shareData, CompletionHandler<void(bool)>&& callback)
809 m_page.showShareSheet(shareData, WTFMove(callback));
812 void WebChromeClient::loadIconForFiles(const Vector<String>& filenames, FileIconLoader& loader)
814 loader.iconLoaded(createIconForFiles(filenames));
817 #if !PLATFORM(IOS_FAMILY)
819 void WebChromeClient::setCursor(const Cursor& cursor)
821 m_page.send(Messages::WebPageProxy::SetCursor(cursor));
824 void WebChromeClient::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
826 m_page.send(Messages::WebPageProxy::SetCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves));
829 RefPtr<Icon> WebChromeClient::createIconForFiles(const Vector<String>& filenames)
831 return Icon::createIconForFiles(filenames);
836 void WebChromeClient::didAssociateFormControls(const Vector<RefPtr<Element>>& elements)
838 return m_page.injectedBundleFormClient().didAssociateFormControls(&m_page, elements);
841 bool WebChromeClient::shouldNotifyOnFormChanges()
843 return m_page.injectedBundleFormClient().shouldNotifyOnFormChanges(&m_page);
846 bool WebChromeClient::selectItemWritingDirectionIsNatural()
851 bool WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection()
856 RefPtr<PopupMenu> WebChromeClient::createPopupMenu(PopupMenuClient& client) const
858 return WebPopupMenu::create(&m_page, &client);
861 RefPtr<SearchPopupMenu> WebChromeClient::createSearchPopupMenu(PopupMenuClient& client) const
863 return WebSearchPopupMenu::create(&m_page, &client);
866 GraphicsLayerFactory* WebChromeClient::graphicsLayerFactory() const
868 if (auto drawingArea = m_page.drawingArea())
869 return drawingArea->graphicsLayerFactory();
873 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
875 RefPtr<DisplayRefreshMonitor> WebChromeClient::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
877 return m_page.drawingArea()->createDisplayRefreshMonitor(displayID);
882 void WebChromeClient::attachRootGraphicsLayer(Frame&, GraphicsLayer* layer)
885 m_page.enterAcceleratedCompositingMode(layer);
887 m_page.exitAcceleratedCompositingMode();
890 void WebChromeClient::attachViewOverlayGraphicsLayer(Frame& frame, GraphicsLayer* graphicsLayer)
892 if (auto drawingArea = m_page.drawingArea())
893 drawingArea->attachViewOverlayGraphicsLayer(&frame, graphicsLayer);
896 void WebChromeClient::setNeedsOneShotDrawingSynchronization()
901 void WebChromeClient::scheduleCompositingLayerFlush()
903 if (m_page.drawingArea())
904 m_page.drawingArea()->scheduleCompositingLayerFlush();
907 void WebChromeClient::contentRuleListNotification(const URL& url, const HashSet<std::pair<String, String>>& notificationPairs)
909 Vector<String> identifiers;
910 Vector<String> notifications;
911 identifiers.reserveInitialCapacity(notificationPairs.size());
912 notifications.reserveInitialCapacity(notificationPairs.size());
913 for (auto& notification : notificationPairs) {
914 identifiers.uncheckedAppend(notification.first);
915 notifications.uncheckedAppend(notification.second);
918 m_page.send(Messages::WebPageProxy::ContentRuleListNotification(url, identifiers, notifications));
921 bool WebChromeClient::adjustLayerFlushThrottling(LayerFlushThrottleState::Flags flags)
923 return m_page.drawingArea() && m_page.drawingArea()->adjustLayerFlushThrottling(flags);
926 bool WebChromeClient::layerTreeStateIsFrozen() const
928 if (m_page.drawingArea())
929 return m_page.drawingArea()->layerTreeStateIsFrozen();
934 #if ENABLE(ASYNC_SCROLLING)
936 RefPtr<ScrollingCoordinator> WebChromeClient::createScrollingCoordinator(Page& page) const
938 ASSERT_UNUSED(page, m_page.corePage() == &page);
940 if (m_page.drawingArea()->type() != DrawingAreaTypeRemoteLayerTree)
942 return RemoteScrollingCoordinator::create(&m_page);
950 #if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
952 bool WebChromeClient::supportsVideoFullscreen(HTMLMediaElementEnums::VideoFullscreenMode mode)
954 return m_page.videoFullscreenManager().supportsVideoFullscreen(mode);
957 bool WebChromeClient::supportsVideoFullscreenStandby()
959 return m_page.videoFullscreenManager().supportsVideoFullscreenStandby();
962 void WebChromeClient::setUpPlaybackControlsManager(HTMLMediaElement& mediaElement)
964 m_page.playbackSessionManager().setUpPlaybackControlsManager(mediaElement);
967 void WebChromeClient::clearPlaybackControlsManager()
969 m_page.playbackSessionManager().clearPlaybackControlsManager();
972 void WebChromeClient::enterVideoFullscreenForVideoElement(HTMLVideoElement& videoElement, HTMLMediaElementEnums::VideoFullscreenMode mode, bool standby)
974 #if ENABLE(FULLSCREEN_API) && PLATFORM(IOS_FAMILY)
975 ASSERT(standby || mode != HTMLMediaElementEnums::VideoFullscreenModeNone);
977 ASSERT(mode != HTMLMediaElementEnums::VideoFullscreenModeNone);
979 m_page.videoFullscreenManager().enterVideoFullscreenForVideoElement(videoElement, mode, standby);
982 void WebChromeClient::exitVideoFullscreenForVideoElement(HTMLVideoElement& videoElement)
984 m_page.videoFullscreenManager().exitVideoFullscreenForVideoElement(videoElement);
989 #if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
991 void WebChromeClient::exitVideoFullscreenToModeWithoutAnimation(HTMLVideoElement& videoElement, HTMLMediaElementEnums::VideoFullscreenMode targetMode)
993 m_page.videoFullscreenManager().exitVideoFullscreenToModeWithoutAnimation(videoElement, targetMode);
998 #if ENABLE(FULLSCREEN_API)
1000 bool WebChromeClient::supportsFullScreenForElement(const Element&, bool withKeyboard)
1002 return m_page.fullScreenManager()->supportsFullScreen(withKeyboard);
1005 void WebChromeClient::enterFullScreenForElement(Element& element)
1007 m_page.fullScreenManager()->enterFullScreenForElement(&element);
1010 void WebChromeClient::exitFullScreenForElement(Element* element)
1012 m_page.fullScreenManager()->exitFullScreenForElement(element);
1017 #if PLATFORM(IOS_FAMILY)
1019 FloatSize WebChromeClient::screenSize() const
1021 return m_page.screenSize();
1024 FloatSize WebChromeClient::availableScreenSize() const
1026 return m_page.availableScreenSize();
1029 FloatSize WebChromeClient::overrideScreenSize() const
1031 return m_page.overrideScreenSize();
1036 void WebChromeClient::dispatchDisabledAdaptationsDidChange(const OptionSet<DisabledAdaptations>& disabledAdaptations) const
1038 m_page.disabledAdaptationsDidChange(disabledAdaptations);
1041 void WebChromeClient::dispatchViewportPropertiesDidChange(const ViewportArguments& viewportArguments) const
1043 m_page.viewportPropertiesDidChange(viewportArguments);
1046 void WebChromeClient::notifyScrollerThumbIsVisibleInRect(const IntRect& scrollerThumb)
1048 m_page.send(Messages::WebPageProxy::NotifyScrollerThumbIsVisibleInRect(scrollerThumb));
1051 void WebChromeClient::recommendedScrollbarStyleDidChange(ScrollbarStyle newStyle)
1053 m_page.send(Messages::WebPageProxy::RecommendedScrollbarStyleDidChange(static_cast<int32_t>(newStyle)));
1056 std::optional<ScrollbarOverlayStyle> WebChromeClient::preferredScrollbarOverlayStyle()
1058 return m_page.scrollbarOverlayStyle();
1061 Color WebChromeClient::underlayColor() const
1063 return m_page.underlayColor();
1066 void WebChromeClient::pageExtendedBackgroundColorDidChange(Color backgroundColor) const
1069 m_page.send(Messages::WebPageProxy::PageExtendedBackgroundColorDidChange(backgroundColor));
1071 UNUSED_PARAM(backgroundColor);
1075 void WebChromeClient::wheelEventHandlersChanged(bool hasHandlers)
1077 m_page.wheelEventHandlersChanged(hasHandlers);
1080 String WebChromeClient::plugInStartLabelTitle(const String& mimeType) const
1082 return m_page.injectedBundleUIClient().plugInStartLabelTitle(mimeType);
1085 String WebChromeClient::plugInStartLabelSubtitle(const String& mimeType) const
1087 return m_page.injectedBundleUIClient().plugInStartLabelSubtitle(mimeType);
1090 String WebChromeClient::plugInExtraStyleSheet() const
1092 return m_page.injectedBundleUIClient().plugInExtraStyleSheet();
1095 String WebChromeClient::plugInExtraScript() const
1097 return m_page.injectedBundleUIClient().plugInExtraScript();
1100 void WebChromeClient::enableSuddenTermination()
1102 m_page.send(Messages::WebProcessProxy::EnableSuddenTermination());
1105 void WebChromeClient::disableSuddenTermination()
1107 m_page.send(Messages::WebProcessProxy::DisableSuddenTermination());
1110 void WebChromeClient::didAddHeaderLayer(GraphicsLayer& headerParent)
1112 #if ENABLE(RUBBER_BANDING)
1113 if (PageBanner* banner = m_page.headerPageBanner())
1114 banner->didAddParentLayer(&headerParent);
1116 UNUSED_PARAM(headerParent);
1120 void WebChromeClient::didAddFooterLayer(GraphicsLayer& footerParent)
1122 #if ENABLE(RUBBER_BANDING)
1123 if (PageBanner* banner = m_page.footerPageBanner())
1124 banner->didAddParentLayer(&footerParent);
1126 UNUSED_PARAM(footerParent);
1130 bool WebChromeClient::shouldUseTiledBackingForFrameView(const FrameView& frameView) const
1132 return m_page.drawingArea()->shouldUseTiledBackingForFrameView(frameView);
1135 void WebChromeClient::isPlayingMediaDidChange(MediaProducer::MediaStateFlags state, uint64_t sourceElementID)
1137 m_page.send(Messages::WebPageProxy::IsPlayingMediaDidChange(state, sourceElementID));
1140 void WebChromeClient::handleAutoplayEvent(AutoplayEvent event, OptionSet<AutoplayEventFlags> flags)
1142 m_page.send(Messages::WebPageProxy::HandleAutoplayEvent(event, flags));
1145 #if ENABLE(MEDIA_SESSION)
1147 void WebChromeClient::hasMediaSessionWithActiveMediaElementsDidChange(bool state)
1149 m_page.send(Messages::WebPageProxy::HasMediaSessionWithActiveMediaElementsDidChange(state));
1152 void WebChromeClient::mediaSessionMetadataDidChange(const MediaSessionMetadata& metadata)
1154 m_page.send(Messages::WebPageProxy::MediaSessionMetadataDidChange(metadata));
1157 void WebChromeClient::focusedContentMediaElementDidChange(uint64_t elementID)
1159 m_page.send(Messages::WebPageProxy::FocusedContentMediaElementDidChange(elementID));
1164 #if ENABLE(SUBTLE_CRYPTO)
1166 bool WebChromeClient::wrapCryptoKey(const Vector<uint8_t>& key, Vector<uint8_t>& wrappedKey) const
1169 if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::WrapCryptoKey(key), Messages::WebPageProxy::WrapCryptoKey::Reply(succeeded, wrappedKey), m_page.pageID()))
1174 bool WebChromeClient::unwrapCryptoKey(const Vector<uint8_t>& wrappedKey, Vector<uint8_t>& key) const
1177 if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::UnwrapCryptoKey(wrappedKey), Messages::WebPageProxy::UnwrapCryptoKey::Reply(succeeded, key), m_page.pageID()))
1184 String WebChromeClient::signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const WebCore::URL& url) const
1187 if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::SignedPublicKeyAndChallengeString(keySizeIndex, challengeString, url), Messages::WebPageProxy::SignedPublicKeyAndChallengeString::Reply(result), m_page.pageID()))
1188 return emptyString();
1192 #if ENABLE(TELEPHONE_NUMBER_DETECTION) && PLATFORM(MAC)
1194 void WebChromeClient::handleTelephoneNumberClick(const String& number, const IntPoint& point)
1196 m_page.handleTelephoneNumberClick(number, point);
1201 #if ENABLE(SERVICE_CONTROLS)
1203 void WebChromeClient::handleSelectionServiceClick(FrameSelection& selection, const Vector<String>& telephoneNumbers, const IntPoint& point)
1205 m_page.handleSelectionServiceClick(selection, telephoneNumbers, point);
1208 bool WebChromeClient::hasRelevantSelectionServices(bool isTextOnly) const
1210 return (isTextOnly && WebProcess::singleton().hasSelectionServices()) || WebProcess::singleton().hasRichContentServices();
1215 bool WebChromeClient::shouldDispatchFakeMouseMoveEvents() const
1217 return m_page.shouldDispatchFakeMouseMoveEvents();
1220 void WebChromeClient::handleAutoFillButtonClick(HTMLInputElement& inputElement)
1222 RefPtr<API::Object> userData;
1224 // Notify the bundle client.
1225 auto nodeHandle = InjectedBundleNodeHandle::getOrCreate(inputElement);
1226 m_page.injectedBundleUIClient().didClickAutoFillButton(m_page, nodeHandle.get(), userData);
1228 // Notify the UIProcess.
1229 m_page.send(Messages::WebPageProxy::HandleAutoFillButtonClick(UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
1232 void WebChromeClient::inputElementDidResignStrongPasswordAppearance(HTMLInputElement& inputElement)
1234 RefPtr<API::Object> userData;
1236 // Notify the bundle client.
1237 auto nodeHandle = InjectedBundleNodeHandle::getOrCreate(inputElement);
1238 m_page.injectedBundleUIClient().didResignInputElementStrongPasswordAppearance(m_page, nodeHandle.get(), userData);
1240 // Notify the UIProcess.
1241 m_page.send(Messages::WebPageProxy::DidResignInputElementStrongPasswordAppearance { UserData { WebProcess::singleton().transformObjectsToHandles(userData.get()).get() } });
1244 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
1246 void WebChromeClient::addPlaybackTargetPickerClient(uint64_t contextId)
1248 m_page.send(Messages::WebPageProxy::AddPlaybackTargetPickerClient(contextId));
1251 void WebChromeClient::removePlaybackTargetPickerClient(uint64_t contextId)
1253 m_page.send(Messages::WebPageProxy::RemovePlaybackTargetPickerClient(contextId));
1256 void WebChromeClient::showPlaybackTargetPicker(uint64_t contextId, const IntPoint& position, bool isVideo)
1258 FrameView* frameView = m_page.mainFrame()->view();
1259 FloatRect rect(frameView->contentsToRootView(frameView->windowToContents(position)), FloatSize());
1260 m_page.send(Messages::WebPageProxy::ShowPlaybackTargetPicker(contextId, rect, isVideo));
1263 void WebChromeClient::playbackTargetPickerClientStateDidChange(uint64_t contextId, MediaProducer::MediaStateFlags state)
1265 m_page.send(Messages::WebPageProxy::PlaybackTargetPickerClientStateDidChange(contextId, state));
1268 void WebChromeClient::setMockMediaPlaybackTargetPickerEnabled(bool enabled)
1270 m_page.send(Messages::WebPageProxy::SetMockMediaPlaybackTargetPickerEnabled(enabled));
1273 void WebChromeClient::setMockMediaPlaybackTargetPickerState(const String& name, MediaPlaybackTargetContext::State state)
1275 m_page.send(Messages::WebPageProxy::SetMockMediaPlaybackTargetPickerState(name, state));
1280 void WebChromeClient::imageOrMediaDocumentSizeChanged(const IntSize& newSize)
1282 m_page.imageOrMediaDocumentSizeChanged(newSize);
1285 #if ENABLE(VIDEO) && USE(GSTREAMER)
1287 void WebChromeClient::requestInstallMissingMediaPlugins(const String& details, const String& description, MediaPlayerRequestInstallMissingPluginsCallback& callback)
1289 m_page.requestInstallMissingMediaPlugins(details, description, callback);
1294 void WebChromeClient::didInvalidateDocumentMarkerRects()
1296 m_page.findController().didInvalidateDocumentMarkerRects();
1299 #if ENABLE(RESOURCE_LOAD_STATISTICS)
1300 void WebChromeClient::hasStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t, CompletionHandler<void(bool)>&& callback)
1302 m_page.hasStorageAccess(WTFMove(subFrameHost), WTFMove(topFrameHost), frameID, WTFMove(callback));
1305 void WebChromeClient::requestStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t, CompletionHandler<void(bool)>&& callback)
1307 m_page.requestStorageAccess(WTFMove(subFrameHost), WTFMove(topFrameHost), frameID, WTFMove(callback));
1311 bool WebChromeClient::isViewVisible()
1313 bool isVisible = false;
1314 WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetIsViewVisible(), Messages::WebPageProxy::GetIsViewVisible::Reply(isVisible), m_page.pageID());
1318 } // namespace WebKit