Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / public / web / WebFrameClient.h
blob0f7581069e62907f4952a9b50cf6526bca494aeb
1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #ifndef WebFrameClient_h
32 #define WebFrameClient_h
34 #include "../platform/WebColor.h"
35 #include "WebAXObject.h"
36 #include "WebDOMMessageEvent.h"
37 #include "WebDataSource.h"
38 #include "WebFrame.h"
39 #include "WebHistoryCommitType.h"
40 #include "WebHistoryItem.h"
41 #include "WebIconURL.h"
42 #include "WebNavigationPolicy.h"
43 #include "WebNavigationType.h"
44 #include "WebNavigatorContentUtilsClient.h"
45 #include "WebSandboxFlags.h"
46 #include "WebTextDirection.h"
47 #include "public/platform/WebCommon.h"
48 #include "public/platform/WebFileSystem.h"
49 #include "public/platform/WebFileSystemType.h"
50 #include "public/platform/WebSecurityOrigin.h"
51 #include "public/platform/WebStorageQuotaCallbacks.h"
52 #include "public/platform/WebStorageQuotaType.h"
53 #include "public/platform/WebURLError.h"
54 #include "public/platform/WebURLRequest.h"
55 #include <v8.h>
57 namespace blink {
59 enum class WebTreeScopeType;
60 class WebApplicationCacheHost;
61 class WebApplicationCacheHostClient;
62 class WebAppBannerClient;
63 class WebBluetooth;
64 class WebColorChooser;
65 class WebColorChooserClient;
66 class WebContentDecryptionModule;
67 class WebCookieJar;
68 class WebDataSource;
69 class WebEncryptedMediaClient;
70 class WebExternalPopupMenu;
71 class WebExternalPopupMenuClient;
72 class WebFormElement;
73 class WebGeolocationClient;
74 class WebMediaPlayer;
75 class WebMediaPlayerClient;
76 class WebMediaPlayerEncryptedMediaClient;
77 class WebMIDIClient;
78 class WebNotificationPermissionCallback;
79 class WebPermissionClient;
80 class WebServiceWorkerProvider;
81 class WebSocketHandle;
82 class WebPlugin;
83 class WebPresentationClient;
84 class WebPushClient;
85 class WebRTCPeerConnectionHandler;
86 class WebScreenOrientationClient;
87 class WebString;
88 class WebURL;
89 class WebURLResponse;
90 class WebUSBClient;
91 class WebUserMediaClient;
92 class WebVRClient;
93 class WebWakeLockClient;
94 class WebWorkerContentSettingsClientProxy;
95 struct WebColorSuggestion;
96 struct WebConsoleMessage;
97 struct WebContextMenuData;
98 struct WebPluginParams;
99 struct WebPopupMenuInfo;
100 struct WebRect;
101 struct WebURLError;
103 class WebFrameClient {
104 public:
105 // Factory methods -----------------------------------------------------
107 // May return null.
108 virtual WebPlugin* createPlugin(WebLocalFrame*, const WebPluginParams&) { return 0; }
110 // May return null.
111 // WebContentDecryptionModule* may be null if one has not yet been set.
112 virtual WebMediaPlayer* createMediaPlayer(WebLocalFrame*, const WebURL&, WebMediaPlayerClient*, WebMediaPlayerEncryptedMediaClient*, WebContentDecryptionModule*) { return 0; }
114 // May return null.
115 virtual WebApplicationCacheHost* createApplicationCacheHost(WebLocalFrame*, WebApplicationCacheHostClient*) { return 0; }
117 // May return null.
118 virtual WebServiceWorkerProvider* createServiceWorkerProvider(WebLocalFrame* frame) { return 0; }
120 // May return null.
121 virtual WebWorkerContentSettingsClientProxy* createWorkerContentSettingsClientProxy(WebLocalFrame* frame) { return 0; }
123 // Create a new WebPopupMenu. In the "createExternalPopupMenu" form, the
124 // client is responsible for rendering the contents of the popup menu.
125 virtual WebExternalPopupMenu* createExternalPopupMenu(
126 const WebPopupMenuInfo&, WebExternalPopupMenuClient*) { return 0; }
129 // Services ------------------------------------------------------------
131 // A frame specific cookie jar. May return null, in which case
132 // WebKitPlatformSupport::cookieJar() will be called to access cookies.
133 virtual WebCookieJar* cookieJar(WebLocalFrame*) { return 0; }
136 // General notifications -----------------------------------------------
138 // Indicates if creating a plugin without an associated renderer is supported.
139 virtual bool canCreatePluginWithoutRenderer(const WebString& mimeType) { return false; }
141 // Indicates that another page has accessed the DOM of the initial empty
142 // document of a main frame. After this, it is no longer safe to show a
143 // pending navigation's URL, because a URL spoof is possible.
144 virtual void didAccessInitialDocument(WebLocalFrame*) { }
146 // A child frame was created in this frame. This is called when the frame
147 // is created and initialized. Takes the name of the new frame, the parent
148 // frame and returns a new WebFrame. The WebFrame is considered in-use
149 // until frameDetached() is called on it.
150 // Note: If you override this, you should almost certainly be overriding
151 // frameDetached().
152 virtual WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const WebString& frameName, WebSandboxFlags sandboxFlags) { return nullptr; }
154 // This frame has set its opener to another frame, or disowned the opener
155 // if opener is null. See http://html.spec.whatwg.org/#dom-opener.
156 virtual void didChangeOpener(WebFrame*) { }
158 // Specifies the reason for the detachment.
159 enum class DetachType { Remove, Swap };
161 // This frame has been detached from the view, but has not been closed yet.
162 virtual void frameDetached(WebFrame*, DetachType) { }
164 // This frame has become focused..
165 virtual void frameFocused() { }
167 // This frame is about to be closed. This is called after frameDetached,
168 // when the document is being unloaded, due to new one committing.
169 virtual void willClose(WebFrame*) { }
171 // This frame's name has changed.
172 virtual void didChangeName(WebLocalFrame*, const WebString&) { }
174 // The sandbox flags have changed for a child frame of this frame.
175 virtual void didChangeSandboxFlags(WebFrame* childFrame, WebSandboxFlags flags) { }
177 // Called when a watched CSS selector matches or stops matching.
178 virtual void didMatchCSS(WebLocalFrame*, const WebVector<WebString>& newlyMatchingSelectors, const WebVector<WebString>& stoppedMatchingSelectors) { }
181 // Console messages ----------------------------------------------------
183 // Whether or not we should report a detailed message for the given source.
184 virtual bool shouldReportDetailedMessageForSource(const WebString& source) { return false; }
186 // A new message was added to the console.
187 virtual void didAddMessageToConsole(const WebConsoleMessage&, const WebString& sourceName, unsigned sourceLine, const WebString& stackTrace) { }
190 // Load commands -------------------------------------------------------
192 // The client should handle the navigation externally.
193 virtual void loadURLExternally(
194 WebLocalFrame*, const WebURLRequest&, WebNavigationPolicy, const WebString& downloadName) { }
197 // Navigational queries ------------------------------------------------
199 // The client may choose to alter the navigation policy. Otherwise,
200 // defaultPolicy should just be returned.
202 struct NavigationPolicyInfo {
203 WebLocalFrame* frame;
204 WebDataSource::ExtraData* extraData;
206 // Note: if browser side navigations are enabled, the client may modify
207 // the urlRequest. However, should this happen, the client should change
208 // the WebNavigationPolicy to WebNavigationPolicyIgnore, and the load
209 // should stop in blink. In all other cases, the urlRequest should not
210 // be modified.
211 WebURLRequest& urlRequest;
212 WebNavigationType navigationType;
213 WebNavigationPolicy defaultPolicy;
214 bool isRedirect;
216 NavigationPolicyInfo(WebURLRequest& urlRequest)
217 : frame(0)
218 , extraData(0)
219 , urlRequest(urlRequest)
220 , navigationType(WebNavigationTypeOther)
221 , defaultPolicy(WebNavigationPolicyIgnore)
222 , isRedirect(false) { }
225 virtual WebNavigationPolicy decidePolicyForNavigation(const NavigationPolicyInfo& info)
227 return decidePolicyForNavigation(info.frame, info.extraData, info.urlRequest, info.navigationType, info.defaultPolicy, info.isRedirect);
230 // DEPRECATED
231 virtual WebNavigationPolicy decidePolicyForNavigation(
232 WebLocalFrame*, WebDataSource::ExtraData*, const WebURLRequest&, WebNavigationType,
233 WebNavigationPolicy defaultPolicy, bool isRedirect) { return defaultPolicy; }
235 // During a history navigation, we may choose to load new subframes from history as well.
236 // This returns such a history item if appropriate.
237 virtual WebHistoryItem historyItemForNewChildFrame(WebFrame*) { return WebHistoryItem(); }
240 // Navigational notifications ------------------------------------------
242 // These notifications bracket any loading that occurs in the WebFrame.
243 virtual void didStartLoading(bool toDifferentDocument) { }
244 virtual void didStopLoading() { }
246 // Notification that some progress was made loading the current frame.
247 // loadProgress is a value between 0 (nothing loaded) and 1.0 (frame fully
248 // loaded).
249 virtual void didChangeLoadProgress(double loadProgress) { }
251 // A form submission has been requested, but the page's submit event handler
252 // hasn't yet had a chance to run (and possibly alter/interrupt the submit.)
253 virtual void willSendSubmitEvent(WebLocalFrame*, const WebFormElement&) { }
255 // A form submission is about to occur.
256 virtual void willSubmitForm(WebLocalFrame*, const WebFormElement&) { }
258 // A datasource has been created for a new navigation. The given
259 // datasource will become the provisional datasource for the frame.
260 virtual void didCreateDataSource(WebLocalFrame*, WebDataSource*) { }
262 // A new provisional load has been started.
263 virtual void didStartProvisionalLoad(WebLocalFrame* localFrame, double triggeringEventTime) { }
265 // The provisional load was redirected via a HTTP 3xx response.
266 virtual void didReceiveServerRedirectForProvisionalLoad(WebLocalFrame*) { }
268 // The provisional load failed. The WebHistoryCommitType is the commit type
269 // that would have been used had the load succeeded.
270 virtual void didFailProvisionalLoad(WebLocalFrame*, const WebURLError&, WebHistoryCommitType) { }
272 // The provisional datasource is now committed. The first part of the
273 // response body has been received, and the encoding of the response
274 // body is known.
275 virtual void didCommitProvisionalLoad(WebLocalFrame*, const WebHistoryItem&, WebHistoryCommitType) { }
277 // The frame's document has just been initialized.
278 virtual void didCreateNewDocument(WebLocalFrame* frame) { }
280 // The window object for the frame has been cleared of any extra
281 // properties that may have been set by script from the previously
282 // loaded document.
283 virtual void didClearWindowObject(WebLocalFrame* frame) { }
285 // The document element has been created.
286 virtual void didCreateDocumentElement(WebLocalFrame*) { }
288 // The page title is available.
289 virtual void didReceiveTitle(WebLocalFrame* frame, const WebString& title, WebTextDirection direction) { }
291 // The icon for the page have changed.
292 virtual void didChangeIcon(WebLocalFrame*, WebIconURL::Type) { }
294 // The frame's document finished loading.
295 virtual void didFinishDocumentLoad(WebLocalFrame*, bool documentIsEmpty) { }
297 // The 'load' event was dispatched.
298 virtual void didHandleOnloadEvents(WebLocalFrame*) { }
300 // The frame's document or one of its subresources failed to load. The
301 // WebHistoryCommitType is the commit type that would have been used had the
302 // load succeeded.
303 virtual void didFailLoad(WebLocalFrame*, const WebURLError&, WebHistoryCommitType) { }
305 // The frame's document and all of its subresources succeeded to load.
306 virtual void didFinishLoad(WebLocalFrame*) { }
308 // The navigation resulted in no change to the documents within the page.
309 // For example, the navigation may have just resulted in scrolling to a
310 // named anchor or a PopState event may have been dispatched.
311 virtual void didNavigateWithinPage(WebLocalFrame*, const WebHistoryItem&, WebHistoryCommitType) { }
313 // Called upon update to scroll position, document state, and other
314 // non-navigational events related to the data held by WebHistoryItem.
315 // WARNING: This method may be called very frequently.
316 virtual void didUpdateCurrentHistoryItem(WebLocalFrame*) { }
318 // The frame's manifest has changed.
319 virtual void didChangeManifest(WebLocalFrame*) { }
321 // The frame's theme color has changed.
322 virtual void didChangeThemeColor() { }
324 // Called to dispatch a load event for this frame in the FrameOwner of an
325 // out-of-process parent frame.
326 virtual void dispatchLoad() { }
328 // Web Notifications ---------------------------------------------------
330 // Requests permission to display platform notifications on the origin of this frame.
331 virtual void requestNotificationPermission(const WebSecurityOrigin&, WebNotificationPermissionCallback* callback) { }
334 // Push API ---------------------------------------------------
336 // Used to access the embedder for the Push API.
337 virtual WebPushClient* pushClient() { return 0; }
340 // Presentation API ----------------------------------------------------
342 // Used to access the embedder for the Presentation API.
343 virtual WebPresentationClient* presentationClient() { return 0; }
346 // Editing -------------------------------------------------------------
348 // These methods allow the client to intercept and overrule editing
349 // operations.
350 virtual void didChangeSelection(bool isSelectionEmpty) { }
353 // Dialogs -------------------------------------------------------------
355 // This method opens the color chooser and returns a new WebColorChooser
356 // instance. If there is a WebColorChooser already from the last time this
357 // was called, it ends the color chooser by calling endChooser, and replaces
358 // it with the new one. The given list of suggestions can be used to show a
359 // simple interface with a limited set of choices.
361 virtual WebColorChooser* createColorChooser(
362 WebColorChooserClient*,
363 const WebColor&,
364 const WebVector<WebColorSuggestion>&) { return 0; }
366 // Displays a modal alert dialog containing the given message. Returns
367 // once the user dismisses the dialog.
368 virtual void runModalAlertDialog(const WebString& message) { }
370 // Displays a modal confirmation dialog with the given message as
371 // description and OK/Cancel choices. Returns true if the user selects
372 // 'OK' or false otherwise.
373 virtual bool runModalConfirmDialog(const WebString& message) { return false; }
375 // Displays a modal input dialog with the given message as description
376 // and OK/Cancel choices. The input field is pre-filled with
377 // defaultValue. Returns true if the user selects 'OK' or false
378 // otherwise. Upon returning true, actualValue contains the value of
379 // the input field.
380 virtual bool runModalPromptDialog(
381 const WebString& message, const WebString& defaultValue,
382 WebString* actualValue) { return false; }
384 // Displays a modal confirmation dialog containing the given message as
385 // description and OK/Cancel choices, where 'OK' means that it is okay
386 // to proceed with closing the view. Returns true if the user selects
387 // 'OK' or false otherwise.
388 virtual bool runModalBeforeUnloadDialog(
389 bool isReload, const WebString& message) { return true; }
392 // UI ------------------------------------------------------------------
394 // Shows a context menu with commands relevant to a specific element on
395 // the given frame. Additional context data is supplied.
396 virtual void showContextMenu(const WebContextMenuData&) { }
398 // Called when the data attached to the currently displayed context menu is
399 // invalidated. The context menu may be closed if possible.
400 virtual void clearContextMenu() { }
403 // Low-level resource notifications ------------------------------------
405 // A request is about to be sent out, and the client may modify it. Request
406 // is writable, and changes to the URL, for example, will change the request
407 // made. If this request is the result of a redirect, then redirectResponse
408 // will be non-null and contain the response that triggered the redirect.
409 virtual void willSendRequest(
410 WebLocalFrame*, unsigned identifier, WebURLRequest&,
411 const WebURLResponse& redirectResponse) { }
413 // Response headers have been received for the resource request given
414 // by identifier.
415 virtual void didReceiveResponse(
416 WebLocalFrame*, unsigned identifier, const WebURLResponse&) { }
418 virtual void didChangeResourcePriority(
419 WebLocalFrame* webFrame, unsigned identifier, const WebURLRequest::Priority& priority, int) { }
421 // The resource request given by identifier succeeded.
422 virtual void didFinishResourceLoad(
423 WebLocalFrame*, unsigned identifier) { }
425 // The specified request was satified from WebCore's memory cache.
426 virtual void didLoadResourceFromMemoryCache(
427 WebLocalFrame*, const WebURLRequest&, const WebURLResponse&) { }
429 // This frame has displayed inactive content (such as an image) from an
430 // insecure source. Inactive content cannot spread to other frames.
431 virtual void didDisplayInsecureContent(WebLocalFrame*) { }
433 // The indicated security origin has run active content (such as a
434 // script) from an insecure source. Note that the insecure content can
435 // spread to other frames in the same origin.
436 virtual void didRunInsecureContent(WebLocalFrame*, const WebSecurityOrigin&, const WebURL& insecureURL) { }
438 // A reflected XSS was encountered in the page and suppressed.
439 virtual void didDetectXSS(WebLocalFrame*, const WebURL&, bool didBlockEntirePage) { }
441 // A PingLoader was created, and a request dispatched to a URL.
442 virtual void didDispatchPingLoader(WebLocalFrame*, const WebURL&) { }
444 // A performance timing event (e.g. first paint) occurred
445 virtual void didChangePerformanceTiming() { }
447 // The loaders in this frame have been stopped.
448 virtual void didAbortLoading(WebLocalFrame*) { }
451 // Script notifications ------------------------------------------------
453 // Notifies that a new script context has been created for this frame.
454 // This is similar to didClearWindowObject but only called once per
455 // frame context.
456 virtual void didCreateScriptContext(WebLocalFrame*, v8::Local<v8::Context>, int extensionGroup, int worldId) { }
458 // WebKit is about to release its reference to a v8 context for a frame.
459 virtual void willReleaseScriptContext(WebLocalFrame*, v8::Local<v8::Context>, int worldId) { }
462 // Geometry notifications ----------------------------------------------
464 // The main frame scrolled.
465 virtual void didChangeScrollOffset(WebLocalFrame*) { }
467 // If the frame is loading an HTML document, this will be called to
468 // notify that the <body> will be attached soon.
469 virtual void willInsertBody(WebLocalFrame*) { }
472 // Find-in-page notifications ------------------------------------------
474 // Notifies how many matches have been found so far, for a given
475 // identifier. |finalUpdate| specifies whether this is the last update
476 // (all frames have completed scoping).
477 virtual void reportFindInPageMatchCount(
478 int identifier, int count, bool finalUpdate) { }
480 // Notifies what tick-mark rect is currently selected. The given
481 // identifier lets the client know which request this message belongs
482 // to, so that it can choose to ignore the message if it has moved on
483 // to other things. The selection rect is expected to have coordinates
484 // relative to the top left corner of the web page area and represent
485 // where on the screen the selection rect is currently located.
486 virtual void reportFindInPageSelection(
487 int identifier, int activeMatchOrdinal, const WebRect& selection) { }
490 // Quota ---------------------------------------------------------
492 // Requests a new quota size for the origin's storage.
493 // |newQuotaInBytes| indicates how much storage space (in bytes) the
494 // caller expects to need.
495 // WebStorageQuotaCallbacks::didGrantStorageQuota will be called when
496 // a new quota is granted. WebStorageQuotaCallbacks::didFail
497 // is called with an error code otherwise.
498 // Note that the requesting quota size may not always be granted and
499 // a smaller amount of quota than requested might be returned.
500 virtual void requestStorageQuota(
501 WebLocalFrame*, WebStorageQuotaType,
502 unsigned long long newQuotaInBytes,
503 WebStorageQuotaCallbacks) { }
505 // WebSocket -----------------------------------------------------
507 // A WebSocket object is going to open a new WebSocket connection.
508 virtual void willOpenWebSocket(WebSocketHandle*) { }
510 // Wake Lock -----------------------------------------------------
512 virtual WebWakeLockClient* wakeLockClient() { return 0; }
514 // Geolocation ---------------------------------------------------------
516 // Access the embedder API for (client-based) geolocation client .
517 virtual WebGeolocationClient* geolocationClient() { return 0; }
520 // MediaStream -----------------------------------------------------
522 // A new WebRTCPeerConnectionHandler is created.
523 virtual void willStartUsingPeerConnectionHandler(WebLocalFrame*, WebRTCPeerConnectionHandler*) { }
525 virtual WebUserMediaClient* userMediaClient() { return 0; }
528 // Encrypted Media -------------------------------------------------
530 virtual WebEncryptedMediaClient* encryptedMediaClient() { return 0; }
533 // Web MIDI -------------------------------------------------------------
535 virtual WebMIDIClient* webMIDIClient() { return 0; }
538 // Messages ------------------------------------------------------
540 // Notifies the embedder that a postMessage was issued on this frame, and
541 // gives the embedder a chance to handle it instead of WebKit. Returns true
542 // if the embedder handled it.
543 virtual bool willCheckAndDispatchMessageEvent(
544 WebLocalFrame* sourceFrame,
545 WebFrame* targetFrame,
546 WebSecurityOrigin target,
547 WebDOMMessageEvent event) { return false; }
549 // Asks the embedder if a specific user agent should be used for the given
550 // URL. Non-empty strings indicate an override should be used. Otherwise,
551 // Platform::current()->userAgent() will be called to provide one.
552 virtual WebString userAgentOverride(WebLocalFrame*, const WebURL& url) { return WebString(); }
554 // Asks the embedder what value the network stack will send for the DNT
555 // header. An empty string indicates that no DNT header will be send.
556 virtual WebString doNotTrackValue(WebLocalFrame*) { return WebString(); }
559 // WebGL ------------------------------------------------------
561 // Asks the embedder whether WebGL is allowed for the given WebFrame.
562 // This call is placed here instead of WebContentSettingsClient because this
563 // class is implemented in content/, and putting it here avoids adding
564 // more public content/ APIs.
565 virtual bool allowWebGL(WebLocalFrame*, bool defaultValue) { return defaultValue; }
567 // Notifies the client that a WebGL context was lost on this page with the
568 // given reason (one of the GL_ARB_robustness status codes; see
569 // Extensions3D.h in WebCore/platform/graphics).
570 virtual void didLoseWebGLContext(WebLocalFrame*, int) { }
573 // Screen Orientation --------------------------------------------------
575 // Access the embedder API for (client-based) screen orientation client .
576 virtual WebScreenOrientationClient* webScreenOrientationClient() { return 0; }
579 // Accessibility -------------------------------------------------------
581 // Notifies embedder about an accessibility event.
582 virtual void postAccessibilityEvent(const WebAXObject&, WebAXEvent) { }
584 // Provides accessibility information about a find in page result.
585 virtual void handleAccessibilityFindInPageResult(
586 int identifier,
587 int matchIndex,
588 const WebAXObject& startObject,
589 int startOffset,
590 const WebAXObject& endObject,
591 int endOffset) { }
594 // ServiceWorker -------------------------------------------------------
596 // Whether the document associated with WebDataSource is controlled by the
597 // ServiceWorker.
598 virtual bool isControlledByServiceWorker(WebDataSource&) { return false; }
600 // Returns an identifier of the service worker controlling the document
601 // associated with the WebDataSource.
602 virtual int64_t serviceWorkerID(WebDataSource&) { return -1; }
605 // Fullscreen ----------------------------------------------------------
607 // Called to enter/exit fullscreen mode.
608 // After calling enterFullscreen, WebWidget::{will,Did}EnterFullScreen
609 // should bound resizing the WebWidget into fullscreen mode.
610 // Similarly, when exitFullScreen is called,
611 // WebWidget::{will,Did}ExitFullScreen should bound resizing the WebWidget
612 // out of fullscreen mode.
613 // Note: the return value is ignored.
614 virtual bool enterFullscreen() { return false; }
615 virtual bool exitFullscreen() { return false; }
618 // Sudden termination --------------------------------------------------
620 // Called when elements preventing the sudden termination of the frame
621 // become present or stop being present. |type| is the type of element
622 // (BeforeUnload handler, Unload handler).
623 enum SuddenTerminationDisablerType {
624 BeforeUnloadHandler,
625 UnloadHandler,
627 virtual void suddenTerminationDisablerChanged(bool present, SuddenTerminationDisablerType) { }
630 // Permissions ---------------------------------------------------------
632 // Access the embedder API for permission client.
633 virtual WebPermissionClient* permissionClient() { return 0; }
635 // Virtual Reality -----------------------------------------------------
637 // Access the embedder API for virtual reality client.
638 virtual WebVRClient* webVRClient() { return 0; }
640 // App Banners ---------------------------------------------------------
641 virtual WebAppBannerClient* appBannerClient() { return 0; }
643 // Navigator Content Utils --------------------------------------------
645 // Registers a new URL handler for the given protocol.
646 virtual void registerProtocolHandler(const WebString& scheme,
647 const WebURL& url,
648 const WebString& title) { }
650 // Unregisters a given URL handler for the given protocol.
651 virtual void unregisterProtocolHandler(const WebString& scheme, const WebURL& url) { }
653 // Check if a given URL handler is registered for the given protocol.
654 virtual WebCustomHandlersState isProtocolHandlerRegistered(const WebString& scheme, const WebURL& url)
656 return WebCustomHandlersNew;
659 // Bluetooth -----------------------------------------------------------
660 virtual WebBluetooth* bluetooth() { return 0; }
662 // WebUSB --------------------------------------------------------------
663 virtual WebUSBClient* usbClient() { return nullptr; }
665 protected:
666 virtual ~WebFrameClient() { }
669 } // namespace blink
671 #endif