diff options
Diffstat (limited to 'Source/WebCore/page/Chrome.h')
-rw-r--r-- | Source/WebCore/page/Chrome.h | 119 |
1 files changed, 54 insertions, 65 deletions
diff --git a/Source/WebCore/page/Chrome.h b/Source/WebCore/page/Chrome.h index 71852cdda..b3c4647c1 100644 --- a/Source/WebCore/page/Chrome.h +++ b/Source/WebCore/page/Chrome.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. + * Copyright (C) 2006-2017 Apple Inc. All rights reserved. * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * Copyright (C) 2012, Samsung Electronics. All rights reserved. * @@ -19,8 +19,7 @@ * Boston, MA 02110-1301, USA. */ -#ifndef Chrome_h -#define Chrome_h +#pragma once #include "Cursor.h" #include "FocusDirection.h" @@ -28,10 +27,8 @@ #include <wtf/Forward.h> #include <wtf/RefPtr.h> -#if PLATFORM(MAC) -#ifndef __OBJC__ -class NSView; -#endif +#if PLATFORM(COCOA) +OBJC_CLASS NSView; #endif namespace WebCore { @@ -48,6 +45,7 @@ class Element; class Frame; class Geolocation; class HitTestResult; +class IntPoint; class IntRect; class NavigationAction; class Page; @@ -69,34 +67,38 @@ public: ChromeClient& client() { return m_client; } // HostWindow methods. - 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&) override; -#if USE(TILED_BACKING_STORE) - virtual void delegatedScrollRequested(const IntPoint& scrollPoint) override; + void invalidateRootView(const IntRect&) override; + void invalidateContentsAndRootView(const IntRect&) override; + void invalidateContentsForSlowScroll(const IntRect&) override; + void scroll(const IntSize&, const IntRect&, const IntRect&) override; +#if USE(COORDINATED_GRAPHICS) + void delegatedScrollRequested(const IntPoint& scrollPoint) override; #endif - virtual IntPoint screenToRootView(const IntPoint&) const override; - virtual IntRect rootViewToScreen(const IntRect&) const override; - virtual PlatformPageClient platformPageClient() const override; - virtual void scrollbarsModeDidChange() const override; - virtual void setCursor(const Cursor&) override; - virtual void setCursorHiddenUntilMouseMoves(bool) override; - -#if ENABLE(REQUEST_ANIMATION_FRAME) - virtual void scheduleAnimation() override; + IntPoint screenToRootView(const IntPoint&) const override; + IntRect rootViewToScreen(const IntRect&) const override; +#if PLATFORM(IOS) + IntPoint accessibilityScreenToRootView(const IntPoint&) const override; + IntRect rootViewToAccessibilityScreen(const IntRect&) const override; #endif + PlatformPageClient platformPageClient() const override; + void scrollbarsModeDidChange() const override; + void setCursor(const Cursor&) override; + void setCursorHiddenUntilMouseMoves(bool) override; + + void scheduleAnimation() override; - virtual PlatformDisplayID displayID() const override; - virtual void windowScreenDidChange(PlatformDisplayID) override; + PlatformDisplayID displayID() const override; + void windowScreenDidChange(PlatformDisplayID) override; + + FloatSize screenSize() const override; + FloatSize availableScreenSize() const override; void scrollRectIntoView(const IntRect&) const; - void contentsSizeChanged(Frame*, const IntSize&) const; - void layoutUpdated(Frame*) const; + void contentsSizeChanged(Frame&, const IntSize&) const; - void setWindowRect(const FloatRect&) const; - FloatRect windowRect() const; + WEBCORE_EXPORT void setWindowRect(const FloatRect&) const; + WEBCORE_EXPORT FloatRect windowRect() const; FloatRect pageRect() const; @@ -109,11 +111,10 @@ public: void focusedElementChanged(Element*) const; void focusedFrameChanged(Frame*) const; - Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&) const; - void show() const; + WEBCORE_EXPORT Page* createWindow(Frame&, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&) const; + WEBCORE_EXPORT void show() const; bool canRunModal() const; - bool canRunModalNow() const; void runModal() const; void setToolbarsVisible(bool) const; @@ -131,77 +132,65 @@ public: void setResizable(bool) const; bool canRunBeforeUnloadConfirmPanel(); - bool runBeforeUnloadConfirmPanel(const String& message, Frame*); + bool runBeforeUnloadConfirmPanel(const String& message, Frame&); void closeWindowSoon(); - void runJavaScriptAlert(Frame*, const String&); - bool runJavaScriptConfirm(Frame*, const String&); - bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result); - void setStatusbarText(Frame*, const String&); - bool shouldInterruptJavaScript(); - - IntRect windowResizerRect() const; + void runJavaScriptAlert(Frame&, const String&); + bool runJavaScriptConfirm(Frame&, const String&); + bool runJavaScriptPrompt(Frame&, const String& message, const String& defaultValue, String& result); + WEBCORE_EXPORT void setStatusbarText(Frame&, const String&); void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags); void setToolTip(const HitTestResult&); - void print(Frame*); + WEBCORE_EXPORT void print(Frame&); - void enableSuddenTermination(); - void disableSuddenTermination(); + WEBCORE_EXPORT void enableSuddenTermination(); + WEBCORE_EXPORT void disableSuddenTermination(); #if ENABLE(INPUT_TYPE_COLOR) - PassOwnPtr<ColorChooser> createColorChooser(ColorChooserClient*, const Color& initialColor); + std::unique_ptr<ColorChooser> createColorChooser(ColorChooserClient&, const Color& initialColor); #endif -#if ENABLE(DATE_AND_TIME_INPUT_TYPES) && !PLATFORM(IOS) - PassRefPtr<DateTimeChooser> openDateTimeChooser(DateTimeChooserClient*, const DateTimeChooserParameters&) -#endif - - void runOpenPanel(Frame*, PassRefPtr<FileChooser>); - void loadIconForFiles(const Vector<String>&, FileIconLoader*); -#if ENABLE(DIRECTORY_UPLOAD) - void enumerateChosenDirectory(FileChooser*); -#endif + void runOpenPanel(Frame&, FileChooser&); + void loadIconForFiles(const Vector<String>&, FileIconLoader&); void dispatchViewportPropertiesDidChange(const ViewportArguments&) const; bool requiresFullscreenForVideoPlayback(); -#if PLATFORM(MAC) - void focusNSView(NSView*); +#if PLATFORM(COCOA) + WEBCORE_EXPORT void focusNSView(NSView*); #endif bool selectItemWritingDirectionIsNatural(); bool selectItemAlignmentFollowsMenuWritingDirection(); bool hasOpenedPopup() const; - PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const; - PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const; + RefPtr<PopupMenu> createPopupMenu(PopupMenuClient&) const; + RefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient&) const; #if PLATFORM(IOS) // FIXME: Can we come up with a better name for this setter? void setDispatchViewportDataDidChangeSuppressed(bool dispatchViewportDataDidChangeSuppressed) { m_isDispatchViewportDataDidChangeSuppressed = dispatchViewportDataDidChangeSuppressed; } - - void didReceiveDocType(Frame*); #endif - void registerPopupOpeningObserver(PopupOpeningObserver*); - void unregisterPopupOpeningObserver(PopupOpeningObserver*); + void didReceiveDocType(Frame&); + + void registerPopupOpeningObserver(PopupOpeningObserver&); + void unregisterPopupOpeningObserver(PopupOpeningObserver&); private: void notifyPopupOpeningObservers() const; Page& m_page; ChromeClient& m_client; - PlatformDisplayID m_displayID; + PlatformDisplayID m_displayID { 0 }; Vector<PopupOpeningObserver*> m_popupOpeningObservers; #if PLATFORM(IOS) - bool m_isDispatchViewportDataDidChangeSuppressed; + bool m_isDispatchViewportDataDidChangeSuppressed { false }; #endif }; -} - -#endif // Chrome_h +} // namespace WebCore |