• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2006 Zack Rusin <zack@kde.org>
3  * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
4  * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com> All rights reserved.
5  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6  *
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
21  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29 #include "config.h"
30 #include "ChromeClientHaiku.h"
31 
32 #include "Frame.h"
33 #include "FrameLoadRequest.h"
34 #include "FrameView.h"
35 #include "HitTestResult.h"
36 #include "Icon.h"
37 #include "NavigationAction.h"
38 #include "NotImplemented.h"
39 #include "PlatformString.h"
40 #include "SecurityOrigin.h"
41 #include "PopupMenuHaiku.h"
42 #include "SearchPopupMenuHaiku.h"
43 
44 #include <Alert.h>
45 #include <String.h>
46 
47 
48 namespace WebCore {
49 
ChromeClientHaiku()50 ChromeClientHaiku::ChromeClientHaiku()
51 {
52 }
53 
~ChromeClientHaiku()54 ChromeClientHaiku::~ChromeClientHaiku()
55 {
56 }
57 
chromeDestroyed()58 void ChromeClientHaiku::chromeDestroyed()
59 {
60     notImplemented();
61 }
62 
setWindowRect(const FloatRect &)63 void ChromeClientHaiku::setWindowRect(const FloatRect&)
64 {
65     notImplemented();
66 }
67 
windowRect()68 FloatRect ChromeClientHaiku::windowRect()
69 {
70     notImplemented();
71     return FloatRect(0, 0, 200, 200);
72 }
73 
pageRect()74 FloatRect ChromeClientHaiku::pageRect()
75 {
76     notImplemented();
77     return FloatRect(0, 0, 200, 200);
78 }
79 
scaleFactor()80 float ChromeClientHaiku::scaleFactor()
81 {
82     notImplemented();
83     return 1.0;
84 }
85 
focus()86 void ChromeClientHaiku::focus()
87 {
88     notImplemented();
89 }
90 
unfocus()91 void ChromeClientHaiku::unfocus()
92 {
93     notImplemented();
94 }
95 
canTakeFocus(FocusDirection)96 bool ChromeClientHaiku::canTakeFocus(FocusDirection)
97 {
98     notImplemented();
99     return true;
100 }
101 
takeFocus(FocusDirection)102 void ChromeClientHaiku::takeFocus(FocusDirection)
103 {
104     notImplemented();
105 }
106 
focusedNodeChanged(Node *)107 void ChromeClientHaiku::focusedNodeChanged(Node*)
108 {
109 }
110 
focusedFrameChanged(Frame *)111 void ChromeClientHaiku::focusedFrameChanged(Frame*)
112 {
113 }
114 
createWindow(Frame *,const FrameLoadRequest &,const WebCore::WindowFeatures &,const WebCore::NavigationAction &)115 Page* ChromeClientHaiku::createWindow(Frame*, const FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&)
116 {
117     notImplemented();
118     return 0;
119 }
120 
createModalDialog(Frame *,const FrameLoadRequest &)121 Page* ChromeClientHaiku::createModalDialog(Frame*, const FrameLoadRequest&)
122 {
123     notImplemented();
124     return 0;
125 }
126 
show()127 void ChromeClientHaiku::show()
128 {
129     notImplemented();
130 }
131 
canRunModal()132 bool ChromeClientHaiku::canRunModal()
133 {
134     notImplemented();
135     return false;
136 }
137 
runModal()138 void ChromeClientHaiku::runModal()
139 {
140     notImplemented();
141 }
142 
setToolbarsVisible(bool)143 void ChromeClientHaiku::setToolbarsVisible(bool)
144 {
145     notImplemented();
146 }
147 
toolbarsVisible()148 bool ChromeClientHaiku::toolbarsVisible()
149 {
150     notImplemented();
151     return false;
152 }
153 
setStatusbarVisible(bool)154 void ChromeClientHaiku::setStatusbarVisible(bool)
155 {
156     notImplemented();
157 }
158 
statusbarVisible()159 bool ChromeClientHaiku::statusbarVisible()
160 {
161     notImplemented();
162     return false;
163 }
164 
setScrollbarsVisible(bool)165 void ChromeClientHaiku::setScrollbarsVisible(bool)
166 {
167     notImplemented();
168 }
169 
scrollbarsVisible()170 bool ChromeClientHaiku::scrollbarsVisible()
171 {
172     notImplemented();
173     return true;
174 }
175 
setMenubarVisible(bool)176 void ChromeClientHaiku::setMenubarVisible(bool)
177 {
178     notImplemented();
179 }
180 
menubarVisible()181 bool ChromeClientHaiku::menubarVisible()
182 {
183     notImplemented();
184     return false;
185 }
186 
setResizable(bool)187 void ChromeClientHaiku::setResizable(bool)
188 {
189     notImplemented();
190 }
191 
addMessageToConsole(const String & message,unsigned int lineNumber,const String & sourceID)192 void ChromeClientHaiku::addMessageToConsole(const String& message, unsigned int lineNumber,
193                                             const String& sourceID)
194 {
195     printf("MESSAGE %s:%i %s\n", BString(sourceID).String(), lineNumber, BString(message).String());
196 }
197 
addMessageToConsole(MessageSource,MessageLevel,const String & message,unsigned int lineNumber,const String & sourceID)198 void ChromeClientHaiku::addMessageToConsole(MessageSource, MessageLevel, const String& message,
199                                             unsigned int lineNumber, const String& sourceID)
200 {
201     printf("MESSAGE %s:%i %s\n", BString(sourceID).String(), lineNumber, BString(message).String());
202 }
203 
addMessageToConsole(MessageSource,MessageType,MessageLevel,const String & message,unsigned int lineNumber,const String & sourceID)204 void ChromeClientHaiku::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message,
205                                             unsigned int lineNumber, const String& sourceID)
206 {
207     printf("MESSAGE %s:%i %s\n", BString(sourceID).String(), lineNumber, BString(message).String());
208 }
209 
canRunBeforeUnloadConfirmPanel()210 bool ChromeClientHaiku::canRunBeforeUnloadConfirmPanel()
211 {
212     notImplemented();
213     return false;
214 }
215 
runBeforeUnloadConfirmPanel(const String & message,Frame * frame)216 bool ChromeClientHaiku::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
217 {
218     notImplemented();
219     return false;
220 }
221 
closeWindowSoon()222 void ChromeClientHaiku::closeWindowSoon()
223 {
224     notImplemented();
225 }
226 
runJavaScriptAlert(Frame *,const String & msg)227 void ChromeClientHaiku::runJavaScriptAlert(Frame*, const String& msg)
228 {
229     BAlert* alert = new BAlert("JavaScript", BString(msg).String(), "OK");
230     alert->Go();
231 }
232 
runJavaScriptConfirm(Frame *,const String & msg)233 bool ChromeClientHaiku::runJavaScriptConfirm(Frame*, const String& msg)
234 {
235     BAlert* alert = new BAlert("JavaScript", BString(msg).String(), "Yes", "No");
236     return !alert->Go();
237 }
238 
runJavaScriptPrompt(Frame *,const String & message,const String & defaultValue,String & result)239 bool ChromeClientHaiku::runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result)
240 {
241     notImplemented();
242     return false;
243 }
244 
setStatusbarText(const String &)245 void ChromeClientHaiku::setStatusbarText(const String&)
246 {
247     notImplemented();
248 }
249 
shouldInterruptJavaScript()250 bool ChromeClientHaiku::shouldInterruptJavaScript()
251 {
252     notImplemented();
253     return false;
254 }
255 
keyboardUIMode()256 KeyboardUIMode ChromeClientHaiku::keyboardUIMode()
257 {
258     return KeyboardAccessDefault;
259 }
260 
windowResizerRect() const261 IntRect ChromeClientHaiku::windowResizerRect() const
262 {
263     return IntRect();
264 }
265 
invalidateWindow(const IntRect &,bool)266 void ChromeClientHaiku::invalidateWindow(const IntRect&, bool)
267 {
268     notImplemented();
269 }
270 
invalidateContentsAndWindow(const IntRect &,bool)271 void ChromeClientHaiku::invalidateContentsAndWindow(const IntRect&, bool)
272 {
273     notImplemented();
274 }
275 
invalidateContentsForSlowScroll(const IntRect &,bool)276 void ChromeClientHaiku::invalidateContentsForSlowScroll(const IntRect&, bool)
277 {
278     notImplemented();
279 }
280 
scroll(const IntSize & scrollDelta,const IntRect & rectToScroll,const IntRect & clipRect)281 void ChromeClientHaiku::scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
282 {
283     notImplemented();
284 }
285 
screenToWindow(const IntPoint &) const286 IntPoint ChromeClientHaiku::screenToWindow(const IntPoint&) const
287 {
288     notImplemented();
289     return IntPoint();
290 }
291 
windowToScreen(const IntRect &) const292 IntRect ChromeClientHaiku::windowToScreen(const IntRect&) const
293 {
294     notImplemented();
295     return IntRect();
296 }
297 
platformPageClient() const298 PlatformPageClient ChromeClientHaiku::platformPageClient() const
299 {
300     notImplemented();
301     return PlatformWidget();
302 }
303 
contentsSizeChanged(Frame *,const IntSize &) const304 void ChromeClientHaiku::contentsSizeChanged(Frame*, const IntSize&) const
305 {
306     notImplemented();
307 }
308 
scrollRectIntoView(const IntRect &,const ScrollView *) const309 void ChromeClientHaiku::scrollRectIntoView(const IntRect&, const ScrollView*) const
310 {
311     notImplemented();
312 }
313 
addToDirtyRegion(const IntRect &)314 void ChromeClientHaiku::addToDirtyRegion(const IntRect&)
315 {
316 }
317 
scrollBackingStore(int,int,const IntRect &,const IntRect &)318 void ChromeClientHaiku::scrollBackingStore(int, int, const IntRect&, const IntRect&)
319 {
320 }
321 
updateBackingStore()322 void ChromeClientHaiku::updateBackingStore()
323 {
324 }
325 
mouseDidMoveOverElement(const HitTestResult & hit,unsigned)326 void ChromeClientHaiku::mouseDidMoveOverElement(const HitTestResult& hit, unsigned /*modifierFlags*/)
327 {
328     // Some extra info
329     notImplemented();
330 }
331 
setToolTip(const String & tip)332 void ChromeClientHaiku::setToolTip(const String& tip)
333 {
334     notImplemented();
335 }
336 
setToolTip(const String & tip,TextDirection)337 void ChromeClientHaiku::setToolTip(const String& tip, TextDirection)
338 {
339     notImplemented();
340 }
341 
print(Frame *)342 void ChromeClientHaiku::print(Frame*)
343 {
344     notImplemented();
345 }
346 
exceededDatabaseQuota(Frame *,const String & databaseName)347 void ChromeClientHaiku::exceededDatabaseQuota(Frame*, const String& databaseName)
348 {
349     notImplemented();
350 }
351 
352 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
reachedMaxAppCacheSize(int64_t spaceNeeded)353 void ChromeClientWx::reachedMaxAppCacheSize(int64_t spaceNeeded)
354 {
355     notImplemented();
356 }
357 
reachedApplicationCacheOriginQuota(SecurityOrigin *)358 void ChromeClientWx::reachedApplicationCacheOriginQuota(SecurityOrigin*)
359 {
360     notImplemented();
361 }
362 #endif
363 
requestGeolocationPermissionForFrame(Frame *,Geolocation *)364 void ChromeClientHaiku::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
365 {
366     notImplemented();
367 }
368 
runOpenPanel(Frame *,PassRefPtr<FileChooser>)369 void ChromeClientHaiku::runOpenPanel(Frame*, PassRefPtr<FileChooser>)
370 {
371     notImplemented();
372 }
373 
chooseIconForFiles(const Vector<String> & filenames,FileChooser * chooser)374 void ChromeClientHaiku::chooseIconForFiles(const Vector<String>& filenames, FileChooser* chooser)
375 {
376     chooser->iconLoaded(Icon::createIconForFiles(filenames));
377 }
378 
setCursor(const Cursor &)379 void ChromeClientHaiku::setCursor(const Cursor&)
380 {
381     notImplemented();
382 }
383 
384 // Notification that the given form element has changed. This function
385 // will be called frequently, so handling should be very fast.
formStateDidChange(const Node *)386 void ChromeClientHaiku::formStateDidChange(const Node*)
387 {
388     notImplemented();
389 }
390 
selectItemWritingDirectionIsNatural()391 bool ChromeClientHaiku::selectItemWritingDirectionIsNatural()
392 {
393     return false;
394 }
395 
selectItemAlignmentFollowsMenuWritingDirection()396 bool ChromeClientHaiku::selectItemAlignmentFollowsMenuWritingDirection()
397 {
398     return false;
399 }
400 
createPopupMenu(PopupMenuClient * client) const401 PassRefPtr<PopupMenu> ChromeClientHaiku::createPopupMenu(PopupMenuClient* client) const
402 {
403     return adoptRef(new PopupMenuHaiku(client));
404 }
405 
createSearchPopupMenu(PopupMenuClient * client) const406 PassRefPtr<SearchPopupMenu> ChromeClientHaiku::createSearchPopupMenu(PopupMenuClient* client) const
407 {
408     return adoptRef(new SearchPopupMenuHaiku(client));
409 }
410 
411 } // namespace WebCore
412 
413