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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 void* webView() const override { return m_popup->m_webView; } | 157 void* webView() const override { return m_popup->m_webView; } |
158 | 158 |
159 IntSize minimumWindowSize() const override { return IntSize(0, 0); } | 159 IntSize minimumWindowSize() const override { return IntSize(0, 0); } |
160 | 160 |
161 void setCursor(const Cursor& cursor, LocalFrame* localFrame) override { | 161 void setCursor(const Cursor& cursor, LocalFrame* localFrame) override { |
162 m_popup->m_widgetClient->didChangeCursor(WebCursorInfo(cursor)); | 162 m_popup->m_widgetClient->didChangeCursor(WebCursorInfo(cursor)); |
163 } | 163 } |
164 | 164 |
165 void setEventListenerProperties( | 165 void setEventListenerProperties( |
| 166 LocalFrame* frame, |
166 WebEventListenerClass eventClass, | 167 WebEventListenerClass eventClass, |
167 WebEventListenerProperties properties) override { | 168 WebEventListenerProperties properties) override { |
168 if (m_popup->m_layerTreeView) { | 169 DCHECK(frame->isMainFrame()); |
169 m_popup->m_layerTreeView->setEventListenerProperties(eventClass, | 170 WebWidgetClient* client = m_popup->widgetClient(); |
170 properties); | 171 if (WebLayerTreeView* layerTreeView = m_popup->m_layerTreeView) { |
| 172 layerTreeView->setEventListenerProperties(eventClass, properties); |
171 if (eventClass == WebEventListenerClass::TouchStartOrMove) { | 173 if (eventClass == WebEventListenerClass::TouchStartOrMove) { |
172 m_popup->widgetClient()->hasTouchEventHandlers( | 174 client->hasTouchEventHandlers( |
173 properties != WebEventListenerProperties::Nothing || | 175 properties != WebEventListenerProperties::Nothing || |
174 eventListenerProperties(WebEventListenerClass::TouchEndOrCancel) != | 176 eventListenerProperties(frame, |
| 177 WebEventListenerClass::TouchEndOrCancel) != |
175 WebEventListenerProperties::Nothing); | 178 WebEventListenerProperties::Nothing); |
176 } else if (eventClass == WebEventListenerClass::TouchEndOrCancel) { | 179 } else if (eventClass == WebEventListenerClass::TouchEndOrCancel) { |
177 m_popup->widgetClient()->hasTouchEventHandlers( | 180 client->hasTouchEventHandlers( |
178 properties != WebEventListenerProperties::Nothing || | 181 properties != WebEventListenerProperties::Nothing || |
179 eventListenerProperties(WebEventListenerClass::TouchStartOrMove) != | 182 eventListenerProperties(frame, |
| 183 WebEventListenerClass::TouchStartOrMove) != |
180 WebEventListenerProperties::Nothing); | 184 WebEventListenerProperties::Nothing); |
181 } | 185 } |
182 } else { | 186 } else { |
183 m_popup->widgetClient()->hasTouchEventHandlers(true); | 187 client->hasTouchEventHandlers(true); |
184 } | 188 } |
185 } | 189 } |
186 WebEventListenerProperties eventListenerProperties( | 190 WebEventListenerProperties eventListenerProperties( |
| 191 LocalFrame*, |
187 WebEventListenerClass eventClass) const override { | 192 WebEventListenerClass eventClass) const override { |
188 if (m_popup->m_layerTreeView) | 193 if (m_popup->m_layerTreeView) { |
189 return m_popup->m_layerTreeView->eventListenerProperties(eventClass); | 194 return m_popup->m_layerTreeView->eventListenerProperties(eventClass); |
| 195 } |
190 return WebEventListenerProperties::Nothing; | 196 return WebEventListenerProperties::Nothing; |
191 } | 197 } |
192 | 198 |
193 void setHasScrollEventHandlers(bool hasEventHandlers) override { | 199 void setHasScrollEventHandlers(LocalFrame* frame, |
| 200 bool hasEventHandlers) override { |
| 201 DCHECK(frame->isMainFrame()); |
194 if (m_popup->m_layerTreeView) | 202 if (m_popup->m_layerTreeView) |
195 m_popup->m_layerTreeView->setHaveScrollEventHandlers(hasEventHandlers); | 203 m_popup->m_layerTreeView->setHaveScrollEventHandlers(hasEventHandlers); |
196 } | 204 } |
197 | 205 |
198 bool hasScrollEventHandlers() const override { | |
199 if (m_popup->m_layerTreeView) | |
200 return m_popup->m_layerTreeView->haveScrollEventHandlers(); | |
201 return false; | |
202 } | |
203 | |
204 void setTouchAction(LocalFrame* frame, TouchAction touchAction) override { | 206 void setTouchAction(LocalFrame* frame, TouchAction touchAction) override { |
205 DCHECK(frame); | 207 DCHECK(frame); |
206 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame); | 208 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame); |
207 WebFrameWidgetBase* widget = webFrame->localRoot()->frameWidget(); | 209 WebFrameWidgetBase* widget = webFrame->localRoot()->frameWidget(); |
208 if (!widget) | 210 if (!widget) |
209 return; | 211 return; |
210 | 212 |
211 if (WebWidgetClient* client = widget->client()) | 213 if (WebWidgetClient* client = widget->client()) |
212 client->setTouchAction(static_cast<WebTouchAction>(touchAction)); | 214 client->setTouchAction(static_cast<WebTouchAction>(touchAction)); |
213 } | 215 } |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 // A WebPagePopupImpl instance usually has two references. | 600 // A WebPagePopupImpl instance usually has two references. |
599 // - One owned by the instance itself. It represents the visible widget. | 601 // - One owned by the instance itself. It represents the visible widget. |
600 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 602 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
601 // WebPagePopupImpl to close. | 603 // WebPagePopupImpl to close. |
602 // We need them because the closing operation is asynchronous and the widget | 604 // We need them because the closing operation is asynchronous and the widget |
603 // can be closed while the WebViewImpl is unaware of it. | 605 // can be closed while the WebViewImpl is unaware of it. |
604 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 606 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
605 } | 607 } |
606 | 608 |
607 } // namespace blink | 609 } // namespace blink |
OLD | NEW |