| Index: third_party/WebKit/Source/web/ChromeClientImpl.cpp
|
| diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
|
| index 9a15330d50765bcedde5fba60c91fe238ad266b7..c981b44542ba3e0c86e2345b0e001a22eb96ea6c 100644
|
| --- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
|
| @@ -915,19 +915,40 @@ bool ChromeClientImpl::shouldOpenModalDialogDuringPageDismissal(
|
| }
|
|
|
| void ChromeClientImpl::setEventListenerProperties(
|
| + LocalFrame* frame,
|
| WebEventListenerClass eventClass,
|
| WebEventListenerProperties properties) {
|
| - if (WebLayerTreeView* treeView = m_webView->layerTreeView()) {
|
| + WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame);
|
| + if (!webFrame || webFrame->localRoot() == m_webView->mainFrame()) {
|
| + setEventListenerProperties(m_webView->layerTreeView(), eventClass,
|
| + properties);
|
| + } else {
|
| + WebWidgetClient* client = WebLocalFrameImpl::fromFrame(frame)
|
| + ->localRoot()
|
| + ->frameWidget()
|
| + ->client();
|
| + // TODO(wjmaclean): Do we need to inform the WebView about these also?
|
| + setEventListenerProperties(client->layerTreeView(), eventClass, properties);
|
| + }
|
| +}
|
| +
|
| +void ChromeClientImpl::setEventListenerProperties(
|
| + WebLayerTreeView* treeView,
|
| + WebEventListenerClass eventClass,
|
| + WebEventListenerProperties properties) {
|
| + if (treeView) {
|
| treeView->setEventListenerProperties(eventClass, properties);
|
| if (eventClass == WebEventListenerClass::TouchStartOrMove) {
|
| m_webView->hasTouchEventHandlers(
|
| properties != WebEventListenerProperties::Nothing ||
|
| - eventListenerProperties(WebEventListenerClass::TouchEndOrCancel) !=
|
| + eventListenerProperties(treeView,
|
| + WebEventListenerClass::TouchEndOrCancel) !=
|
| WebEventListenerProperties::Nothing);
|
| } else if (eventClass == WebEventListenerClass::TouchEndOrCancel) {
|
| m_webView->hasTouchEventHandlers(
|
| properties != WebEventListenerProperties::Nothing ||
|
| - eventListenerProperties(WebEventListenerClass::TouchStartOrMove) !=
|
| + eventListenerProperties(treeView,
|
| + WebEventListenerClass::TouchStartOrMove) !=
|
| WebEventListenerProperties::Nothing);
|
| }
|
| } else {
|
| @@ -943,8 +964,21 @@ void ChromeClientImpl::beginLifecycleUpdates() {
|
| }
|
|
|
| WebEventListenerProperties ChromeClientImpl::eventListenerProperties(
|
| + LocalFrame* frame,
|
| WebEventListenerClass eventClass) const {
|
| - if (WebLayerTreeView* treeView = m_webView->layerTreeView())
|
| + WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame);
|
| + if (!webFrame || webFrame->localRoot() == m_webView->mainFrame())
|
| + return eventListenerProperties(m_webView->layerTreeView(), eventClass);
|
| +
|
| + WebWidgetClient* client =
|
| + WebLocalFrameImpl::fromFrame(frame)->localRoot()->frameWidget()->client();
|
| + return eventListenerProperties(client->layerTreeView(), eventClass);
|
| +}
|
| +
|
| +WebEventListenerProperties ChromeClientImpl::eventListenerProperties(
|
| + WebLayerTreeView* treeView,
|
| + WebEventListenerClass eventClass) const {
|
| + if (treeView)
|
| return treeView->eventListenerProperties(eventClass);
|
| return WebEventListenerProperties::Nothing;
|
| }
|
|
|