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(TouchAction touchAction) override { | 206 void setTouchAction(TouchAction touchAction) override { |
205 if (WebViewClient* client = m_popup->m_webView->client()) | 207 if (WebViewClient* client = m_popup->m_webView->client()) |
206 client->setTouchAction(static_cast<WebTouchAction>(touchAction)); | 208 client->setTouchAction(static_cast<WebTouchAction>(touchAction)); |
207 } | 209 } |
208 | 210 |
209 void attachRootGraphicsLayer(GraphicsLayer* graphicsLayer, | 211 void attachRootGraphicsLayer(GraphicsLayer* graphicsLayer, |
210 LocalFrame* localRoot) override { | 212 LocalFrame* localRoot) override { |
211 m_popup->setRootGraphicsLayer(graphicsLayer); | 213 m_popup->setRootGraphicsLayer(graphicsLayer); |
212 } | 214 } |
213 | 215 |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 // A WebPagePopupImpl instance usually has two references. | 594 // A WebPagePopupImpl instance usually has two references. |
593 // - One owned by the instance itself. It represents the visible widget. | 595 // - One owned by the instance itself. It represents the visible widget. |
594 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 596 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
595 // WebPagePopupImpl to close. | 597 // WebPagePopupImpl to close. |
596 // We need them because the closing operation is asynchronous and the widget | 598 // We need them because the closing operation is asynchronous and the widget |
597 // can be closed while the WebViewImpl is unaware of it. | 599 // can be closed while the WebViewImpl is unaware of it. |
598 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 600 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
599 } | 601 } |
600 | 602 |
601 } // namespace blink | 603 } // namespace blink |
OLD | NEW |