diff options
Diffstat (limited to 'Source/WebKit/chromium/src/ChromeClientImpl.cpp')
-rw-r--r-- | Source/WebKit/chromium/src/ChromeClientImpl.cpp | 60 |
1 files changed, 52 insertions, 8 deletions
diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp index 4b68c18..f12bf03 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp @@ -54,6 +54,7 @@ #include "Node.h" #include "NotificationPresenterImpl.h" #include "Page.h" +#include "PlatformBridge.h" #include "PopupMenuChromium.h" #include "RenderWidget.h" #include "ScriptController.h" @@ -79,6 +80,7 @@ #include "WebPopupMenuInfo.h" #include "WebPopupType.h" #include "WebRect.h" +#include "WebSettings.h" #include "WebTextDirection.h" #include "WebURLRequest.h" #include "WebViewClient.h" @@ -484,14 +486,9 @@ bool ChromeClientImpl::shouldInterruptJavaScript() return false; } -bool ChromeClientImpl::tabsToLinks() const +KeyboardUIMode ChromeClientImpl::keyboardUIMode() { - // Returns true if anchors should accept keyboard focus with the tab key. - // This method is used in a convoluted fashion by EventHandler::tabsToLinks. - // It's a twisted path (self-evident, but more complicated than seems - // necessary), but the net result is that returning true from here, on a - // platform other than MAC or QT, lets anchors get keyboard focus. - return m_webView->tabsToLinks(); + return m_webView->tabsToLinks() ? KeyboardAccessTabsToLinks : KeyboardAccessDefault; } IntRect ChromeClientImpl::windowResizerRect() const @@ -505,7 +502,7 @@ IntRect ChromeClientImpl::windowResizerRect() const #if ENABLE(REGISTER_PROTOCOL_HANDLER) void ChromeClientImpl::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title) { - notImplemented(); + m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title); } #endif @@ -686,6 +683,22 @@ void ChromeClientImpl::chooseIconForFiles(const Vector<String>& filenames, FileC iconCompletion->didLoadIcon(WebData()); } +#if ENABLE(DIRECTORY_UPLOAD) +void ChromeClientImpl::enumerateChosenDirectory(const String& path, FileChooser* fileChooser) +{ + WebViewClient* client = m_webView->client(); + if (!client) + return; + + WebFileChooserCompletionImpl* chooserCompletion = + new WebFileChooserCompletionImpl(fileChooser); + + // If the enumeration can't happen, call the callback with an empty list. + if (!client->enumerateChosenDirectory(path, chooserCompletion)) + chooserCompletion->didChooseFile(WebVector<WebString>()); +} +#endif + void ChromeClientImpl::popupOpened(PopupContainer* popupContainer, const IntRect& bounds, bool handleExternally) @@ -860,6 +873,32 @@ void ChromeClientImpl::exitFullscreenForNode(WebCore::Node* node) m_webView->client()->exitFullscreenForNode(WebNode(node)); } +#if ENABLE(FULLSCREEN_API) +bool ChromeClientImpl::supportsFullScreenForElement(const WebCore::Element* element, bool withKeyboard) +{ + return m_webView->page()->settings()->fullScreenEnabled(); +} + +void ChromeClientImpl::enterFullScreenForElement(WebCore::Element* element) +{ + // FIXME: We may need to call these someplace else when window resizes. + element->document()->webkitWillEnterFullScreenForElement(element); + element->document()->webkitDidEnterFullScreenForElement(element); +} + +void ChromeClientImpl::exitFullScreenForElement(WebCore::Element* element) +{ + // FIXME: We may need to call these someplace else when window resizes. + element->document()->webkitWillExitFullScreenForElement(element); + element->document()->webkitDidExitFullScreenForElement(element); +} + +void ChromeClientImpl::fullScreenRendererChanged(RenderBox*) +{ + notImplemented(); +} +#endif + bool ChromeClientImpl::selectItemWritingDirectionIsNatural() { return false; @@ -883,4 +922,9 @@ PassRefPtr<SearchPopupMenu> ChromeClientImpl::createSearchPopupMenu(PopupMenuCli return adoptRef(new SearchPopupMenuChromium(client)); } +void ChromeClientImpl::willRunModalDialogDuringPageDismissal(const DialogType& dialogType) const +{ + PlatformBridge::histogramEnumeration("Renderer.ModalDialogsDuringPageDismissal", static_cast<int>(dialogType), static_cast<int>(NumDialogTypes)); +} + } // namespace WebKit |