| 1 | /* |
| 2 | * Copyright (C) 2006-2018 Apple, Inc. All rights reserved. |
| 3 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 4 | * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Library General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Library General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Library General Public License |
| 17 | * along with this library; see the file COPYING.LIB. If not, write to |
| 18 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 19 | * Boston, MA 02110-1301, USA. |
| 20 | */ |
| 21 | |
| 22 | #pragma once |
| 23 | |
| 24 | #include "AXObjectCache.h" |
| 25 | #include "AutoplayEvent.h" |
| 26 | #include "Cursor.h" |
| 27 | #include "DatabaseDetails.h" |
| 28 | #include "DeviceOrientationOrMotionPermissionState.h" |
| 29 | #include "DisabledAdaptations.h" |
| 30 | #include "DisplayRefreshMonitor.h" |
| 31 | #include "DocumentStorageAccess.h" |
| 32 | #include "FocusDirection.h" |
| 33 | #include "FrameLoader.h" |
| 34 | #include "GraphicsContext.h" |
| 35 | #include "GraphicsLayer.h" |
| 36 | #include "HTMLMediaElementEnums.h" |
| 37 | #include "HostWindow.h" |
| 38 | #include "Icon.h" |
| 39 | #include "InputMode.h" |
| 40 | #include "LayerFlushThrottleState.h" |
| 41 | #include "MediaProducer.h" |
| 42 | #include "PopupMenu.h" |
| 43 | #include "PopupMenuClient.h" |
| 44 | #include "RegistrableDomain.h" |
| 45 | #include "RenderEmbeddedObject.h" |
| 46 | #include "ScrollTypes.h" |
| 47 | #include "ScrollingCoordinator.h" |
| 48 | #include "SearchPopupMenu.h" |
| 49 | #include "WebCoreKeyboardUIMode.h" |
| 50 | #include <JavaScriptCore/ConsoleTypes.h> |
| 51 | #include <wtf/Assertions.h> |
| 52 | #include <wtf/CompletionHandler.h> |
| 53 | #include <wtf/Forward.h> |
| 54 | #include <wtf/Seconds.h> |
| 55 | |
| 56 | #if ENABLE(WIRELESS_PLAYBACK_TARGET) |
| 57 | #include "MediaPlaybackTargetContext.h" |
| 58 | #endif |
| 59 | |
| 60 | #if PLATFORM(IOS_FAMILY) |
| 61 | #include "PlatformLayer.h" |
| 62 | #define NSResponder WAKResponder |
| 63 | #ifndef __OBJC__ |
| 64 | class WAKResponder; |
| 65 | #else |
| 66 | @class WAKResponder; |
| 67 | #endif |
| 68 | #endif |
| 69 | |
| 70 | OBJC_CLASS NSResponder; |
| 71 | |
| 72 | namespace WebCore { |
| 73 | |
| 74 | class AccessibilityObject; |
| 75 | class ColorChooser; |
| 76 | class ColorChooserClient; |
| 77 | class DataListSuggestionPicker; |
| 78 | class DataListSuggestionsClient; |
| 79 | class DateTimeChooser; |
| 80 | class DateTimeChooserClient; |
| 81 | class Element; |
| 82 | class FileChooser; |
| 83 | class FileIconLoader; |
| 84 | class FloatRect; |
| 85 | class Frame; |
| 86 | class FrameLoadRequest; |
| 87 | class Geolocation; |
| 88 | class GraphicsLayer; |
| 89 | class GraphicsLayerFactory; |
| 90 | class HTMLInputElement; |
| 91 | class HTMLMediaElement; |
| 92 | class HTMLVideoElement; |
| 93 | class HitTestResult; |
| 94 | class IntRect; |
| 95 | class MediaSessionMetadata; |
| 96 | class NavigationAction; |
| 97 | class Node; |
| 98 | class Page; |
| 99 | class ; |
| 100 | class SecurityOrigin; |
| 101 | class ViewportConstraints; |
| 102 | class Widget; |
| 103 | |
| 104 | #if ENABLE(VIDEO) && USE(GSTREAMER) |
| 105 | class MediaPlayerRequestInstallMissingPluginsCallback; |
| 106 | #endif |
| 107 | |
| 108 | struct ContentRuleListResults; |
| 109 | struct DateTimeChooserParameters; |
| 110 | struct GraphicsDeviceAdapter; |
| 111 | struct ShareDataWithParsedURL; |
| 112 | struct ViewportArguments; |
| 113 | struct WindowFeatures; |
| 114 | |
| 115 | enum class RouteSharingPolicy : uint8_t; |
| 116 | |
| 117 | class WEBCORE_EXPORT ChromeClient { |
| 118 | public: |
| 119 | virtual void chromeDestroyed() = 0; |
| 120 | |
| 121 | virtual void setWindowRect(const FloatRect&) = 0; |
| 122 | virtual FloatRect windowRect() = 0; |
| 123 | |
| 124 | virtual FloatRect () = 0; |
| 125 | |
| 126 | virtual void focus() = 0; |
| 127 | virtual void unfocus() = 0; |
| 128 | |
| 129 | virtual bool canTakeFocus(FocusDirection) = 0; |
| 130 | virtual void takeFocus(FocusDirection) = 0; |
| 131 | |
| 132 | virtual void focusedElementChanged(Element*) = 0; |
| 133 | virtual void focusedFrameChanged(Frame*) = 0; |
| 134 | |
| 135 | // The Frame pointer provides the ChromeClient with context about which |
| 136 | // Frame wants to create the new Page. Also, the newly created window |
| 137 | // should not be shown to the user until the ChromeClient of the newly |
| 138 | // created Page has its show method called. |
| 139 | // The FrameLoadRequest parameter is only for ChromeClient to check if the |
| 140 | // request could be fulfilled. The ChromeClient should not load the request. |
| 141 | virtual Page* createWindow(Frame&, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&) = 0; |
| 142 | virtual void show() = 0; |
| 143 | |
| 144 | virtual bool canRunModal() = 0; |
| 145 | virtual void runModal() = 0; |
| 146 | |
| 147 | virtual void setToolbarsVisible(bool) = 0; |
| 148 | virtual bool toolbarsVisible() = 0; |
| 149 | |
| 150 | virtual void setStatusbarVisible(bool) = 0; |
| 151 | virtual bool statusbarVisible() = 0; |
| 152 | |
| 153 | virtual void setScrollbarsVisible(bool) = 0; |
| 154 | virtual bool scrollbarsVisible() = 0; |
| 155 | |
| 156 | virtual void (bool) = 0; |
| 157 | virtual bool () = 0; |
| 158 | |
| 159 | virtual void setResizable(bool) = 0; |
| 160 | |
| 161 | virtual void addMessageToConsole(MessageSource, MessageLevel, const String& message, unsigned lineNumber, unsigned columnNumber, const String& sourceID) = 0; |
| 162 | |
| 163 | virtual bool canRunBeforeUnloadConfirmPanel() = 0; |
| 164 | virtual bool runBeforeUnloadConfirmPanel(const String& message, Frame&) = 0; |
| 165 | |
| 166 | virtual void closeWindowSoon() = 0; |
| 167 | |
| 168 | virtual void runJavaScriptAlert(Frame&, const String&) = 0; |
| 169 | virtual bool runJavaScriptConfirm(Frame&, const String&) = 0; |
| 170 | virtual bool runJavaScriptPrompt(Frame&, const String& message, const String& defaultValue, String& result) = 0; |
| 171 | virtual void setStatusbarText(const String&) = 0; |
| 172 | virtual KeyboardUIMode keyboardUIMode() = 0; |
| 173 | |
| 174 | virtual bool supportsImmediateInvalidation() { return false; } |
| 175 | virtual void invalidateRootView(const IntRect&) = 0; |
| 176 | virtual void invalidateContentsAndRootView(const IntRect&) = 0; |
| 177 | virtual void invalidateContentsForSlowScroll(const IntRect&) = 0; |
| 178 | virtual void scroll(const IntSize&, const IntRect&, const IntRect&) = 0; |
| 179 | |
| 180 | virtual IntPoint screenToRootView(const IntPoint&) const = 0; |
| 181 | virtual IntRect rootViewToScreen(const IntRect&) const = 0; |
| 182 | virtual IntPoint accessibilityScreenToRootView(const IntPoint&) const = 0; |
| 183 | virtual IntRect rootViewToAccessibilityScreen(const IntRect&) const = 0; |
| 184 | |
| 185 | virtual PlatformPageClient platformPageClient() const = 0; |
| 186 | |
| 187 | #if ENABLE(CURSOR_SUPPORT) |
| 188 | virtual void setCursor(const Cursor&) = 0; |
| 189 | virtual void setCursorHiddenUntilMouseMoves(bool) = 0; |
| 190 | #endif |
| 191 | |
| 192 | virtual FloatSize screenSize() const { return const_cast<ChromeClient&>(*this).windowRect().size(); } |
| 193 | virtual FloatSize availableScreenSize() const { return const_cast<ChromeClient&>(*this).windowRect().size(); } |
| 194 | virtual FloatSize overrideScreenSize() const { return const_cast<ChromeClient&>(*this).windowRect().size(); } |
| 195 | |
| 196 | virtual void dispatchDisabledAdaptationsDidChange(const OptionSet<DisabledAdaptations>&) const { } |
| 197 | virtual void dispatchViewportPropertiesDidChange(const ViewportArguments&) const { } |
| 198 | |
| 199 | virtual void contentsSizeChanged(Frame&, const IntSize&) const = 0; |
| 200 | virtual void intrinsicContentsSizeChanged(const IntSize&) const = 0; |
| 201 | virtual void scrollRectIntoView(const IntRect&) const { }; // Currently only Mac has a non empty implementation. |
| 202 | |
| 203 | virtual bool shouldUnavailablePluginMessageBeButton(RenderEmbeddedObject::PluginUnavailabilityReason) const { return false; } |
| 204 | virtual void unavailablePluginButtonClicked(Element&, RenderEmbeddedObject::PluginUnavailabilityReason) const { } |
| 205 | virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags) = 0; |
| 206 | |
| 207 | virtual void setToolTip(const String&, TextDirection) = 0; |
| 208 | |
| 209 | virtual void print(Frame&) = 0; |
| 210 | |
| 211 | virtual Color underlayColor() const { return Color(); } |
| 212 | |
| 213 | virtual void pageExtendedBackgroundColorDidChange(Color) const { } |
| 214 | |
| 215 | virtual void exceededDatabaseQuota(Frame&, const String& databaseName, DatabaseDetails) = 0; |
| 216 | |
| 217 | // Callback invoked when the application cache fails to save a cache object |
| 218 | // because storing it would grow the database file past its defined maximum |
| 219 | // size or past the amount of free space on the device. |
| 220 | // The chrome client would need to take some action such as evicting some |
| 221 | // old caches. |
| 222 | virtual void reachedMaxAppCacheSize(int64_t spaceNeeded) = 0; |
| 223 | |
| 224 | // Callback invoked when the application cache origin quota is reached. This |
| 225 | // means that the resources attempting to be cached via the manifest are |
| 226 | // more than allowed on this origin. This callback allows the chrome client |
| 227 | // to take action, such as prompting the user to ask to increase the quota |
| 228 | // for this origin. The totalSpaceNeeded parameter is the total amount of |
| 229 | // storage, in bytes, needed to store the new cache along with all of the |
| 230 | // other existing caches for the origin that would not be replaced by |
| 231 | // the new cache. |
| 232 | virtual void reachedApplicationCacheOriginQuota(SecurityOrigin&, int64_t totalSpaceNeeded) = 0; |
| 233 | |
| 234 | #if ENABLE(DASHBOARD_SUPPORT) |
| 235 | virtual void annotatedRegionsChanged(); |
| 236 | #endif |
| 237 | |
| 238 | virtual bool shouldReplaceWithGeneratedFileForUpload(const String& path, String& generatedFilename); |
| 239 | virtual String generateReplacementFile(const String& path); |
| 240 | |
| 241 | #if ENABLE(IOS_TOUCH_EVENTS) |
| 242 | virtual void didPreventDefaultForEvent() = 0; |
| 243 | #endif |
| 244 | |
| 245 | virtual Seconds eventThrottlingDelay() { return 0_s; }; |
| 246 | |
| 247 | #if PLATFORM(IOS_FAMILY) |
| 248 | virtual void didReceiveMobileDocType(bool) = 0; |
| 249 | virtual void setNeedsScrollNotifications(Frame&, bool) = 0; |
| 250 | virtual void observedContentChange(Frame&) = 0; |
| 251 | virtual void notifyRevealedSelectionByScrollingFrame(Frame&) = 0; |
| 252 | |
| 253 | enum LayoutType { NormalLayout, Scroll }; |
| 254 | virtual void didLayout(LayoutType = NormalLayout) = 0; |
| 255 | virtual void didStartOverflowScroll() = 0; |
| 256 | virtual void didEndOverflowScroll() = 0; |
| 257 | |
| 258 | // FIXME: Remove this functionality. This functionality was added to workaround an issue (<rdar://problem/5973875>) |
| 259 | // where the unconfirmed text in a text area would be removed when a person clicks in the text area before a |
| 260 | // suggestion is shown. We should fix this issue in <rdar://problem/5975559>. |
| 261 | virtual void suppressFormNotifications() = 0; |
| 262 | virtual void restoreFormNotifications() = 0; |
| 263 | |
| 264 | virtual void didFlushCompositingLayers() { } |
| 265 | |
| 266 | virtual bool fetchCustomFixedPositionLayoutRect(IntRect&) { return false; } |
| 267 | |
| 268 | virtual void updateViewportConstrainedLayers(HashMap<PlatformLayer*, std::unique_ptr<ViewportConstraints>>&, const HashMap<PlatformLayer*, PlatformLayer*>&) { } |
| 269 | |
| 270 | virtual void addOrUpdateScrollingLayer(Node*, PlatformLayer* scrollingLayer, PlatformLayer* contentsLayer, const IntSize& scrollSize, bool allowHorizontalScrollbar, bool allowVerticalScrollbar) = 0; |
| 271 | virtual void removeScrollingLayer(Node*, PlatformLayer* scrollingLayer, PlatformLayer* contentsLayer) = 0; |
| 272 | |
| 273 | virtual void webAppOrientationsUpdated() = 0; |
| 274 | virtual void showPlaybackTargetPicker(bool hasVideo, RouteSharingPolicy, const String&) = 0; |
| 275 | #endif |
| 276 | |
| 277 | #if ENABLE(ORIENTATION_EVENTS) |
| 278 | virtual int deviceOrientation() const = 0; |
| 279 | #endif |
| 280 | |
| 281 | #if ENABLE(INPUT_TYPE_COLOR) |
| 282 | virtual std::unique_ptr<ColorChooser> createColorChooser(ColorChooserClient&, const Color&) = 0; |
| 283 | #endif |
| 284 | |
| 285 | #if ENABLE(DATALIST_ELEMENT) |
| 286 | virtual std::unique_ptr<DataListSuggestionPicker> createDataListSuggestionPicker(DataListSuggestionsClient&) = 0; |
| 287 | #endif |
| 288 | |
| 289 | virtual void runOpenPanel(Frame&, FileChooser&) = 0; |
| 290 | virtual void showShareSheet(ShareDataWithParsedURL&, WTF::CompletionHandler<void(bool)>&& callback) { callback(false); } |
| 291 | |
| 292 | // Asynchronous request to load an icon for specified filenames. |
| 293 | virtual void loadIconForFiles(const Vector<String>&, FileIconLoader&) = 0; |
| 294 | |
| 295 | virtual void elementDidFocus(Element&) { } |
| 296 | virtual void elementDidBlur(Element&) { } |
| 297 | virtual void elementDidRefocus(Element&) { } |
| 298 | |
| 299 | virtual void focusedElementDidChangeInputMode(Element&, InputMode) { } |
| 300 | |
| 301 | virtual bool shouldPaintEntireContents() const { return false; } |
| 302 | virtual bool hasStablePageScaleFactor() const { return true; } |
| 303 | |
| 304 | // Allows ports to customize the type of graphics layers created by this page. |
| 305 | virtual GraphicsLayerFactory* graphicsLayerFactory() const { return nullptr; } |
| 306 | |
| 307 | #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) |
| 308 | virtual RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const { return nullptr; } |
| 309 | #endif |
| 310 | |
| 311 | // Pass nullptr as the GraphicsLayer to detatch the root layer. |
| 312 | virtual void attachRootGraphicsLayer(Frame&, GraphicsLayer*) = 0; |
| 313 | virtual void attachViewOverlayGraphicsLayer(GraphicsLayer*) = 0; |
| 314 | // Sets a flag to specify that the next time content is drawn to the window, |
| 315 | // the changes appear on the screen in synchrony with updates to GraphicsLayers. |
| 316 | virtual void setNeedsOneShotDrawingSynchronization() = 0; |
| 317 | // Sets a flag to specify that the view needs to be updated, so we need |
| 318 | // to do an eager layout before the drawing. |
| 319 | virtual void scheduleCompositingLayerFlush() = 0; |
| 320 | // Returns whether or not the client can render the composited layer, |
| 321 | // regardless of the settings. |
| 322 | virtual bool allowsAcceleratedCompositing() const { return true; } |
| 323 | |
| 324 | enum CompositingTrigger { |
| 325 | ThreeDTransformTrigger = 1 << 0, |
| 326 | VideoTrigger = 1 << 1, |
| 327 | PluginTrigger = 1 << 2, |
| 328 | CanvasTrigger = 1 << 3, |
| 329 | AnimationTrigger = 1 << 4, |
| 330 | FilterTrigger = 1 << 5, |
| 331 | ScrollableNonMainFrameTrigger = 1 << 6, |
| 332 | AnimatedOpacityTrigger = 1 << 7, |
| 333 | AllTriggers = 0xFFFFFFFF |
| 334 | }; |
| 335 | typedef unsigned CompositingTriggerFlags; |
| 336 | |
| 337 | // Returns a bitfield indicating conditions that can trigger the compositor. |
| 338 | virtual CompositingTriggerFlags allowedCompositingTriggers() const { return static_cast<CompositingTriggerFlags>(AllTriggers); } |
| 339 | |
| 340 | // Returns true if layer tree updates are disabled. |
| 341 | virtual bool layerTreeStateIsFrozen() const { return false; } |
| 342 | virtual bool layerFlushThrottlingIsActive() const { return false; } |
| 343 | |
| 344 | virtual bool adjustLayerFlushThrottling(LayerFlushThrottleState::Flags) { return false; } |
| 345 | |
| 346 | virtual RefPtr<ScrollingCoordinator> createScrollingCoordinator(Page&) const { return nullptr; } |
| 347 | |
| 348 | #if PLATFORM(WIN) && USE(AVFOUNDATION) |
| 349 | virtual GraphicsDeviceAdapter* graphicsDeviceAdapter() const { return nullptr; } |
| 350 | #endif |
| 351 | |
| 352 | virtual bool supportsVideoFullscreen(HTMLMediaElementEnums::VideoFullscreenMode) { return false; } |
| 353 | virtual bool supportsVideoFullscreenStandby() { return false; } |
| 354 | |
| 355 | #if ENABLE(VIDEO) |
| 356 | virtual void enterVideoFullscreenForVideoElement(HTMLVideoElement&, HTMLMediaElementEnums::VideoFullscreenMode, bool standby) { UNUSED_PARAM(standby); } |
| 357 | virtual void setUpPlaybackControlsManager(HTMLMediaElement&) { } |
| 358 | virtual void clearPlaybackControlsManager() { } |
| 359 | #endif |
| 360 | |
| 361 | virtual void exitVideoFullscreenForVideoElement(HTMLVideoElement&) { } |
| 362 | virtual void exitVideoFullscreenToModeWithoutAnimation(HTMLVideoElement&, HTMLMediaElementEnums::VideoFullscreenMode) { } |
| 363 | virtual bool requiresFullscreenForVideoPlayback() { return false; } |
| 364 | |
| 365 | #if ENABLE(FULLSCREEN_API) |
| 366 | virtual bool supportsFullScreenForElement(const Element&, bool) { return false; } |
| 367 | virtual void enterFullScreenForElement(Element&) { } |
| 368 | virtual void exitFullScreenForElement(Element*) { } |
| 369 | virtual void setRootFullScreenLayer(GraphicsLayer*) { } |
| 370 | #endif |
| 371 | |
| 372 | #if USE(COORDINATED_GRAPHICS) |
| 373 | virtual IntRect visibleRectForTiledBackingStore() const { return IntRect(); } |
| 374 | #endif |
| 375 | |
| 376 | #if PLATFORM(COCOA) |
| 377 | virtual NSResponder *firstResponder() { return nullptr; } |
| 378 | virtual void makeFirstResponder(NSResponder *) { } |
| 379 | // Focuses on the containing view associated with this page. |
| 380 | virtual void makeFirstResponder() { } |
| 381 | virtual void assistiveTechnologyMakeFirstResponder() { } |
| 382 | #endif |
| 383 | |
| 384 | #if PLATFORM(IOS_FAMILY) |
| 385 | // FIXME: Come up with a more descriptive name for this function and make it platform independent (if possible). |
| 386 | virtual bool isStopping() = 0; |
| 387 | #endif |
| 388 | |
| 389 | virtual void enableSuddenTermination() { } |
| 390 | virtual void disableSuddenTermination() { } |
| 391 | |
| 392 | virtual void contentRuleListNotification(const URL&, const ContentRuleListResults&) { }; |
| 393 | |
| 394 | #if PLATFORM(WIN) |
| 395 | virtual void setLastSetCursorToCurrentCursor() = 0; |
| 396 | virtual void AXStartFrameLoad() = 0; |
| 397 | virtual void AXFinishFrameLoad() = 0; |
| 398 | #endif |
| 399 | |
| 400 | virtual bool selectItemWritingDirectionIsNatural() = 0; |
| 401 | virtual bool () = 0; |
| 402 | // Checks if there is an opened popup, called by RenderMenuList::showPopup(). |
| 403 | virtual RefPtr<PopupMenu> (PopupMenuClient&) const = 0; |
| 404 | virtual RefPtr<SearchPopupMenu> (PopupMenuClient&) const = 0; |
| 405 | |
| 406 | virtual void postAccessibilityNotification(AccessibilityObject&, AXObjectCache::AXNotification) { } |
| 407 | |
| 408 | virtual void notifyScrollerThumbIsVisibleInRect(const IntRect&) { } |
| 409 | virtual void recommendedScrollbarStyleDidChange(ScrollbarStyle) { } |
| 410 | |
| 411 | virtual Optional<ScrollbarOverlayStyle> preferredScrollbarOverlayStyle() { return WTF::nullopt; } |
| 412 | |
| 413 | virtual void wheelEventHandlersChanged(bool hasHandlers) = 0; |
| 414 | |
| 415 | virtual bool isSVGImageChromeClient() const { return false; } |
| 416 | |
| 417 | #if ENABLE(POINTER_LOCK) |
| 418 | virtual bool requestPointerLock() { return false; } |
| 419 | virtual void requestPointerUnlock() { } |
| 420 | #endif |
| 421 | |
| 422 | virtual FloatSize minimumWindowSize() const { return FloatSize(100, 100); }; |
| 423 | |
| 424 | virtual bool isEmptyChromeClient() const { return false; } |
| 425 | |
| 426 | virtual String plugInStartLabelTitle(const String& mimeType) const { UNUSED_PARAM(mimeType); return String(); } |
| 427 | virtual String plugInStartLabelSubtitle(const String& mimeType) const { UNUSED_PARAM(mimeType); return String(); } |
| 428 | virtual String () const { return String(); } |
| 429 | virtual String () const { return String(); } |
| 430 | |
| 431 | virtual void didAssociateFormControls(const Vector<RefPtr<Element>>&, Frame&) { }; |
| 432 | virtual bool shouldNotifyOnFormChanges() { return false; }; |
| 433 | |
| 434 | virtual void (GraphicsLayer&) { } |
| 435 | virtual void (GraphicsLayer&) { } |
| 436 | |
| 437 | virtual bool shouldUseTiledBackingForFrameView(const FrameView&) const { return false; } |
| 438 | |
| 439 | virtual void isPlayingMediaDidChange(MediaProducer::MediaStateFlags, uint64_t) { } |
| 440 | virtual void handleAutoplayEvent(AutoplayEvent, OptionSet<AutoplayEventFlags>) { } |
| 441 | |
| 442 | #if ENABLE(MEDIA_SESSION) |
| 443 | virtual void hasMediaSessionWithActiveMediaElementsDidChange(bool) { } |
| 444 | virtual void mediaSessionMetadataDidChange(const MediaSessionMetadata&) { } |
| 445 | virtual void focusedContentMediaElementDidChange(uint64_t) { } |
| 446 | #endif |
| 447 | |
| 448 | #if ENABLE(WEB_CRYPTO) |
| 449 | virtual bool wrapCryptoKey(const Vector<uint8_t>&, Vector<uint8_t>&) const { return false; } |
| 450 | virtual bool unwrapCryptoKey(const Vector<uint8_t>&, Vector<uint8_t>&) const { return false; } |
| 451 | #endif |
| 452 | |
| 453 | #if ENABLE(TELEPHONE_NUMBER_DETECTION) && PLATFORM(MAC) |
| 454 | virtual void handleTelephoneNumberClick(const String&, const IntPoint&) { } |
| 455 | #endif |
| 456 | |
| 457 | #if ENABLE(SERVICE_CONTROLS) |
| 458 | virtual void handleSelectionServiceClick(FrameSelection&, const Vector<String>&, const IntPoint&) { } |
| 459 | virtual bool hasRelevantSelectionServices(bool /*isTextOnly*/) const { return false; } |
| 460 | #endif |
| 461 | |
| 462 | virtual bool shouldDispatchFakeMouseMoveEvents() const { return true; } |
| 463 | |
| 464 | virtual void handleAutoFillButtonClick(HTMLInputElement&) { } |
| 465 | |
| 466 | virtual void inputElementDidResignStrongPasswordAppearance(HTMLInputElement&) { }; |
| 467 | |
| 468 | #if ENABLE(WIRELESS_PLAYBACK_TARGET) |
| 469 | virtual void addPlaybackTargetPickerClient(uint64_t /*contextId*/) { } |
| 470 | virtual void removePlaybackTargetPickerClient(uint64_t /*contextId*/) { } |
| 471 | virtual void showPlaybackTargetPicker(uint64_t /*contextId*/, const IntPoint&, bool /*isVideo*/) { } |
| 472 | virtual void playbackTargetPickerClientStateDidChange(uint64_t /*contextId*/, MediaProducer::MediaStateFlags) { } |
| 473 | virtual void setMockMediaPlaybackTargetPickerEnabled(bool) { } |
| 474 | virtual void setMockMediaPlaybackTargetPickerState(const String&, MediaPlaybackTargetContext::State) { } |
| 475 | #endif |
| 476 | |
| 477 | virtual void imageOrMediaDocumentSizeChanged(const IntSize&) { } |
| 478 | |
| 479 | #if ENABLE(VIDEO) && USE(GSTREAMER) |
| 480 | virtual void requestInstallMissingMediaPlugins(const String& /*details*/, const String& /*description*/, MediaPlayerRequestInstallMissingPluginsCallback&) { } |
| 481 | #endif |
| 482 | |
| 483 | virtual void didInvalidateDocumentMarkerRects() { } |
| 484 | |
| 485 | virtual void reportProcessCPUTime(Seconds, ActivityStateForCPUSampling) { } |
| 486 | virtual RefPtr<Icon> createIconForFiles(const Vector<String>& /* filenames */) = 0; |
| 487 | |
| 488 | #if ENABLE(RESOURCE_LOAD_STATISTICS) |
| 489 | virtual void hasStorageAccess(RegistrableDomain&& /*subFrameDomain*/, RegistrableDomain&& /*topFrameDomain*/, uint64_t /*frameID*/, uint64_t /*pageID*/, WTF::CompletionHandler<void(bool)>&& completionHandler) { completionHandler(false); } |
| 490 | virtual void requestStorageAccess(RegistrableDomain&& /*subFrameDomain*/, RegistrableDomain&& /*topFrameDomain*/, uint64_t /*frameID*/, uint64_t /*pageID*/, WTF::CompletionHandler<void(StorageAccessWasGranted, StorageAccessPromptWasShown)>&& completionHandler) { completionHandler(StorageAccessWasGranted::No, StorageAccessPromptWasShown::No); } |
| 491 | #endif |
| 492 | |
| 493 | #if ENABLE(DEVICE_ORIENTATION) |
| 494 | virtual void shouldAllowDeviceOrientationAndMotionAccess(Frame&, bool /* mayPrompt */, WTF::CompletionHandler<void(DeviceOrientationOrMotionPermissionState)>&& callback) { callback(DeviceOrientationOrMotionPermissionState::Denied); } |
| 495 | #endif |
| 496 | |
| 497 | virtual void (HTMLMenuElement&) { } |
| 498 | virtual void (HTMLMenuElement&) { } |
| 499 | virtual void (HTMLMenuItemElement&) { } |
| 500 | virtual void (HTMLMenuItemElement&) { } |
| 501 | |
| 502 | virtual String signedPublicKeyAndChallengeString(unsigned, const String&, const URL&) const { return emptyString(); } |
| 503 | |
| 504 | virtual void associateEditableImageWithAttachment(GraphicsLayer::EmbeddedViewID, const String&) { } |
| 505 | virtual void didCreateEditableImage(GraphicsLayer::EmbeddedViewID) { } |
| 506 | virtual void didDestroyEditableImage(GraphicsLayer::EmbeddedViewID) { } |
| 507 | |
| 508 | virtual void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel) { } |
| 509 | |
| 510 | virtual bool userIsInteracting() const { return false; } |
| 511 | virtual void setUserIsInteracting(bool) { } |
| 512 | |
| 513 | protected: |
| 514 | virtual ~ChromeClient() = default; |
| 515 | }; |
| 516 | |
| 517 | } // namespace WebCore |
| 518 | |