1 /* 2 * Copyright 2009, The Android Open Source Project 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 * * Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * * 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 THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 #define LOG_TAG "WebCore" 26 27 #include "config.h" 28 29 #define ANDROID_COMPILE_HACK 30 31 #include "AXObjectCache.h" 32 #include "CachedPage.h" 33 #include "CachedResource.h" 34 #include "Clipboard.h" 35 #include "Console.h" 36 #include "ContextMenu.h" 37 #include "ContextMenuItem.h" 38 #include "CookieJar.h" 39 #include "CookieStorage.h" 40 #include "Cursor.h" 41 #include "Database.h" 42 #include "DocumentFragment.h" 43 #include "DocumentLoader.h" 44 #include "EditCommand.h" 45 #include "Editor.h" 46 #include "File.h" 47 #include "Font.h" 48 #include "Frame.h" 49 #include "FrameLoadRequest.h" 50 #include "FrameLoader.h" 51 #include "FrameView.h" 52 #include "GraphicsContext.h" 53 #include "HTMLFrameOwnerElement.h" 54 #include "HTMLKeygenElement.h" 55 #include "History.h" 56 #include "Icon.h" 57 #include "IconDatabase.h" 58 #include "IconLoader.h" 59 #include "IntPoint.h" 60 #include "KURL.h" 61 #include "Language.h" 62 #include "LocalizedStrings.h" 63 #include "MainResourceLoader.h" 64 #include "Node.h" 65 #include "NotImplemented.h" 66 #include "PageCache.h" 67 #include "Pasteboard.h" 68 #include "Path.h" 69 #include "ResourceError.h" 70 #include "ResourceHandle.h" 71 #include "ResourceLoader.h" 72 #include "Screen.h" 73 #include "Scrollbar.h" 74 #include "ScrollbarTheme.h" 75 #include "SmartReplace.h" 76 #include "Widget.h" 77 #include <stdio.h> 78 #include <stdlib.h> 79 #include <wtf/Assertions.h> 80 #include <wtf/MainThread.h> 81 #include <wtf/text/CString.h> 82 83 #if USE(JSC) 84 #include "API/JSClassRef.h" 85 #include "JNIUtilityPrivate.h" 86 #include "JavaScriptCallFrame.h" 87 #include "ScriptDebugServer.h" 88 #endif 89 90 using namespace WebCore; 91 92 /********************************************************/ 93 /* Completely empty stubs (mostly to allow DRT to run): */ 94 /********************************************************/ 95 96 namespace WebCore { 97 98 // This function tells the bridge that a resource was loaded from the cache and thus 99 // the app may update progress with the amount of data loaded. 100 void CheckCacheObjectStatus(CachedResourceLoader*, CachedResource*) 101 { 102 ASSERT_NOT_REACHED(); 103 notImplemented(); 104 } 105 106 // This class is used in conjunction with the File Upload form element, and 107 // therefore relates to the above. When a file has been selected, an icon 108 // representing the file type can be rendered next to the filename on the 109 // web page. The icon for the file is encapsulated within this class. 110 Icon::~Icon() { } 111 void Icon::paint(GraphicsContext*, const IntRect&) { } 112 113 } // namespace WebCore 114 115 // FIXME, no support for spelling yet. 116 Pasteboard* Pasteboard::generalPasteboard() 117 { 118 return new Pasteboard(); 119 } 120 121 void Pasteboard::writeSelection(Range*, bool, Frame*) 122 { 123 notImplemented(); 124 } 125 126 void Pasteboard::writePlainText(const String&) 127 { 128 notImplemented(); 129 } 130 131 void Pasteboard::writeURL(const KURL&, const String&, Frame*) 132 { 133 notImplemented(); 134 } 135 136 void Pasteboard::clear() 137 { 138 notImplemented(); 139 } 140 141 bool Pasteboard::canSmartReplace() 142 { 143 notImplemented(); 144 return false; 145 } 146 147 PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame*, PassRefPtr<Range>, bool, bool&) 148 { 149 notImplemented(); 150 return 0; 151 } 152 153 String Pasteboard::plainText(Frame*) 154 { 155 notImplemented(); 156 return String(); 157 } 158 159 Pasteboard::Pasteboard() 160 { 161 notImplemented(); 162 } 163 164 ContextMenu::ContextMenu() 165 { 166 ASSERT_NOT_REACHED(); 167 notImplemented(); 168 } 169 170 ContextMenu::~ContextMenu() 171 { 172 ASSERT_NOT_REACHED(); 173 notImplemented(); 174 } 175 176 void ContextMenu::appendItem(ContextMenuItem&) 177 { 178 ASSERT_NOT_REACHED(); 179 notImplemented(); 180 } 181 182 void ContextMenu::setPlatformDescription(PlatformMenuDescription menu) 183 { 184 ASSERT_NOT_REACHED(); 185 m_platformDescription = menu; 186 } 187 188 PlatformMenuDescription ContextMenu::platformDescription() const 189 { 190 ASSERT_NOT_REACHED(); 191 return m_platformDescription; 192 } 193 194 ContextMenuItem::ContextMenuItem(PlatformMenuItemDescription) 195 { 196 ASSERT_NOT_REACHED(); 197 notImplemented(); 198 } 199 200 ContextMenuItem::ContextMenuItem(ContextMenu*) 201 { 202 ASSERT_NOT_REACHED(); 203 notImplemented(); 204 } 205 206 ContextMenuItem::ContextMenuItem(ContextMenuItemType, ContextMenuAction, const String&, ContextMenu*) 207 { 208 ASSERT_NOT_REACHED(); 209 notImplemented(); 210 } 211 212 ContextMenuItem::~ContextMenuItem() 213 { 214 ASSERT_NOT_REACHED(); 215 notImplemented(); 216 } 217 218 PlatformMenuItemDescription ContextMenuItem::releasePlatformDescription() 219 { 220 ASSERT_NOT_REACHED(); 221 notImplemented(); 222 return m_platformDescription; 223 } 224 225 ContextMenuItemType ContextMenuItem::type() const 226 { 227 ASSERT_NOT_REACHED(); 228 notImplemented(); 229 return ActionType; 230 } 231 232 void ContextMenuItem::setType(ContextMenuItemType) 233 { 234 ASSERT_NOT_REACHED(); 235 notImplemented(); 236 } 237 238 ContextMenuAction ContextMenuItem::action() const 239 { 240 ASSERT_NOT_REACHED(); 241 notImplemented(); 242 return ContextMenuItemTagNoAction; 243 } 244 245 void ContextMenuItem::setAction(ContextMenuAction) 246 { 247 ASSERT_NOT_REACHED(); 248 notImplemented(); 249 } 250 251 String ContextMenuItem::title() const 252 { 253 ASSERT_NOT_REACHED(); 254 notImplemented(); 255 return String(); 256 } 257 258 void ContextMenuItem::setTitle(const String&) 259 { 260 ASSERT_NOT_REACHED(); 261 notImplemented(); 262 } 263 264 PlatformMenuDescription ContextMenuItem::platformSubMenu() const 265 { 266 ASSERT_NOT_REACHED(); 267 notImplemented(); 268 return 0; 269 } 270 271 void ContextMenuItem::setSubMenu(ContextMenu*) 272 { 273 ASSERT_NOT_REACHED(); 274 notImplemented(); 275 } 276 277 void ContextMenuItem::setChecked(bool) 278 { 279 ASSERT_NOT_REACHED(); 280 notImplemented(); 281 } 282 283 void ContextMenuItem::setEnabled(bool) 284 { 285 ASSERT_NOT_REACHED(); 286 notImplemented(); 287 } 288 289 // systemBeep() is called by the Editor to indicate that there was nothing to copy, and may be called from 290 // other places too. 291 void systemBeep() 292 { 293 notImplemented(); 294 } 295 296 void* WebCore::Frame::dragImageForSelection() 297 { 298 return 0; 299 } 300 301 void WebCore::Pasteboard::writeImage(WebCore::Node*, WebCore::KURL const&, WTF::String const&) {} 302 303 namespace WebCore { 304 305 IntSize dragImageSize(void*) 306 { 307 return IntSize(0, 0); 308 } 309 310 void deleteDragImage(void*) {} 311 void* createDragImageFromImage(Image*) 312 { 313 return 0; 314 } 315 316 void* dissolveDragImageToFraction(void*, float) 317 { 318 return 0; 319 } 320 321 void* createDragImageIconForCachedImage(CachedImage*) 322 { 323 return 0; 324 } 325 326 Cursor dummyCursor; 327 const Cursor& zoomInCursor() 328 { 329 return dummyCursor; 330 } 331 332 const Cursor& zoomOutCursor() 333 { 334 return dummyCursor; 335 } 336 337 const Cursor& notAllowedCursor() 338 { 339 return dummyCursor; 340 } 341 342 void* scaleDragImage(void*, FloatSize) 343 { 344 return 0; 345 } 346 347 String searchMenuRecentSearchesText() 348 { 349 return String(); 350 } 351 352 String searchMenuNoRecentSearchesText() 353 { 354 return String(); 355 } 356 357 String searchMenuClearRecentSearchesText() 358 { 359 return String(); 360 } 361 362 Vector<String> supportedKeySizes() 363 { 364 notImplemented(); 365 return Vector<String>(); 366 } 367 368 } // namespace WebCore 369 370 namespace WebCore { 371 // isCharacterSmartReplaceExempt is defined in SmartReplaceICU.cpp; in theory, we could use that one 372 // but we don't support all of the required icu functions 373 bool isCharacterSmartReplaceExempt(UChar32, bool) 374 { 375 notImplemented(); 376 return false; 377 } 378 379 } // WebCore 380 381 int MakeDataExecutable; 382 383 String KURL::fileSystemPath() const 384 { 385 notImplemented(); 386 return String(); 387 } 388 389 390 PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String&) 391 { 392 notImplemented(); 393 return 0; 394 } 395 396 397 #if USE(JSC) 398 namespace JSC { namespace Bindings { 399 bool dispatchJNICall(ExecState*, const void* targetAppletView, jobject obj, bool isStatic, JavaType returnType, 400 jmethodID methodID, jvalue* args, jvalue& result, const char* callingURL, JSValue& exceptionDescription) 401 { 402 notImplemented(); 403 return false; 404 } 405 406 } } // namespace Bindings 407 #endif 408 409 char* dirname(const char*) 410 { 411 notImplemented(); 412 return 0; 413 } 414 415 // new as of SVN change 38068, Nov 5, 2008 416 namespace WebCore { 417 void prefetchDNS(const String&) 418 { 419 notImplemented(); 420 } 421 422 PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>&) 423 { 424 notImplemented(); 425 return 0; 426 } 427 428 // ScrollbarTheme::nativeTheme() is called by RenderTextControl::calcPrefWidths() 429 // like this: scrollbarSize = ScrollbarTheme::nativeTheme()->scrollbarThickness(); 430 // with this comment: 431 // // FIXME: We should get the size of the scrollbar from the RenderTheme instead. 432 // since our text control doesn't have scrollbars, the default size of 0 width should be 433 // ok. notImplemented() is commented out below so that we can find other unresolved 434 // unimplemented functions. 435 ScrollbarTheme* ScrollbarTheme::nativeTheme() 436 { 437 /* notImplemented(); */ 438 static ScrollbarTheme theme; 439 return &theme; 440 } 441 442 } // namespace WebCore 443 444 AXObjectCache::~AXObjectCache() 445 { 446 notImplemented(); 447 } 448 449 // This value turns on or off the Mac specific Accessibility support. 450 bool AXObjectCache::gAccessibilityEnabled = false; 451 bool AXObjectCache::gAccessibilityEnhancedUserInterfaceEnabled = false; 452 453 void AXObjectCache::childrenChanged(RenderObject*) 454 { 455 notImplemented(); 456 } 457 458 void AXObjectCache::remove(RenderObject*) 459 { 460 notImplemented(); 461 } 462 463 void AXObjectCache::remove(Widget*) 464 { 465 notImplemented(); 466 } 467 468 namespace WebCore { 469 470 void setCookieStoragePrivateBrowsingEnabled(bool) 471 { 472 notImplemented(); 473 } 474 475 void startObservingCookieChanges() 476 { 477 notImplemented(); 478 } 479 480 void stopObservingCookieChanges() 481 { 482 notImplemented(); 483 } 484 485 } // namespace WebCore 486