long long PlatformSupport::databaseGetFileSize(const String& vfsFileName) { return webKitPlatformSupport()->databaseGetFileSize(WebString(vfsFileName)); }
WebString WebElement::attributeValue(unsigned index) const { if (index >= attributeCount()) return WebString(); return constUnwrap<Element>()->attributeAt(index).value(); }
Page* ChromeClientBlackBerry::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features, const NavigationAction&) { #if ENABLE_DRT if (m_webPagePrivate->m_dumpRenderTree && !m_webPagePrivate->m_dumpRenderTree->allowsOpeningWindow()) return 0; #endif PageGroupLoadDeferrer deferrer(m_webPagePrivate->m_page, true); TimerBase::fireTimersInNestedEventLoop(); int x = features.xSet ? features.x : 0; int y = features.ySet ? features.y : 0; int width = features.widthSet? features.width : -1; int height = features.heightSet ? features.height : -1; unsigned flags = 0; if (features.menuBarVisible) flags |= WebPageClient::FlagWindowHasMenuBar; if (features.statusBarVisible) flags |= WebPageClient::FlagWindowHasStatusBar; if (features.toolBarVisible) flags |= WebPageClient::FlagWindowHasToolBar; if (features.locationBarVisible) flags |= WebPageClient::FlagWindowHasLocationBar; if (features.scrollbarsVisible) flags |= WebPageClient::FlagWindowHasScrollBar; if (features.resizable) flags |= WebPageClient::FlagWindowIsResizable; if (features.fullscreen) flags |= WebPageClient::FlagWindowIsFullScreen; if (features.dialog) flags |= WebPageClient::FlagWindowIsDialog; WebPage* webPage = m_webPagePrivate->m_client->createWindow(x, y, width, height, flags, WebString(request.resourceRequest().url().string()), WebString(request.frameName())); if (!webPage) return 0; #if ENABLE_DRT if (m_webPagePrivate->m_dumpRenderTree) m_webPagePrivate->m_dumpRenderTree->windowCreated(webPage); #endif return webPage->d->m_page; }
WebString WebElement::attributeLocalName(unsigned index) const { if (index >= attributeCount()) return WebString(); return constUnwrap<Element>()->attributes().at(index).localName(); }
bool EditorClientImpl::handleEditingKeyboardEvent(KeyboardEvent* evt) { const PlatformKeyboardEvent* keyEvent = evt->keyEvent(); // do not treat this as text input if it's a system key event if (!keyEvent || keyEvent->isSystemKey()) return false; Frame* frame = evt->target()->toNode()->document()->frame(); if (!frame) return false; String commandName = interpretKeyEvent(evt); Editor::Command command = frame->editor()->command(commandName); if (keyEvent->type() == PlatformEvent::RawKeyDown) { // WebKit doesn't have enough information about mode to decide how // commands that just insert text if executed via Editor should be treated, // so we leave it upon WebCore to either handle them immediately // (e.g. Tab that changes focus) or let a keypress event be generated // (e.g. Tab that inserts a Tab character, or Enter). if (command.isTextInsertion() || commandName.isEmpty()) return false; if (command.execute(evt)) { if (m_webView->client()) m_webView->client()->didExecuteCommand(WebString(commandName)); return true; } return false; } if (command.execute(evt)) { if (m_webView->client()) m_webView->client()->didExecuteCommand(WebString(commandName)); return true; } // Here we need to filter key events. // On Gtk/Linux, it emits key events with ASCII text and ctrl on for ctrl-<x>. // In Webkit, EditorClient::handleKeyboardEvent in // WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp drop such events. // On Mac, it emits key events with ASCII text and meta on for Command-<x>. // These key events should not emit text insert event. // Alt key would be used to insert alternative character, so we should let // through. Also note that Ctrl-Alt combination equals to AltGr key which is // also used to insert alternative character. // http://code.google.com/p/chromium/issues/detail?id=10846 // Windows sets both alt and meta are on when "Alt" key pressed. // http://code.google.com/p/chromium/issues/detail?id=2215 // Also, we should not rely on an assumption that keyboards don't // send ASCII characters when pressing a control key on Windows, // which may be configured to do it so by user. // See also http://en.wikipedia.org/wiki/Keyboard_Layout // FIXME(ukai): investigate more detail for various keyboard layout. if (evt->keyEvent()->text().length() == 1) { UChar ch = evt->keyEvent()->text()[0U]; // Don't insert null or control characters as they can result in // unexpected behaviour if (ch < ' ') return false; #if !OS(WINDOWS) // Don't insert ASCII character if ctrl w/o alt or meta is on. // On Mac, we should ignore events when meta is on (Command-<x>). if (ch < 0x80) { if (evt->keyEvent()->ctrlKey() && !evt->keyEvent()->altKey()) return false; #if OS(DARWIN) if (evt->keyEvent()->metaKey()) return false; #endif } #endif } if (!frame->editor()->canEdit()) return false; return frame->editor()->insertText(evt->keyEvent()->text(), evt); }
WebString WebDocument::outgoingReferrer() { return WebString(unwrap<Document>()->outgoingReferrer()); }
Frame* FrameLoaderClientBlackBerry::dispatchCreatePage(const NavigationAction& navigation) { WebPage* webPage = m_webPagePrivate->m_client->createWindow(0, 0, -1, -1, WebPageClient::FlagWindowDefault, navigation.url().string(), WebString()); if (!webPage) return 0; return webPage->d->m_page->mainFrame(); }
WebString WebServiceWorkerResponse::blobUUID() const { if (!m_private->blobDataHandle) return WebString(); return m_private->blobDataHandle->uuid(); }
WebString WebRemoteFrameImpl::uniqueName() const { ASSERT_NOT_REACHED(); return WebString(); }
long long ChromiumBridge::databaseGetFileSize(const String& vfsFileName) { return webKitClient()->databaseGetFileSize(WebString(vfsFileName)); }
WebString WebDOMMessageEvent::origin() const { return WebString(constUnwrap<MessageEvent>()->origin()); }
int ChromiumBridge::databaseDeleteFile(const String& vfsFileName, bool syncDir) { return webKitClient()->databaseDeleteFile(WebString(vfsFileName), syncDir); }
PlatformFileHandle ChromiumBridge::databaseOpenFile(const String& vfsFileName, int desiredFlags) { return webKitClient()->databaseOpenFile(WebString(vfsFileName), desiredFlags); }
const WebString WebMediaConstraints::toString() const { if (isNull()) return WebString(""); return m_private->toString(); }
WebString WebRemoteFrameImpl::layerTreeAsText(bool showDebugInfo) const { ASSERT_NOT_REACHED(); return WebString(); }
WebString WebRemoteFrameImpl::assignedName() const { ASSERT_NOT_REACHED(); return WebString(); }
WebString WebDocument::contentAsTextForTesting() const { if (Element* documentElement = constUnwrap<Document>()->documentElement()) return WebString(documentElement->innerText()); return WebString(); }
WebString WebRemoteFrameImpl::selectionAsMarkup() const { ASSERT_NOT_REACHED(); return WebString(); }
WebString WebDocument::title() const { return WebString(constUnwrap<Document>()->title()); }
WebString WebRemoteFrameImpl::pageProperty(const WebString& propertyName, int pageIndex) { ASSERT_NOT_REACHED(); return WebString(); }
void WebSocketImpl::didClose(unsigned long bufferedAmount, ClosingHandshakeCompletionStatus status, unsigned short code, const String& reason) { #if ENABLE(WEB_SOCKETS) m_client->didClose(bufferedAmount, static_cast<WebSocketClient::ClosingHandshakeCompletionStatus>(status), code, WebString(reason)); #else ASSERT_NOT_REACHED(); #endif }
WebString WebRemoteFrameImpl::contentAsText(size_t maxChars) const { ASSERT_NOT_REACHED(); return WebString(); }
WebString WebBlob::uuid() { if (!m_private.get()) return WebString(); return m_private->uuid(); }
WebString WebRemoteFrameImpl::contentAsMarkup() const { ASSERT_NOT_REACHED(); return WebString(); }
void EditorClientImpl::updateSpellingUIWithMisspelledWord(const String& misspelledWord) { if (m_webView->spellCheckClient()) m_webView->spellCheckClient()->updateSpellingUIWithMisspelledWord(WebString(misspelledWord)); }
WebString WebRemoteFrameImpl::renderTreeAsText(RenderAsTextControls toShow) const { ASSERT_NOT_REACHED(); return WebString(); }
WebString WebElement::computeInheritedLanguage() const { return WebString(constUnwrap<Element>()->computeInheritedLanguage()); }
WebString WebRemoteFrameImpl::markerTextForListItem(const WebElement&) const { ASSERT_NOT_REACHED(); return WebString(); }
void ChromeClientBlackBerry::runOpenPanel(Frame*, PassRefPtr<FileChooser> chooser) { SharedArray<WebString> initialFiles; unsigned int initialFileSize = chooser->settings().selectedFiles.size(); if (initialFileSize > 0) initialFiles.reset(new WebString[initialFileSize]); for (unsigned i = 0; i < initialFileSize; ++i) initialFiles[i] = chooser->settings().selectedFiles[i]; SharedArray<WebString> chosenFiles; unsigned int chosenFileSize; { PageGroupLoadDeferrer deferrer(m_webPagePrivate->m_page, true); TimerBase::fireTimersInNestedEventLoop(); // FIXME: Use chooser->settings().acceptMIMETypes instead of WebString() for the second parameter. if (!m_webPagePrivate->m_client->chooseFilenames(chooser->settings().allowsMultipleFiles, WebString(), initialFiles, initialFileSize, chosenFiles, chosenFileSize)) return; } Vector<String> files(chosenFileSize); for (unsigned i = 0; i < chosenFileSize; ++i) files[i] = chosenFiles[i]; chooser->chooseFiles(files); }
int PlatformSupport::databaseDeleteFile(const String& vfsFileName, bool syncDir) { return webKitPlatformSupport()->databaseDeleteFile(WebString(vfsFileName), syncDir); }