153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)/*
253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * Copyright (C) 2006 Eric Seidel (eric@webkit.org)
353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * Copyright (C) 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * Copyright (C) 2012 Samsung Electronics. All rights reserved.
653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) *
753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * Redistribution and use in source and binary forms, with or without
853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * modification, are permitted provided that the following conditions
953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * are met:
1053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * 1. Redistributions of source code must retain the above copyright
1153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) *    notice, this list of conditions and the following disclaimer.
1253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * 2. Redistributions in binary form must reproduce the above copyright
1353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) *    notice, this list of conditions and the following disclaimer in the
1453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) *    documentation and/or other materials provided with the distribution.
1553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) *
1653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
1753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
2053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
2153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
2253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
2353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
2453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) */
2853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
2953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#ifndef EmptyClients_h
3053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#define EmptyClients_h
3153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
3251b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)#include "core/editing/UndoStep.h"
3353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "core/inspector/InspectorClient.h"
3453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "core/loader/FrameLoaderClient.h"
35bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)#include "core/page/BackForwardClient.h"
3653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "core/page/ChromeClient.h"
3753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "core/page/ContextMenuClient.h"
3853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "core/page/DragClient.h"
3953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "core/page/EditorClient.h"
4009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)#include "core/page/FocusType.h"
4153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "core/page/Page.h"
4251b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)#include "core/page/SpellCheckerClient.h"
4309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)#include "core/page/StorageClient.h"
4409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)#include "platform/DragImage.h"
451e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)#include "platform/geometry/FloatRect.h"
467242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci#include "platform/heap/Handle.h"
471e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)#include "platform/network/ResourceError.h"
481e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)#include "platform/text/TextCheckerClient.h"
495267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#include "public/platform/WebScreenInfo.h"
50591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch#include "wtf/Forward.h"
5153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include <v8.h>
5253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
5353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)/*
5453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) This file holds empty Client stubs for use by WebCore.
55d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) Viewless element needs to create a dummy Page->LocalFrame->FrameView tree for use in parsing or executing JavaScript.
5653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) This tree depends heavily on Clients (usually provided by WebKit classes).
5753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
5853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) This file was first created for SVGImage as it had no way to access the current Page (nor should it,
5953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) since Images are not tied to a page).
6053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) See http://bugs.webkit.org/show_bug.cgi?id=5971 for the original discussion about this file.
6153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
6253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) Ideally, whenever you change a Client class, you should add a stub here.
6353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) Brittle, yes.  Unfortunate, yes.  Hopefully temporary.
6453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)*/
6553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
66c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)namespace blink {
6753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
6853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class EmptyChromeClient : public ChromeClient {
6953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    WTF_MAKE_FAST_ALLOCATED;
7053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)public:
7153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual ~EmptyChromeClient() { }
7253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void chromeDestroyed() OVERRIDE { }
7353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
7453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void* webView() const OVERRIDE { return 0; }
7553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void setWindowRect(const FloatRect&) OVERRIDE { }
7653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual FloatRect windowRect() OVERRIDE { return FloatRect(); }
7753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
7853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual FloatRect pageRect() OVERRIDE { return FloatRect(); }
7953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
8053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void focus() OVERRIDE { }
8153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
8209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual bool canTakeFocus(FocusType) OVERRIDE { return false; }
8309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual void takeFocus(FocusType) OVERRIDE { }
8453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
8553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void focusedNodeChanged(Node*) OVERRIDE { }
86d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual void focusedFrameChanged(LocalFrame*) OVERRIDE { }
87d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual Page* createWindow(LocalFrame*, const FrameLoadRequest&, const WindowFeatures&, NavigationPolicy, ShouldSendReferrer) OVERRIDE { return 0; }
88591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch    virtual void show(NavigationPolicy) OVERRIDE { }
8953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
9053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual bool canRunModal() OVERRIDE { return false; }
9153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void runModal() OVERRIDE { }
9253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
9353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void setToolbarsVisible(bool) OVERRIDE { }
9453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual bool toolbarsVisible() OVERRIDE { return false; }
9553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
9653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void setStatusbarVisible(bool) OVERRIDE { }
9753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual bool statusbarVisible() OVERRIDE { return false; }
9853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
9953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void setScrollbarsVisible(bool) OVERRIDE { }
10053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual bool scrollbarsVisible() OVERRIDE { return false; }
10153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
10253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void setMenubarVisible(bool) OVERRIDE { }
10353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual bool menubarVisible() OVERRIDE { return false; }
10453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
10553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void setResizable(bool) OVERRIDE { }
10653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
107c0e19a689c8ac22cdc96b291a8d33a5d3b0b34a4Torne (Richard Coles)    virtual bool shouldReportDetailedMessageForSource(const String&) OVERRIDE { return false; }
1086f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdoch    virtual void addMessageToConsole(LocalFrame*, MessageSource, MessageLevel, const String&, unsigned, const String&, const String&) OVERRIDE { }
10953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
11053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual bool canRunBeforeUnloadConfirmPanel() OVERRIDE { return false; }
111d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual bool runBeforeUnloadConfirmPanel(const String&, LocalFrame*) OVERRIDE { return true; }
11253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
11353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void closeWindowSoon() OVERRIDE { }
11453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
115d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual void runJavaScriptAlert(LocalFrame*, const String&) OVERRIDE { }
116d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual bool runJavaScriptConfirm(LocalFrame*, const String&) OVERRIDE { return false; }
117d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual bool runJavaScriptPrompt(LocalFrame*, const String&, const String&, String&) OVERRIDE { return false; }
11853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
11953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual bool hasOpenedPopup() const OVERRIDE { return false; }
1207242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    virtual PassRefPtrWillBeRawPtr<PopupMenu> createPopupMenu(LocalFrame&, PopupMenuClient*) const OVERRIDE;
12153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void setPagePopupDriver(PagePopupDriver*) OVERRIDE { }
12253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void resetPagePopupDriver() OVERRIDE { }
12353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
12453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void setStatusbarText(const String&) OVERRIDE { }
12553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
12653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual bool tabsToLinks() OVERRIDE { return false; }
12753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
12853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual IntRect windowResizerRect() const OVERRIDE { return IntRect(); }
12953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
13053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void invalidateContentsAndRootView(const IntRect&) OVERRIDE { }
13153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void invalidateContentsForSlowScroll(const IntRect&) OVERRIDE { }
13253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void scheduleAnimation() OVERRIDE { }
13353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
13453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual IntRect rootViewToScreen(const IntRect& r) const OVERRIDE { return r; }
13551b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    virtual blink::WebScreenInfo screenInfo() const OVERRIDE { return blink::WebScreenInfo(); }
136d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual void contentsSizeChanged(LocalFrame*, const IntSize&) const OVERRIDE { }
13753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
13853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned) OVERRIDE { }
13953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
14053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void setToolTip(const String&, TextDirection) OVERRIDE { }
14153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
142d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual void print(LocalFrame*) OVERRIDE { }
14353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
14453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void enumerateChosenDirectory(FileChooser*) OVERRIDE { }
14553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
1466f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdoch    virtual PassOwnPtr<ColorChooser> createColorChooser(LocalFrame*, ColorChooserClient*, const Color&) OVERRIDE;
1477242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    virtual PassRefPtr<DateTimeChooser> openDateTimeChooser(DateTimeChooserClient*, const DateTimeChooserParameters&) OVERRIDE;
14809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual void openTextDataListChooser(HTMLInputElement&) OVERRIDE;
14953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
150d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual void runOpenPanel(LocalFrame*, PassRefPtr<FileChooser>) OVERRIDE;
15153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
15253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void setCursor(const Cursor&) OVERRIDE { }
15353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
154d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual void attachRootGraphicsLayer(GraphicsLayer*) OVERRIDE { }
15553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
15653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void needTouchEvents(bool) OVERRIDE { }
157a854de003a23bf3c7f95ec0f8154ada64092ff5cTorne (Richard Coles)    virtual void setTouchAction(TouchAction touchAction) OVERRIDE { };
15802772c6a72f1ee0b226341a4f4439970c29fc861Ben Murdoch
159d6cdb82654e8f3343a693ca752d5c4cee0324e17Torne (Richard Coles)    virtual void didAssociateFormControls(const WillBeHeapVector<RefPtrWillBeMember<Element> >&) OVERRIDE { }
16053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
16181a5157921f1d2a7ff6aae115bfe3c139b38a5c8Torne (Richard Coles)    virtual void annotatedRegionsChanged() OVERRIDE { }
16281a5157921f1d2a7ff6aae115bfe3c139b38a5c8Torne (Richard Coles)    virtual bool paintCustomOverhangArea(GraphicsContext*, const IntRect&, const IntRect&, const IntRect&) OVERRIDE { return false; }
163521d96ec04ace82590870fb04353ec4f82bb150fTorne (Richard Coles)    virtual String acceptLanguages() OVERRIDE;
16453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)};
16553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
1667242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucciclass EmptyFrameLoaderClient : public FrameLoaderClient {
16753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    WTF_MAKE_NONCOPYABLE(EmptyFrameLoaderClient); WTF_MAKE_FAST_ALLOCATED;
16853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)public:
16953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    EmptyFrameLoaderClient() { }
17053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual ~EmptyFrameLoaderClient() {  }
17153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
17253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual bool hasWebView() const OVERRIDE { return true; } // mainly for assertions
17353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
174d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual Frame* opener() const OVERRIDE { return 0; }
175d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual void setOpener(Frame*) OVERRIDE { }
176d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)
17709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual Frame* parent() const OVERRIDE { return 0; }
17809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual Frame* top() const OVERRIDE { return 0; }
17909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual Frame* previousSibling() const OVERRIDE { return 0; }
18009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual Frame* nextSibling() const OVERRIDE { return 0; }
18109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual Frame* firstChild() const OVERRIDE { return 0; }
18209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual Frame* lastChild() const OVERRIDE { return 0; }
18353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void detachedFromParent() OVERRIDE { }
18453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
18553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest&, const ResourceResponse&) OVERRIDE { }
18653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long, const ResourceResponse&) OVERRIDE { }
18753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long) OVERRIDE { }
1888abfc5808a4e34d6e03867af8bc440dee641886fTorne (Richard Coles)    virtual void dispatchDidLoadResourceFromMemoryCache(const ResourceRequest&, const ResourceResponse&) OVERRIDE { }
18953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
19053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void dispatchDidHandleOnloadEvents() OVERRIDE { }
19153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void dispatchDidReceiveServerRedirectForProvisionalLoad() OVERRIDE { }
19253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void dispatchWillClose() OVERRIDE { }
193197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    virtual void dispatchDidStartProvisionalLoad(bool isTransitionNavigation) OVERRIDE { }
194c0e19a689c8ac22cdc96b291a8d33a5d3b0b34a4Torne (Richard Coles)    virtual void dispatchDidReceiveTitle(const String&) OVERRIDE { }
19553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void dispatchDidChangeIcons(IconType) OVERRIDE { }
196d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual void dispatchDidCommitLoad(LocalFrame*, HistoryItem*, HistoryCommitType) OVERRIDE { }
19753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void dispatchDidFailProvisionalLoad(const ResourceError&) OVERRIDE { }
19853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void dispatchDidFailLoad(const ResourceError&) OVERRIDE { }
19953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void dispatchDidFinishDocumentLoad() OVERRIDE { }
20053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void dispatchDidFinishLoad() OVERRIDE { }
2011e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)    virtual void dispatchDidFirstVisuallyNonEmptyLayout() OVERRIDE { }
202197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    virtual void dispatchDidChangeThemeColor() OVERRIDE { };
20353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
204197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    virtual NavigationPolicy decidePolicyForNavigation(const ResourceRequest&, DocumentLoader*, NavigationPolicy, bool isTransitionNavigation) OVERRIDE;
20553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
206d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual void dispatchWillSendSubmitEvent(HTMLFormElement*) OVERRIDE;
207d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual void dispatchWillSubmitForm(HTMLFormElement*) OVERRIDE;
20853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
20907a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch    virtual void didStartLoading(LoadStartType) OVERRIDE { }
21007a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch    virtual void progressEstimateChanged(double) OVERRIDE { }
21107a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch    virtual void didStopLoading() OVERRIDE { }
21253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
213e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch    virtual void loadURLExternally(const ResourceRequest&, NavigationPolicy, const String& = String()) OVERRIDE { }
21453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
215d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual PassRefPtr<DocumentLoader> createDocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData&) OVERRIDE;
21653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
21753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual String userAgent(const KURL&) OVERRIDE { return ""; }
21853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
21953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual String doNotTrackValue() OVERRIDE { return String(); }
22053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
221a854de003a23bf3c7f95ec0f8154ada64092ff5cTorne (Richard Coles)    virtual void transitionToCommittedForNewPage() OVERRIDE { }
22253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
223bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    virtual bool navigateBackForward(int offset) const OVERRIDE { return false; }
22453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void didDisplayInsecureContent() OVERRIDE { }
22553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void didRunInsecureContent(SecurityOrigin*, const KURL&) OVERRIDE { }
22653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void didDetectXSS(const KURL&, bool) OVERRIDE { }
2271fad5ca6c42d689812b66fc493992aa6d747a6fbBen Murdoch    virtual void didDispatchPingLoader(const KURL&) OVERRIDE { }
2281e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)    virtual void selectorMatchChanged(const Vector<String>&, const Vector<String>&) OVERRIDE { }
2297242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    virtual PassRefPtrWillBeRawPtr<LocalFrame> createFrame(const KURL&, const AtomicString&, const Referrer&, HTMLFrameOwnerElement*) OVERRIDE;
230d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual PassRefPtr<Widget> createPlugin(HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool, DetachedPluginPolicy) OVERRIDE;
231a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    virtual bool canCreatePluginWithoutRenderer(const String& mimeType) const OVERRIDE { return false; }
232d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual PassRefPtr<Widget> createJavaAppletWidget(HTMLAppletElement*, const KURL&, const Vector<String>&, const Vector<String>&) OVERRIDE;
23353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
23453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual ObjectContentType objectContentType(const KURL&, const String&, bool) OVERRIDE { return ObjectContentType(); }
23553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
236323480423219ecd77329f8326dc5e0e3b50926d4Torne (Richard Coles)    virtual void dispatchDidClearWindowObjectInMainWorld() OVERRIDE { }
23753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void documentElementAvailable() OVERRIDE { }
23853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
23953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void didCreateScriptContext(v8::Handle<v8::Context>, int extensionGroup, int worldId) OVERRIDE { }
24053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void willReleaseScriptContext(v8::Handle<v8::Context>, int worldId) OVERRIDE { }
24153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual bool allowScriptExtension(const String& extensionName, int extensionGroup, int worldId) OVERRIDE { return false; }
24253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
24309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual blink::WebCookieJar* cookieJar() const OVERRIDE { return 0; }
24453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
245f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles)    virtual void didRequestAutocomplete(HTMLFormElement*) OVERRIDE;
246d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)
247d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual PassOwnPtr<blink::WebServiceWorkerProvider> createServiceWorkerProvider() OVERRIDE;
2487242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    virtual bool isControlledByServiceWorker() OVERRIDE { return false; }
249d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual PassOwnPtr<blink::WebApplicationCacheHost> createApplicationCacheHost(blink::WebApplicationCacheHostClient*) OVERRIDE;
25053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)};
25153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
252197021e6b966cfb06891637935ef33fff06433d1Ben Murdochclass EmptyTextCheckerClient : public TextCheckerClient {
25353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)public:
254197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    ~EmptyTextCheckerClient() { }
255197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
25653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual bool shouldEraseMarkersAfterChangeSelection(TextCheckingType) const OVERRIDE { return true; }
257e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch    virtual void checkSpellingOfString(const String&, int*, int*) OVERRIDE { }
25853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual String getAutoCorrectSuggestionForMisspelledWord(const String&) OVERRIDE { return String(); }
259e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch    virtual void checkGrammarOfString(const String&, Vector<GrammarDetail>&, int*, int*) OVERRIDE { }
2607242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    virtual void requestCheckingOfString(PassRefPtrWillBeRawPtr<TextCheckingRequest>) OVERRIDE;
26153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)};
26253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
263197021e6b966cfb06891637935ef33fff06433d1Ben Murdochclass EmptySpellCheckerClient : public SpellCheckerClient {
26451b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    WTF_MAKE_NONCOPYABLE(EmptySpellCheckerClient); WTF_MAKE_FAST_ALLOCATED;
26553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)public:
26651b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    EmptySpellCheckerClient() { }
26751b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    virtual ~EmptySpellCheckerClient() { }
26853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
26953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual bool isContinuousSpellCheckingEnabled() OVERRIDE { return false; }
27053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void toggleContinuousSpellChecking() OVERRIDE { }
27153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual bool isGrammarCheckingEnabled() OVERRIDE { return false; }
27253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
27309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual TextCheckerClient& textChecker() OVERRIDE { return m_textCheckerClient; }
27453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
27553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void updateSpellingUIWithMisspelledWord(const String&) OVERRIDE { }
27653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void showSpellingUI(bool) OVERRIDE { }
27753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual bool spellingUIIsShowing() OVERRIDE { return false; }
27853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
27953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)private:
28053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    EmptyTextCheckerClient m_textCheckerClient;
28153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)};
28253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
28309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)class EmptyEditorClient FINAL : public EditorClient {
28451b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    WTF_MAKE_NONCOPYABLE(EmptyEditorClient); WTF_MAKE_FAST_ALLOCATED;
28551b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)public:
28651b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    EmptyEditorClient() { }
28751b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    virtual ~EmptyEditorClient() { }
28851b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)
28951b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    virtual void respondToChangedContents() OVERRIDE { }
29043e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles)    virtual void respondToChangedSelection(LocalFrame*, SelectionType) OVERRIDE { }
29151b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)
292d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual bool canCopyCut(LocalFrame*, bool defaultValue) const OVERRIDE { return defaultValue; }
293d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual bool canPaste(LocalFrame*, bool defaultValue) const OVERRIDE { return defaultValue; }
29451b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)
29551b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    virtual bool handleKeyboardEvent() OVERRIDE { return false; }
29651b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)};
29751b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)
29809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)class EmptyContextMenuClient FINAL : public ContextMenuClient {
29953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    WTF_MAKE_NONCOPYABLE(EmptyContextMenuClient); WTF_MAKE_FAST_ALLOCATED;
30053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)public:
30153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    EmptyContextMenuClient() { }
30253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual ~EmptyContextMenuClient() {  }
30393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    virtual void showContextMenu(const ContextMenu*) OVERRIDE { }
304e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)    virtual void clearContextMenu() OVERRIDE { }
30553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)};
30653e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
30709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)class EmptyDragClient FINAL : public DragClient {
30853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    WTF_MAKE_NONCOPYABLE(EmptyDragClient); WTF_MAKE_FAST_ALLOCATED;
30953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)public:
31053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    EmptyDragClient() { }
31153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual ~EmptyDragClient() {}
31253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual DragDestinationAction actionMaskForDrag(DragData*) OVERRIDE { return DragDestinationActionNone; }
313197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    virtual void startDrag(DragImage*, const IntPoint&, const IntPoint&, DataTransfer*, LocalFrame*, bool) OVERRIDE { }
31453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)};
31553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
31609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)class EmptyInspectorClient FINAL : public InspectorClient {
31753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    WTF_MAKE_NONCOPYABLE(EmptyInspectorClient); WTF_MAKE_FAST_ALLOCATED;
31853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)public:
31953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    EmptyInspectorClient() { }
32053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual ~EmptyInspectorClient() { }
32153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
32253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void highlight() OVERRIDE { }
32353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual void hideHighlight() OVERRIDE { }
32453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)};
32553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
32609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)class EmptyBackForwardClient FINAL : public BackForwardClient {
32753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)public:
32853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual int backListCount() OVERRIDE { return 0; }
32953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)    virtual int forwardListCount() OVERRIDE { return 0; }
330bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    virtual int backForwardListCount() OVERRIDE { return 0; }
33153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)};
33253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
33309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)class EmptyStorageClient FINAL : public StorageClient {
33409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)public:
33509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual PassOwnPtr<StorageNamespace> createSessionStorageNamespace() OVERRIDE;
336d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual bool canAccessStorage(LocalFrame*, StorageType) const OVERRIDE { return false; }
33709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)};
33809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)
33953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)void fillWithEmptyClients(Page::PageClients&);
34053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
34153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)}
34253e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)
34353e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#endif // EmptyClients_h
344