123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- /*
- * Copyright (C) 2008 Apple Computer, Inc. All rights reserved.
- * Copyright (C) 2012 Sony Computer Entertainment Inc.
- *
- * 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 ChromeClientManx_h
- #define ChromeClientManx_h
- #include "ChromeClient.h"
- #include "FocusDirection.h"
- #include "IntRect.h"
- #include "KURL.h"
- class ChromeClientListener;
- namespace WebKit {
- class WebViewPrivate;
- }
- namespace WebCore {
- class ChromeClientManx : public ChromeClient {
- public:
- ChromeClientManx(WebKit::WebViewPrivate*);
- virtual ~ChromeClientManx();
- virtual void chromeDestroyed();
- virtual void* webView() const { return 0; }
- virtual void setWindowRect(const FloatRect&);
- virtual FloatRect windowRect();
- virtual FloatRect pageRect();
- virtual void focus();
- virtual void unfocus();
- virtual bool canTakeFocus(FocusDirection);
- virtual void takeFocus(FocusDirection);
- virtual void focusedNodeChanged(Node*);
- virtual void focusedFrameChanged(Frame*);
- virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&);
- virtual Page* createModalDialog(Frame*, const FrameLoadRequest&);
- virtual void show();
- virtual bool canRunModal();
- virtual void runModal();
- virtual void setToolbarsVisible(bool);
- virtual bool toolbarsVisible();
- virtual void setStatusbarVisible(bool);
- virtual bool statusbarVisible();
- virtual void setScrollbarsVisible(bool);
- virtual bool scrollbarsVisible();
- virtual void setMenubarVisible(bool);
- virtual bool menubarVisible();
- virtual void createSelectPopup(PopupMenuClient*, int index, const IntRect&);
- virtual bool destroySelectPopup();
- virtual void setResizable(bool);
- virtual void addMessageToConsole(MessageSource,
- MessageLevel,
- const String& message,
- unsigned lineNumber,
- unsigned columnNumber,
- const String& sourceID);
- virtual bool canRunBeforeUnloadConfirmPanel();
- virtual bool runBeforeUnloadConfirmPanel(const String& message,
- Frame*);
- virtual void closeWindowSoon();
- virtual void runJavaScriptAlert(Frame*, const String&);
- virtual bool runJavaScriptConfirm(Frame*, const String&);
- virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result);
- virtual void setStatusbarText(const String&);
- virtual bool shouldInterruptJavaScript();
- virtual WebCore::KeyboardUIMode keyboardUIMode();
- virtual bool tabsToLinks() const;
- virtual IntRect windowResizerRect() const;
- virtual void elementDidFocus(const Node*);
- virtual void elementDidBlur(const Node*);
- // Methods used by HostWindow.
- virtual void scrollBackingStore(int dx, int dy, const IntRect& scrollViewRect, const IntRect& clipRect);
- virtual void updateBackingStore();
- virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
- virtual void invalidateRootView(const IntRect&, bool);
- virtual void invalidateContentsAndRootView(const IntRect&, bool);
- virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
- virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
- #if USE(TILED_BACKING_STORE)
- virtual void delegatedScrollRequested(const IntPoint&);
- virtual IntRect visibleRectForTiledBackingStore() const;
- #endif
- virtual IntPoint screenToRootView(const IntPoint&) const;
- virtual IntRect rootViewToScreen(const IntRect&) const;
- virtual PlatformPageClient platformPageClient() const;
- virtual void scrollbarsModeDidChange() const { }
- virtual void setCursor(const WebCore::Cursor&);
- virtual void setCursorHiddenUntilMouseMoves(bool);
- #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER)
- virtual void scheduleAnimation() { };
- #endif
- // End methods used by HostWindow.
- virtual void dispatchViewportPropertiesDidChange(const ViewportArguments&) const;
- virtual void contentsSizeChanged(Frame*, const IntSize&) const;
- virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
- virtual void setToolTip(const String&, TextDirection);
- virtual void print(Frame*);
- #if ENABLE(SQL_DATABASE)
- virtual void exceededDatabaseQuota(Frame*, const String&, DatabaseDetails);
- #endif
- virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
- virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*, int64_t totalSpaceNeeded);
- #if USE(ACCELERATED_COMPOSITING)
- virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*);
- virtual void setNeedsOneShotDrawingSynchronization();
- virtual void scheduleCompositingLayerFlush();
- #endif
- virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
- virtual void loadIconForFiles(const Vector<String>&, FileIconLoader*);
- virtual void formStateDidChange(const Node*) { }
- #if ENABLE(TOUCH_EVENTS)
- virtual void needTouchEvents(bool);
- #endif
- virtual bool selectItemWritingDirectionIsNatural();
- virtual bool selectItemAlignmentFollowsMenuWritingDirection();
- virtual bool hasOpenedPopup() const;
- virtual PassRefPtr<WebCore::PopupMenu> createPopupMenu(WebCore::PopupMenuClient*) const;
- virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const;
- #if ENABLE(PAGE_POPUP)
- // Creates a PagePopup object, and shows it beside originBoundsInRootView.
- // The return value can be 0.
- virtual PagePopup* openPagePopup(PagePopupClient*, const IntRect& originBoundsInRootView) = 0;
- virtual void closePagePopup(PagePopup*) = 0;
- #endif
- virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const { return true; }
- virtual void numWheelEventHandlersChanged(unsigned) { }
- virtual void numTouchEventHandlersChanged(unsigned) { }
- #if ENABLE(INPUT_TYPE_COLOR)
- virtual PassOwnPtr<ColorChooser> createColorChooser(ColorChooserClient*, const Color&);
- #endif
- void setUpload(const char* path);
- void setChromeClientListener(ChromeClientListener* listener) { m_listener = listener; }
- private:
- WebKit::WebViewPrivate* m_webView;
- RefPtr<FileChooser> m_file;
- ChromeClientListener* m_listener;
- };
- }
- #endif // ChromeClientManx_h
|