1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
|
/*
* Copyright (C) 2006 Eric Seidel (eric@webkit.org)
* Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
* Copyright (C) 2012 Samsung Electronics. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef EmptyClients_h
#define EmptyClients_h
#include "ChromeClient.h"
#include "ContextMenuClient.h"
#include "DeviceMotionClient.h"
#include "DeviceOrientationClient.h"
#include "DragClient.h"
#include "EditorClient.h"
#include "TextCheckerClient.h"
#include "FloatRect.h"
#include "FocusDirection.h"
#include "FrameLoaderClient.h"
#include "InspectorClient.h"
#include "Page.h"
#include "ResourceError.h"
#if USE(V8)
#include <v8.h>
#endif
/*
This file holds empty Client stubs for use by WebCore.
Viewless element needs to create a dummy Page->Frame->FrameView tree for use in parsing or executing JavaScript.
This tree depends heavily on Clients (usually provided by WebKit classes).
This file was first created for SVGImage as it had no way to access the current Page (nor should it,
since Images are not tied to a page).
See http://bugs.webkit.org/show_bug.cgi?id=5971 for the original discussion about this file.
Ideally, whenever you change a Client class, you should add a stub here.
Brittle, yes. Unfortunate, yes. Hopefully temporary.
*/
namespace WebCore {
class GraphicsContext3D;
class EmptyChromeClient : public ChromeClient {
public:
virtual ~EmptyChromeClient() { }
virtual void chromeDestroyed() { }
virtual void* webView() const { return 0; }
virtual void setWindowRect(const FloatRect&) { }
virtual FloatRect windowRect() { return FloatRect(); }
virtual FloatRect pageRect() { return FloatRect(); }
virtual void focus() { }
virtual void unfocus() { }
virtual bool canTakeFocus(FocusDirection) { return false; }
virtual void takeFocus(FocusDirection) { }
virtual void focusedNodeChanged(Node*) { }
virtual void focusedFrameChanged(Frame*) { }
virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&) { return 0; }
virtual void show() { }
virtual bool canRunModal() { return false; }
virtual void runModal() { }
virtual void setToolbarsVisible(bool) { }
virtual bool toolbarsVisible() { return false; }
virtual void setStatusbarVisible(bool) { }
virtual bool statusbarVisible() { return false; }
virtual void setScrollbarsVisible(bool) { }
virtual bool scrollbarsVisible() { return false; }
virtual void setMenubarVisible(bool) { }
virtual bool menubarVisible() { return false; }
virtual void setResizable(bool) { }
virtual void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String&, unsigned, const String&) { }
virtual bool canRunBeforeUnloadConfirmPanel() { return false; }
virtual bool runBeforeUnloadConfirmPanel(const String&, Frame*) { return true; }
virtual void closeWindowSoon() { }
virtual void runJavaScriptAlert(Frame*, const String&) { }
virtual bool runJavaScriptConfirm(Frame*, const String&) { return false; }
virtual bool runJavaScriptPrompt(Frame*, const String&, const String&, String&) { return false; }
virtual bool shouldInterruptJavaScript() { return false; }
virtual bool selectItemWritingDirectionIsNatural() { return false; }
virtual bool selectItemAlignmentFollowsMenuWritingDirection() { return false; }
virtual bool hasOpenedPopup() const OVERRIDE { return false; }
virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const OVERRIDE;
virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const OVERRIDE;
#if ENABLE(PAGE_POPUP)
virtual PagePopup* openPagePopup(PagePopupClient*, const IntRect&) OVERRIDE { return 0; }
virtual void closePagePopup(PagePopup*) OVERRIDE { }
virtual void setPagePopupDriver(PagePopupDriver*) OVERRIDE { }
virtual void resetPagePopupDriver() OVERRIDE { }
#endif
virtual void setStatusbarText(const String&) { }
virtual KeyboardUIMode keyboardUIMode() { return KeyboardAccessDefault; }
virtual IntRect windowResizerRect() const { return IntRect(); }
virtual void invalidateRootView(const IntRect&, bool) OVERRIDE { }
virtual void invalidateContentsAndRootView(const IntRect&, bool) OVERRIDE { }
virtual void invalidateContentsForSlowScroll(const IntRect&, bool) OVERRIDE { }
virtual void scroll(const IntSize&, const IntRect&, const IntRect&) { }
#if USE(TILED_BACKING_STORE)
virtual void delegatedScrollRequested(const IntPoint&) { }
#endif
#if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER)
virtual void scheduleAnimation() { }
#endif
virtual IntPoint screenToRootView(const IntPoint& p) const OVERRIDE { return p; }
virtual IntRect rootViewToScreen(const IntRect& r) const OVERRIDE { return r; }
virtual PlatformPageClient platformPageClient() const { return 0; }
virtual void contentsSizeChanged(Frame*, const IntSize&) const { }
virtual void scrollbarsModeDidChange() const { }
virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned) { }
virtual void setToolTip(const String&, TextDirection) { }
virtual void print(Frame*) { }
#if ENABLE(SQL_DATABASE)
virtual void exceededDatabaseQuota(Frame*, const String&) { }
#endif
virtual void reachedMaxAppCacheSize(int64_t) { }
virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*, int64_t) { }
#if ENABLE(DIRECTORY_UPLOAD)
virtual void enumerateChosenDirectory(FileChooser*) { }
#endif
#if ENABLE(INPUT_TYPE_COLOR)
virtual PassOwnPtr<ColorChooser> createColorChooser(ColorChooserClient*, const Color&) OVERRIDE;
#endif
virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>) OVERRIDE;
virtual void loadIconForFiles(const Vector<String>&, FileIconLoader*) { }
virtual void formStateDidChange(const Node*) { }
virtual void elementDidFocus(const Node*) { }
virtual void elementDidBlur(const Node*) { }
virtual void setCursor(const Cursor&) { }
virtual void setCursorHiddenUntilMouseMoves(bool) { }
virtual void scrollRectIntoView(const IntRect&) const { }
#if USE(ACCELERATED_COMPOSITING)
virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*) {}
virtual void setNeedsOneShotDrawingSynchronization() {}
virtual void scheduleCompositingLayerSync() {}
#endif
#if PLATFORM(WIN)
virtual void setLastSetCursorToCurrentCursor() { }
#endif
#if ENABLE(TOUCH_EVENTS)
virtual void needTouchEvents(bool) { }
#endif
virtual void numWheelEventHandlersChanged(unsigned) OVERRIDE { }
virtual void numTouchEventHandlersChanged(unsigned) OVERRIDE { }
virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const { return false; }
};
class EmptyFrameLoaderClient : public FrameLoaderClient {
WTF_MAKE_NONCOPYABLE(EmptyFrameLoaderClient); WTF_MAKE_FAST_ALLOCATED;
public:
EmptyFrameLoaderClient() { }
virtual ~EmptyFrameLoaderClient() { }
virtual void frameLoaderDestroyed() { }
virtual bool hasWebView() const { return true; } // mainly for assertions
virtual void makeRepresentation(DocumentLoader*) { }
virtual void forceLayout() { }
virtual void forceLayoutForNonHTML() { }
virtual void setCopiesOnScroll() { }
virtual void detachedFromParent2() { }
virtual void detachedFromParent3() { }
virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceResponse&) { }
virtual void assignIdentifierToInitialRequest(unsigned long, DocumentLoader*, const ResourceRequest&) { }
virtual bool shouldUseCredentialStorage(DocumentLoader*, unsigned long) { return false; }
virtual void dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest&, const ResourceResponse&) { }
virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&) { }
virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&) { }
#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
virtual bool canAuthenticateAgainstProtectionSpace(DocumentLoader*, unsigned long, const ProtectionSpace&) { return false; }
#endif
virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long, const ResourceResponse&) { }
virtual void dispatchDidReceiveContentLength(DocumentLoader*, unsigned long, int) { }
virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long) { }
virtual void dispatchDidFailLoading(DocumentLoader*, unsigned long, const ResourceError&) { }
virtual bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int) { return false; }
virtual void dispatchDidHandleOnloadEvents() { }
virtual void dispatchDidReceiveServerRedirectForProvisionalLoad() { }
virtual void dispatchDidCancelClientRedirect() { }
virtual void dispatchWillPerformClientRedirect(const KURL&, double, double) { }
virtual void dispatchDidChangeLocationWithinPage() { }
virtual void dispatchDidPushStateWithinPage() { }
virtual void dispatchDidReplaceStateWithinPage() { }
virtual void dispatchDidPopStateWithinPage() { }
virtual void dispatchWillClose() { }
virtual void dispatchDidReceiveIcon() { }
virtual void dispatchDidStartProvisionalLoad() { }
virtual void dispatchDidReceiveTitle(const StringWithDirection&) { }
virtual void dispatchDidChangeIcons(IconType) { }
virtual void dispatchDidCommitLoad() { }
virtual void dispatchDidFailProvisionalLoad(const ResourceError&) { }
virtual void dispatchDidFailLoad(const ResourceError&) { }
virtual void dispatchDidFinishDocumentLoad() { }
virtual void dispatchDidFinishLoad() { }
virtual void dispatchDidFirstLayout() { }
virtual void dispatchDidFirstVisuallyNonEmptyLayout() { }
virtual void dispatchDidNewFirstVisuallyNonEmptyLayout() { }
virtual Frame* dispatchCreatePage(const NavigationAction&) { return 0; }
virtual void dispatchShow() { }
virtual void dispatchDecidePolicyForResponse(FramePolicyFunction, const ResourceResponse&, const ResourceRequest&) { }
virtual void dispatchDecidePolicyForNewWindowAction(FramePolicyFunction, const NavigationAction&, const ResourceRequest&, PassRefPtr<FormState>, const String&) OVERRIDE;
virtual void dispatchDecidePolicyForNavigationAction(FramePolicyFunction, const NavigationAction&, const ResourceRequest&, PassRefPtr<FormState>) OVERRIDE;
virtual void cancelPolicyCheck() { }
virtual void dispatchUnableToImplementPolicy(const ResourceError&) { }
virtual void dispatchWillSendSubmitEvent(PassRefPtr<FormState>) OVERRIDE;
virtual void dispatchWillSubmitForm(FramePolicyFunction, PassRefPtr<FormState>) OVERRIDE;
virtual void revertToProvisionalState(DocumentLoader*) { }
virtual void setMainDocumentError(DocumentLoader*, const ResourceError&) { }
virtual void willChangeEstimatedProgress() { }
virtual void didChangeEstimatedProgress() { }
virtual void postProgressStartedNotification() { }
virtual void postProgressEstimateChangedNotification() { }
virtual void postProgressFinishedNotification() { }
virtual void setMainFrameDocumentReady(bool) { }
virtual void startDownload(const ResourceRequest&, const String& suggestedName = String()) { UNUSED_PARAM(suggestedName); }
virtual void willChangeTitle(DocumentLoader*) { }
virtual void didChangeTitle(DocumentLoader*) { }
virtual void committedLoad(DocumentLoader*, const char*, int) { }
virtual void finishedLoading(DocumentLoader*) { }
virtual ResourceError cancelledError(const ResourceRequest&) { ResourceError error("", 0, "", ""); error.setIsCancellation(true); return error; }
virtual ResourceError blockedError(const ResourceRequest&) { return ResourceError("", 0, "", ""); }
virtual ResourceError cannotShowURLError(const ResourceRequest&) { return ResourceError("", 0, "", ""); }
virtual ResourceError interruptedForPolicyChangeError(const ResourceRequest&) { return ResourceError("", 0, "", ""); }
virtual ResourceError cannotShowMIMETypeError(const ResourceResponse&) { return ResourceError("", 0, "", ""); }
virtual ResourceError fileDoesNotExistError(const ResourceResponse&) { return ResourceError("", 0, "", ""); }
virtual ResourceError pluginWillHandleLoadError(const ResourceResponse&) { return ResourceError("", 0, "", ""); }
virtual bool shouldFallBack(const ResourceError&) { return false; }
virtual bool canHandleRequest(const ResourceRequest&) const { return false; }
virtual bool canShowMIMEType(const String&) const { return false; }
virtual bool canShowMIMETypeAsHTML(const String&) const { return false; }
virtual bool representationExistsForURLScheme(const String&) const { return false; }
virtual String generatedMIMETypeForURLScheme(const String&) const { return ""; }
virtual void frameLoadCompleted() { }
virtual void restoreViewState() { }
virtual void provisionalLoadStarted() { }
virtual bool shouldTreatURLAsSameAsCurrent(const KURL&) const { return false; }
virtual void didFinishLoad() { }
virtual void prepareForDataSourceReplacement() { }
virtual PassRefPtr<DocumentLoader> createDocumentLoader(const ResourceRequest&, const SubstituteData&) OVERRIDE;
virtual void setTitle(const StringWithDirection&, const KURL&) { }
virtual String userAgent(const KURL&) { return ""; }
virtual void savePlatformDataToCachedFrame(CachedFrame*) { }
virtual void transitionToCommittedFromCachedFrame(CachedFrame*) { }
virtual void transitionToCommittedForNewPage() { }
virtual void didSaveToPageCache() { }
virtual void didRestoreFromPageCache() { }
virtual void dispatchDidBecomeFrameset(bool) { }
virtual void updateGlobalHistory() { }
virtual void updateGlobalHistoryRedirectLinks() { }
virtual bool shouldGoToHistoryItem(HistoryItem*) const { return false; }
virtual bool shouldStopLoadingForHistoryItem(HistoryItem*) const { return false; }
virtual void updateGlobalHistoryItemForPage() { }
virtual void saveViewStateToItem(HistoryItem*) { }
virtual bool canCachePage() const { return false; }
virtual void didDisplayInsecureContent() { }
virtual void didRunInsecureContent(SecurityOrigin*, const KURL&) { }
virtual void didDetectXSS(const KURL&, bool) { }
virtual PassRefPtr<Frame> createFrame(const KURL&, const String&, HTMLFrameOwnerElement*, const String&, bool, int, int) OVERRIDE;
virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool) OVERRIDE;
virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&, const Vector<String>&, const Vector<String>&) OVERRIDE;
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
virtual PassRefPtr<Widget> createMediaPlayerProxyPlugin(const IntSize&, HTMLMediaElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&) OVERRIDE;
virtual void hideMediaPlayerProxyPlugin(Widget*) { }
virtual void showMediaPlayerProxyPlugin(Widget*) { }
#endif
virtual ObjectContentType objectContentType(const KURL&, const String&, bool) { return ObjectContentType(); }
virtual String overrideMediaType() const { return String(); }
virtual void redirectDataToPlugin(Widget*) { }
virtual void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*) { }
virtual void documentElementAvailable() { }
virtual void didPerformFirstNavigation() const { }
virtual void registerForIconNotification(bool) { }
#if USE(V8)
virtual void didCreateScriptContext(v8::Handle<v8::Context>, int extensionGroup, int worldId) { }
virtual void willReleaseScriptContext(v8::Handle<v8::Context>, int worldId) { }
virtual bool allowScriptExtension(const String& extensionName, int extensionGroup, int worldId) { return false; }
#endif
#if PLATFORM(MAC)
virtual RemoteAXObjectRef accessibilityRemoteObject() { return 0; }
virtual NSCachedURLResponse* willCacheResponse(DocumentLoader*, unsigned long, NSCachedURLResponse* response) const { return response; }
#endif
#if PLATFORM(WIN) && USE(CFNETWORK)
// FIXME: Windows should use willCacheResponse - <https://bugs.webkit.org/show_bug.cgi?id=57257>.
virtual bool shouldCacheResponse(DocumentLoader*, unsigned long, const ResourceResponse&, const unsigned char*, unsigned long long) { return true; }
#endif
virtual PassRefPtr<FrameNetworkingContext> createNetworkingContext() OVERRIDE;
#if ENABLE(WEB_INTENTS)
virtual void dispatchIntent(PassRefPtr<IntentRequest>) OVERRIDE;
#endif
};
class EmptyTextCheckerClient : public TextCheckerClient {
public:
virtual bool shouldEraseMarkersAfterChangeSelection(TextCheckingType) const { return true; }
virtual void ignoreWordInSpellDocument(const String&) { }
virtual void learnWord(const String&) { }
virtual void checkSpellingOfString(const UChar*, int, int*, int*) { }
virtual String getAutoCorrectSuggestionForMisspelledWord(const String&) { return String(); }
virtual void checkGrammarOfString(const UChar*, int, Vector<GrammarDetail>&, int*, int*) { }
#if USE(UNIFIED_TEXT_CHECKING)
virtual void checkTextOfParagraph(const UChar*, int, TextCheckingTypeMask, Vector<TextCheckingResult>&) { };
#endif
virtual void getGuessesForWord(const String&, const String&, Vector<String>&) { }
virtual void requestCheckingOfString(PassRefPtr<TextCheckingRequest>) OVERRIDE;
};
class EmptyEditorClient : public EditorClient {
WTF_MAKE_NONCOPYABLE(EmptyEditorClient); WTF_MAKE_FAST_ALLOCATED;
public:
EmptyEditorClient() { }
virtual ~EmptyEditorClient() { }
virtual void pageDestroyed() { }
virtual void frameWillDetachPage(Frame*) { }
virtual bool shouldDeleteRange(Range*) { return false; }
virtual bool shouldShowDeleteInterface(HTMLElement*) { return false; }
virtual bool smartInsertDeleteEnabled() { return false; }
virtual bool isSelectTrailingWhitespaceEnabled() { return false; }
virtual bool isContinuousSpellCheckingEnabled() { return false; }
virtual void toggleContinuousSpellChecking() { }
virtual bool isGrammarCheckingEnabled() { return false; }
virtual void toggleGrammarChecking() { }
virtual int spellCheckerDocumentTag() { return -1; }
virtual bool selectWordBeforeMenuEvent() { return false; }
virtual bool isEditable() { return false; }
virtual bool shouldBeginEditing(Range*) { return false; }
virtual bool shouldEndEditing(Range*) { return false; }
virtual bool shouldInsertNode(Node*, Range*, EditorInsertAction) { return false; }
virtual bool shouldInsertText(const String&, Range*, EditorInsertAction) { return false; }
virtual bool shouldChangeSelectedRange(Range*, Range*, EAffinity, bool) { return false; }
virtual bool shouldApplyStyle(StylePropertySet*, Range*) { return false; }
virtual bool shouldMoveRangeAfterDelete(Range*, Range*) { return false; }
virtual void didBeginEditing() { }
virtual void respondToChangedContents() { }
virtual void respondToChangedSelection(Frame*) { }
virtual void didEndEditing() { }
virtual void didWriteSelectionToPasteboard() { }
virtual void didSetSelectionTypesForPasteboard() { }
virtual void registerUndoStep(PassRefPtr<UndoStep>) OVERRIDE;
virtual void registerRedoStep(PassRefPtr<UndoStep>) OVERRIDE;
virtual void clearUndoRedoOperations() { }
virtual bool canCopyCut(Frame*, bool defaultValue) const { return defaultValue; }
virtual bool canPaste(Frame*, bool defaultValue) const { return defaultValue; }
virtual bool canUndo() const { return false; }
virtual bool canRedo() const { return false; }
virtual void undo() { }
virtual void redo() { }
virtual void handleKeyboardEvent(KeyboardEvent*) { }
virtual void handleInputMethodKeydown(KeyboardEvent*) { }
virtual void textFieldDidBeginEditing(Element*) { }
virtual void textFieldDidEndEditing(Element*) { }
virtual void textDidChangeInTextField(Element*) { }
virtual bool doTextFieldCommandFromEvent(Element*, KeyboardEvent*) { return false; }
virtual void textWillBeDeletedInTextField(Element*) { }
virtual void textDidChangeInTextArea(Element*) { }
#if PLATFORM(MAC)
virtual void markedTextAbandoned(Frame*) { }
virtual NSString* userVisibleString(NSURL*) { return 0; }
virtual DocumentFragment* documentFragmentFromAttributedString(NSAttributedString*, Vector<RefPtr<ArchiveResource> >&) { return 0; };
virtual void setInsertionPasteboard(const String&) { };
virtual NSURL* canonicalizeURL(NSURL*) { return 0; }
virtual NSURL* canonicalizeURLString(NSString*) { return 0; }
#endif
#if USE(APPKIT)
virtual void uppercaseWord() { }
virtual void lowercaseWord() { }
virtual void capitalizeWord() { }
#endif
#if USE(AUTOMATIC_TEXT_REPLACEMENT)
virtual void showSubstitutionsPanel(bool) { }
virtual bool substitutionsPanelIsShowing() { return false; }
virtual void toggleSmartInsertDelete() { }
virtual bool isAutomaticQuoteSubstitutionEnabled() { return false; }
virtual void toggleAutomaticQuoteSubstitution() { }
virtual bool isAutomaticLinkDetectionEnabled() { return false; }
virtual void toggleAutomaticLinkDetection() { }
virtual bool isAutomaticDashSubstitutionEnabled() { return false; }
virtual void toggleAutomaticDashSubstitution() { }
virtual bool isAutomaticTextReplacementEnabled() { return false; }
virtual void toggleAutomaticTextReplacement() { }
virtual bool isAutomaticSpellingCorrectionEnabled() { return false; }
virtual void toggleAutomaticSpellingCorrection() { }
#endif
#if PLATFORM(GTK)
virtual bool shouldShowUnicodeMenu() { return false; }
#endif
TextCheckerClient* textChecker() { return &m_textCheckerClient; }
virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&) { }
virtual void updateSpellingUIWithMisspelledWord(const String&) { }
virtual void showSpellingUI(bool) { }
virtual bool spellingUIIsShowing() { return false; }
virtual void willSetInputMethodState() { }
virtual void setInputMethodState(bool) { }
private:
EmptyTextCheckerClient m_textCheckerClient;
};
#if ENABLE(CONTEXT_MENUS)
class EmptyContextMenuClient : public ContextMenuClient {
WTF_MAKE_NONCOPYABLE(EmptyContextMenuClient); WTF_MAKE_FAST_ALLOCATED;
public:
EmptyContextMenuClient() { }
virtual ~EmptyContextMenuClient() { }
virtual void contextMenuDestroyed() { }
#if USE(CROSS_PLATFORM_CONTEXT_MENUS)
virtual PassOwnPtr<ContextMenu> customizeMenu(PassOwnPtr<ContextMenu>) OVERRIDE;
#else
virtual PlatformMenuDescription getCustomMenuFromDefaultItems(ContextMenu*) { return 0; }
#endif
virtual void contextMenuItemSelected(ContextMenuItem*, const ContextMenu*) { }
virtual void downloadURL(const KURL&) { }
virtual void copyImageToClipboard(const HitTestResult&) { }
virtual void searchWithGoogle(const Frame*) { }
virtual void lookUpInDictionary(Frame*) { }
virtual bool isSpeaking() { return false; }
virtual void speak(const String&) { }
virtual void stopSpeaking() { }
#if PLATFORM(MAC)
virtual void searchWithSpotlight() { }
#endif
#if USE(ACCESSIBILITY_CONTEXT_MENUS)
virtual void showContextMenu() { }
#endif
};
#endif // ENABLE(CONTEXT_MENUS)
#if ENABLE(DRAG_SUPPORT)
class EmptyDragClient : public DragClient {
WTF_MAKE_NONCOPYABLE(EmptyDragClient); WTF_MAKE_FAST_ALLOCATED;
public:
EmptyDragClient() { }
virtual ~EmptyDragClient() {}
virtual void willPerformDragDestinationAction(DragDestinationAction, DragData*) { }
virtual void willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*) { }
virtual DragDestinationAction actionMaskForDrag(DragData*) { return DragDestinationActionNone; }
virtual DragSourceAction dragSourceActionMaskForPoint(const IntPoint&) { return DragSourceActionNone; }
virtual void startDrag(DragImageRef, const IntPoint&, const IntPoint&, Clipboard*, Frame*, bool) { }
virtual void dragControllerDestroyed() { }
};
#endif // ENABLE(DRAG_SUPPORT)
class EmptyInspectorClient : public InspectorClient {
WTF_MAKE_NONCOPYABLE(EmptyInspectorClient); WTF_MAKE_FAST_ALLOCATED;
public:
EmptyInspectorClient() { }
virtual ~EmptyInspectorClient() { }
virtual void inspectorDestroyed() { }
virtual InspectorFrontendChannel* openInspectorFrontend(InspectorController*) { return 0; }
virtual void closeInspectorFrontend() { }
virtual void bringFrontendToFront() { }
virtual void highlight() { }
virtual void hideHighlight() { }
};
class EmptyDeviceMotionClient : public DeviceMotionClient {
public:
virtual void setController(DeviceMotionController*) { }
virtual void startUpdating() { }
virtual void stopUpdating() { }
virtual DeviceMotionData* lastMotion() const { return 0; }
virtual void deviceMotionControllerDestroyed() { }
};
class EmptyDeviceOrientationClient : public DeviceOrientationClient {
public:
virtual void setController(DeviceOrientationController*) { }
virtual void startUpdating() { }
virtual void stopUpdating() { }
virtual DeviceOrientationData* lastOrientation() const { return 0; }
virtual void deviceOrientationControllerDestroyed() { }
};
void fillWithEmptyClients(Page::PageClients&);
}
#endif // EmptyClients_h
|