diff options
author | Steve Block <steveblock@google.com> | 2010-09-29 17:32:26 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-09-29 17:35:08 +0100 |
commit | 68513a70bcd92384395513322f1b801e7bf9c729 (patch) | |
tree | 161b50f75a5921d61731bb25e730005994fcec85 /WebKit/chromium/src/ChromeClientImpl.cpp | |
parent | fd5c6425ce58eb75211be7718d5dee960842a37e (diff) | |
download | external_webkit-68513a70bcd92384395513322f1b801e7bf9c729.zip external_webkit-68513a70bcd92384395513322f1b801e7bf9c729.tar.gz external_webkit-68513a70bcd92384395513322f1b801e7bf9c729.tar.bz2 |
Merge WebKit at r67908: Initial merge by Git
Change-Id: I43a553e7b3299b28cb6ee8aa035ed70fe342b972
Diffstat (limited to 'WebKit/chromium/src/ChromeClientImpl.cpp')
-rw-r--r-- | WebKit/chromium/src/ChromeClientImpl.cpp | 85 |
1 files changed, 73 insertions, 12 deletions
diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp index 8a3eda6..8c13cbb 100644 --- a/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/WebKit/chromium/src/ChromeClientImpl.cpp @@ -56,11 +56,10 @@ #include "NotificationPresenterImpl.h" #include "Page.h" #include "PopupMenuChromium.h" -#include "SearchPopupMenuChromium.h" #include "ScriptController.h" +#include "SearchPopupMenuChromium.h" #include "SecurityOrigin.h" #include "SharedGraphicsContext3D.h" -#include "WebGeolocationService.h" #if USE(V8) #include "V8Proxy.h" #endif @@ -70,6 +69,7 @@ #include "WebFileChooserCompletionImpl.h" #include "WebFrameClient.h" #include "WebFrameImpl.h" +#include "WebGeolocationService.h" #include "WebInputEvent.h" #include "WebKit.h" #include "WebNode.h" @@ -103,6 +103,46 @@ static WebPopupType convertPopupType(PopupContainer::PopupType type) } } +// Converts a WebCore::AXObjectCache::AXNotification to a WebKit::WebAccessibilityNotification +static WebAccessibilityNotification toWebAccessibilityNotification(AXObjectCache::AXNotification notification) +{ + switch (notification) { + case AXObjectCache::AXActiveDescendantChanged: + return WebAccessibilityNotificationActiveDescendantChanged; + case AXObjectCache::AXCheckedStateChanged: + return WebAccessibilityNotificationCheckedStateChanged; + case AXObjectCache::AXChildrenChanged: + return WebAccessibilityNotificationChildrenChanged; + case AXObjectCache::AXFocusedUIElementChanged: + return WebAccessibilityNotificationFocusedUIElementChanged; + case AXObjectCache::AXLayoutComplete: + return WebAccessibilityNotificationLayoutComplete; + case AXObjectCache::AXLoadComplete: + return WebAccessibilityNotificationLoadComplete; + case AXObjectCache::AXSelectedChildrenChanged: + return WebAccessibilityNotificationSelectedChildrenChanged; + case AXObjectCache::AXSelectedTextChanged: + return WebAccessibilityNotificationSelectedTextChanged; + case AXObjectCache::AXValueChanged: + return WebAccessibilityNotificationValueChanged; + case AXObjectCache::AXScrolledToAnchor: + return WebAccessibilityNotificationScrolledToAnchor; + case AXObjectCache::AXLiveRegionChanged: + return WebAccessibilityNotificationLiveRegionChanged; + case AXObjectCache::AXMenuListValueChanged: + return WebAccessibilityNotificationMenuListValueChanged; + case AXObjectCache::AXRowCountChanged: + return WebAccessibilityNotificationRowCountChanged; + case AXObjectCache::AXRowCollapsed: + return WebAccessibilityNotificationRowCollapsed; + case AXObjectCache::AXRowExpanded: + return WebAccessibilityNotificationRowExpanded; + default: + ASSERT_NOT_REACHED(); + return WebAccessibilityNotificationInvalid; + } +} + ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView) : m_webView(webView) , m_toolbarsVisible(true) @@ -343,9 +383,9 @@ bool ChromeClientImpl::statusbarVisible() void ChromeClientImpl::setScrollbarsVisible(bool value) { m_scrollbarsVisible = value; - WebFrameImpl* web_frame = static_cast<WebFrameImpl*>(m_webView->mainFrame()); - if (web_frame) - web_frame->setCanHaveScrollbars(value); + WebFrameImpl* webFrame = static_cast<WebFrameImpl*>(m_webView->mainFrame()); + if (webFrame) + webFrame->setCanHaveScrollbars(value); } bool ChromeClientImpl::scrollbarsVisible() @@ -493,8 +533,15 @@ void ChromeClientImpl::invalidateContentsAndWindow(const IntRect& updateRect, bo { if (updateRect.isEmpty()) return; - if (m_webView->client()) - m_webView->client()->didInvalidateRect(updateRect); +#if USE(ACCELERATED_COMPOSITING) + if (!m_webView->isAcceleratedCompositingActive()) { +#endif + if (m_webView->client()) + m_webView->client()->didInvalidateRect(updateRect); +#if USE(ACCELERATED_COMPOSITING) + } else + m_webView->invalidateRootLayerRect(updateRect); +#endif } void ChromeClientImpl::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate) @@ -508,11 +555,18 @@ void ChromeClientImpl::scroll( const IntRect& clipRect) { m_webView->hidePopups(); - if (m_webView->client()) { - int dx = scrollDelta.width(); - int dy = scrollDelta.height(); - m_webView->client()->didScrollRect(dx, dy, clipRect); - } +#if USE(ACCELERATED_COMPOSITING) + if (!m_webView->isAcceleratedCompositingActive()) { +#endif + if (m_webView->client()) { + int dx = scrollDelta.width(); + int dy = scrollDelta.height(); + m_webView->client()->didScrollRect(dx, dy, clipRect); + } +#if USE(ACCELERATED_COMPOSITING) + } else + m_webView->scrollRootLayerRect(scrollDelta, clipRect); +#endif } IntPoint ChromeClientImpl::screenToWindow(const IntPoint&) const @@ -720,6 +774,13 @@ void ChromeClientImpl::didChangeAccessibilityObjectChildren(WebCore::Accessibili m_webView->client()->didChangeAccessibilityObjectChildren(WebAccessibilityObject(obj)); } +void ChromeClientImpl::postAccessibilityNotification(AccessibilityObject* obj, AXObjectCache::AXNotification notification) +{ + // Alert assistive technology about the accessibility object notification. + if (obj) + m_webView->client()->postAccessibilityNotification(WebAccessibilityObject(obj), toWebAccessibilityNotification(notification)); +} + #if ENABLE(NOTIFICATIONS) NotificationPresenter* ChromeClientImpl::notificationPresenter() const { |