| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 158 } |
| 159 | 159 |
| 160 void setCursor(const Cursor& cursor, LocalFrame* localRoot) override | 160 void setCursor(const Cursor& cursor, LocalFrame* localRoot) override |
| 161 { | 161 { |
| 162 if (m_popup->m_webView->client()) | 162 if (m_popup->m_webView->client()) |
| 163 m_popup->m_webView->client()->didChangeCursor(WebCursorInfo(cursor))
; | 163 m_popup->m_webView->client()->didChangeCursor(WebCursorInfo(cursor))
; |
| 164 } | 164 } |
| 165 | 165 |
| 166 void setEventListenerProperties(WebEventListenerClass eventClass, WebEventLi
stenerProperties properties) override | 166 void setEventListenerProperties(WebEventListenerClass eventClass, WebEventLi
stenerProperties properties) override |
| 167 { | 167 { |
| 168 if (eventClass == WebEventListenerClass::Touch) | 168 if (m_popup->m_layerTreeView) { |
| 169 m_popup->widgetClient()->hasTouchEventHandlers(properties != WebEven
tListenerProperties::Nothing); | |
| 170 if (m_popup->m_layerTreeView) | |
| 171 m_popup->m_layerTreeView->setEventListenerProperties(eventClass, pro
perties); | 169 m_popup->m_layerTreeView->setEventListenerProperties(eventClass, pro
perties); |
| 170 if (eventClass == WebEventListenerClass::TouchStartOrMove) { |
| 171 m_popup->widgetClient()->hasTouchEventHandlers(properties != Web
EventListenerProperties::Nothing || eventListenerProperties(WebEventListenerClas
s::TouchEndOrCancel) != WebEventListenerProperties::Nothing); |
| 172 } else if (eventClass == WebEventListenerClass::TouchEndOrCancel) { |
| 173 m_popup->widgetClient()->hasTouchEventHandlers(properties != Web
EventListenerProperties::Nothing || eventListenerProperties(WebEventListenerClas
s::TouchStartOrMove) != WebEventListenerProperties::Nothing); |
| 174 } |
| 175 } else { |
| 176 m_popup->widgetClient()->hasTouchEventHandlers(true); |
| 177 } |
| 172 } | 178 } |
| 173 WebEventListenerProperties eventListenerProperties(WebEventListenerClass eve
ntClass) const override | 179 WebEventListenerProperties eventListenerProperties(WebEventListenerClass eve
ntClass) const override |
| 174 { | 180 { |
| 175 if (m_popup->m_layerTreeView) | 181 if (m_popup->m_layerTreeView) |
| 176 return m_popup->m_layerTreeView->eventListenerProperties(eventClass)
; | 182 return m_popup->m_layerTreeView->eventListenerProperties(eventClass)
; |
| 177 return WebEventListenerProperties::Nothing; | 183 return WebEventListenerProperties::Nothing; |
| 178 } | 184 } |
| 179 | 185 |
| 180 void setHaveScrollEventHandlers(bool hasEventHandlers) override | 186 void setHasScrollEventHandlers(bool hasEventHandlers) override |
| 181 { | 187 { |
| 182 if (m_popup->m_layerTreeView) | 188 if (m_popup->m_layerTreeView) |
| 183 m_popup->m_layerTreeView->setHaveScrollEventHandlers(hasEventHandler
s); | 189 m_popup->m_layerTreeView->setHaveScrollEventHandlers(hasEventHandler
s); |
| 184 } | 190 } |
| 185 | 191 |
| 186 bool haveScrollEventHandlers() const override | 192 bool hasScrollEventHandlers() const override |
| 187 { | 193 { |
| 188 if (m_popup->m_layerTreeView) | 194 if (m_popup->m_layerTreeView) |
| 189 return m_popup->m_layerTreeView->haveScrollEventHandlers(); | 195 return m_popup->m_layerTreeView->haveScrollEventHandlers(); |
| 190 return false; | 196 return false; |
| 191 } | 197 } |
| 192 | 198 |
| 193 void setTouchAction(TouchAction touchAction) override | 199 void setTouchAction(TouchAction touchAction) override |
| 194 { | 200 { |
| 195 if (WebViewClient* client = m_popup->m_webView->client()) | 201 if (WebViewClient* client = m_popup->m_webView->client()) |
| 196 client->setTouchAction(static_cast<WebTouchAction>(touchAction)); | 202 client->setTouchAction(static_cast<WebTouchAction>(touchAction)); |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 // A WebPagePopupImpl instance usually has two references. | 566 // A WebPagePopupImpl instance usually has two references. |
| 561 // - One owned by the instance itself. It represents the visible widget. | 567 // - One owned by the instance itself. It represents the visible widget. |
| 562 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 568 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
| 563 // WebPagePopupImpl to close. | 569 // WebPagePopupImpl to close. |
| 564 // We need them because the closing operation is asynchronous and the widget | 570 // We need them because the closing operation is asynchronous and the widget |
| 565 // can be closed while the WebViewImpl is unaware of it. | 571 // can be closed while the WebViewImpl is unaware of it. |
| 566 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 572 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
| 567 } | 573 } |
| 568 | 574 |
| 569 } // namespace blink | 575 } // namespace blink |
| OLD | NEW |