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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 void* webView() const override { return m_popup->m_webView; } | 151 void* webView() const override { return m_popup->m_webView; } |
152 | 152 |
153 IntSize minimumWindowSize() const override { return IntSize(0, 0); } | 153 IntSize minimumWindowSize() const override { return IntSize(0, 0); } |
154 | 154 |
155 void setCursor(const Cursor& cursor, LocalFrame* localFrame) override { | 155 void setCursor(const Cursor& cursor, LocalFrame* localFrame) override { |
156 m_popup->m_widgetClient->didChangeCursor(WebCursorInfo(cursor)); | 156 m_popup->m_widgetClient->didChangeCursor(WebCursorInfo(cursor)); |
157 } | 157 } |
158 | 158 |
159 void setEventListenerProperties( | 159 void setEventListenerProperties( |
| 160 LocalFrame* frame, |
160 WebEventListenerClass eventClass, | 161 WebEventListenerClass eventClass, |
161 WebEventListenerProperties properties) override { | 162 WebEventListenerProperties properties) override { |
| 163 DCHECK(frame->isMainFrame()); |
162 if (m_popup->m_layerTreeView) { | 164 if (m_popup->m_layerTreeView) { |
163 m_popup->m_layerTreeView->setEventListenerProperties(eventClass, | 165 m_popup->m_layerTreeView->setEventListenerProperties(eventClass, |
164 properties); | 166 properties); |
165 if (eventClass == WebEventListenerClass::TouchStartOrMove) { | 167 if (eventClass == WebEventListenerClass::TouchStartOrMove) { |
166 m_popup->widgetClient()->hasTouchEventHandlers( | 168 m_popup->widgetClient()->hasTouchEventHandlers( |
167 properties != WebEventListenerProperties::Nothing || | 169 properties != WebEventListenerProperties::Nothing || |
168 eventListenerProperties(WebEventListenerClass::TouchEndOrCancel) != | 170 eventListenerProperties(frame, |
| 171 WebEventListenerClass::TouchEndOrCancel) != |
169 WebEventListenerProperties::Nothing); | 172 WebEventListenerProperties::Nothing); |
170 } else if (eventClass == WebEventListenerClass::TouchEndOrCancel) { | 173 } else if (eventClass == WebEventListenerClass::TouchEndOrCancel) { |
171 m_popup->widgetClient()->hasTouchEventHandlers( | 174 m_popup->widgetClient()->hasTouchEventHandlers( |
172 properties != WebEventListenerProperties::Nothing || | 175 properties != WebEventListenerProperties::Nothing || |
173 eventListenerProperties(WebEventListenerClass::TouchStartOrMove) != | 176 eventListenerProperties(frame, |
| 177 WebEventListenerClass::TouchStartOrMove) != |
174 WebEventListenerProperties::Nothing); | 178 WebEventListenerProperties::Nothing); |
175 } | 179 } |
176 } else { | 180 } else { |
177 m_popup->widgetClient()->hasTouchEventHandlers(true); | 181 m_popup->widgetClient()->hasTouchEventHandlers(true); |
178 } | 182 } |
179 } | 183 } |
180 WebEventListenerProperties eventListenerProperties( | 184 WebEventListenerProperties eventListenerProperties( |
| 185 LocalFrame*, |
181 WebEventListenerClass eventClass) const override { | 186 WebEventListenerClass eventClass) const override { |
182 if (m_popup->m_layerTreeView) | 187 if (m_popup->m_layerTreeView) |
183 return m_popup->m_layerTreeView->eventListenerProperties(eventClass); | 188 return m_popup->m_layerTreeView->eventListenerProperties(eventClass); |
184 return WebEventListenerProperties::Nothing; | 189 return WebEventListenerProperties::Nothing; |
185 } | 190 } |
186 | 191 |
187 void setHasScrollEventHandlers(bool hasEventHandlers) override { | 192 void setHasScrollEventHandlers(bool hasEventHandlers) override { |
188 if (m_popup->m_layerTreeView) | 193 if (m_popup->m_layerTreeView) |
189 m_popup->m_layerTreeView->setHaveScrollEventHandlers(hasEventHandlers); | 194 m_popup->m_layerTreeView->setHaveScrollEventHandlers(hasEventHandlers); |
190 } | 195 } |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 // A WebPagePopupImpl instance usually has two references. | 587 // A WebPagePopupImpl instance usually has two references. |
583 // - One owned by the instance itself. It represents the visible widget. | 588 // - One owned by the instance itself. It represents the visible widget. |
584 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 589 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
585 // WebPagePopupImpl to close. | 590 // WebPagePopupImpl to close. |
586 // We need them because the closing operation is asynchronous and the widget | 591 // We need them because the closing operation is asynchronous and the widget |
587 // can be closed while the WebViewImpl is unaware of it. | 592 // can be closed while the WebViewImpl is unaware of it. |
588 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 593 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
589 } | 594 } |
590 | 595 |
591 } // namespace blink | 596 } // namespace blink |
OLD | NEW |