• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
17  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  */
24 
25 #ifndef ChromeClientWinCE_h
26 #define ChromeClientWinCE_h
27 
28 #include "ChromeClient.h"
29 
30 class WebView;
31 
32 namespace WebKit {
33 
34 class ChromeClientWinCE : public WebCore::ChromeClient {
35 public:
36     ChromeClientWinCE(WebView* webView);
37 
38     virtual void chromeDestroyed();
39 
40     virtual void setWindowRect(const WebCore::FloatRect&);
41     virtual WebCore::FloatRect windowRect();
42 
43     virtual WebCore::FloatRect pageRect();
44 
45     virtual float scaleFactor();
46 
47     virtual void focus();
48     virtual void unfocus();
49 
50     virtual bool canTakeFocus(WebCore::FocusDirection);
51     virtual void takeFocus(WebCore::FocusDirection);
52 
53     virtual void focusedNodeChanged(WebCore::Node*);
54     virtual void focusedFrameChanged(WebCore::Frame*);
55 
56     // The Frame pointer provides the ChromeClient with context about which
57     // Frame wants to create the new Page.  Also, the newly created window
58     // should not be shown to the user until the ChromeClient of the newly
59     // created Page has its show method called.
60     virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&);
61     virtual void show();
62 
63     virtual bool canRunModal();
64     virtual void runModal();
65 
66     virtual void setToolbarsVisible(bool);
67     virtual bool toolbarsVisible();
68 
69     virtual void setStatusbarVisible(bool);
70     virtual bool statusbarVisible();
71 
72     virtual void setScrollbarsVisible(bool);
73     virtual bool scrollbarsVisible();
74 
75     virtual void setMenubarVisible(bool);
76     virtual bool menubarVisible();
77 
78     virtual void setResizable(bool);
79 
80     virtual void addMessageToConsole(WebCore::MessageSource, WebCore::MessageType, WebCore::MessageLevel, const WTF::String& message, unsigned int lineNumber, const WTF::String& sourceID);
81 
82     virtual bool canRunBeforeUnloadConfirmPanel();
83     virtual bool runBeforeUnloadConfirmPanel(const WTF::String& message, WebCore::Frame* frame);
84 
85     virtual void closeWindowSoon();
86 
87     virtual void runJavaScriptAlert(WebCore::Frame*, const WTF::String&);
88     virtual bool runJavaScriptConfirm(WebCore::Frame*, const WTF::String&);
89     virtual bool runJavaScriptPrompt(WebCore::Frame*, const WTF::String& message, const WTF::String& defaultValue, WTF::String& result);
90     virtual void setStatusbarText(const WTF::String&);
91     virtual bool shouldInterruptJavaScript();
92     virtual WebCore::KeyboardUIMode keyboardUIMode();
93 
94     virtual WebCore::IntRect windowResizerRect() const;
95 
96     // Methods used by HostWindow.
97     virtual void invalidateWindow(const WebCore::IntRect&, bool);
98     virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool);
99     virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
100     virtual void scroll(const WebCore::IntSize&, const WebCore::IntRect&, const WebCore::IntRect&);
101     virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const;
102     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const;
103     virtual PlatformPageClient platformPageClient() const;
104     virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const;
105     virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const; // Currently only Mac has a non empty implementation.
106     virtual void scrollbarsModeDidChange() const;
107     virtual void setCursor(const WebCore::Cursor&);
108     // End methods used by HostWindow.
109 
110     virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags);
111 
112     virtual void setToolTip(const WTF::String&, WebCore::TextDirection);
113 
114     virtual void print(WebCore::Frame*);
115 
116 #if ENABLE(DATABASE)
117     virtual void exceededDatabaseQuota(WebCore::Frame*, const WTF::String& databaseName);
118 #endif
119 
120 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
121     // Callback invoked when the application cache fails to save a cache object
122     // because storing it would grow the database file past its defined maximum
123     // size or past the amount of free space on the device.
124     // The chrome client would need to take some action such as evicting some
125     // old caches.
126     virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
127 
128     // Callback invoked when the application cache origin quota is reached. This
129     // means that the resources attempting to be cached via the manifest are
130     // more than allowed on this origin. This callback allows the chrome client
131     // to take action, such as prompting the user to ask to increase the quota
132     // for this origin.
133     virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*);
134 #endif
135 
136 #if ENABLE(CONTEXT_MENUS)
showContextMenu()137     virtual void showContextMenu() { }
138 #endif
139 
140 #if ENABLE(NOTIFICATIONS)
141     virtual WebCore::NotificationPresenter* notificationPresenter() const;
142 #endif
143 
144     // This can be either a synchronous or asynchronous call. The ChromeClient can display UI asking the user for permission
145     // to use Geolocation.
146     virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
147     virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*);
148 
149     virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
150     // Asynchronous request to load an icon for specified filenames.
151     virtual void chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*);
152 
153     // Notification that the given form element has changed. This function
154     // will be called frequently, so handling should be very fast.
155     virtual void formStateDidChange(const WebCore::Node*);
156 
157 #if USE(ACCELERATED_COMPOSITING)
158     // Pass 0 as the GraphicsLayer to detatch the root layer.
159     virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*);
160     // Sets a flag to specify that the next time content is drawn to the window,
161     // the changes appear on the screen in synchrony with updates to GraphicsLayers.
162     virtual void setNeedsOneShotDrawingSynchronization();
163     // Sets a flag to specify that the view needs to be updated, so we need
164     // to do an eager layout before the drawing.
165     virtual void scheduleCompositingLayerSync();
166 #endif
167 
168     virtual void setLastSetCursorToCurrentCursor();
169 
170 #if ENABLE(TOUCH_EVENTS)
171     virtual void needTouchEvents(bool);
172 #endif
173 
174     virtual bool selectItemWritingDirectionIsNatural();
175     virtual bool selectItemAlignmentFollowsMenuWritingDirection();
176     virtual PassRefPtr<WebCore::PopupMenu> createPopupMenu(WebCore::PopupMenuClient*) const;
177     virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const;
178 
179 private:
180     WebView* m_webView;
181 };
182 
183 } // namespace WebKit
184 
185 #endif // ChromeClientWinCE_h
186