Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: third_party/WebKit/Source/web/WebPagePopupImpl.cpp

Issue 2649573003: Revert of Move compositor InputHandler from RenderViewImpl to RenderWidget. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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,
167 WebEventListenerClass eventClass, 166 WebEventListenerClass eventClass,
168 WebEventListenerProperties properties) override { 167 WebEventListenerProperties properties) override {
169 DCHECK(frame->isMainFrame()); 168 if (m_popup->m_layerTreeView) {
170 WebWidgetClient* client = m_popup->widgetClient(); 169 m_popup->m_layerTreeView->setEventListenerProperties(eventClass,
171 if (WebLayerTreeView* layerTreeView = m_popup->m_layerTreeView) { 170 properties);
172 layerTreeView->setEventListenerProperties(eventClass, properties);
173 if (eventClass == WebEventListenerClass::TouchStartOrMove) { 171 if (eventClass == WebEventListenerClass::TouchStartOrMove) {
174 client->hasTouchEventHandlers( 172 m_popup->widgetClient()->hasTouchEventHandlers(
175 properties != WebEventListenerProperties::Nothing || 173 properties != WebEventListenerProperties::Nothing ||
176 eventListenerProperties(frame, 174 eventListenerProperties(WebEventListenerClass::TouchEndOrCancel) !=
177 WebEventListenerClass::TouchEndOrCancel) !=
178 WebEventListenerProperties::Nothing); 175 WebEventListenerProperties::Nothing);
179 } else if (eventClass == WebEventListenerClass::TouchEndOrCancel) { 176 } else if (eventClass == WebEventListenerClass::TouchEndOrCancel) {
180 client->hasTouchEventHandlers( 177 m_popup->widgetClient()->hasTouchEventHandlers(
181 properties != WebEventListenerProperties::Nothing || 178 properties != WebEventListenerProperties::Nothing ||
182 eventListenerProperties(frame, 179 eventListenerProperties(WebEventListenerClass::TouchStartOrMove) !=
183 WebEventListenerClass::TouchStartOrMove) !=
184 WebEventListenerProperties::Nothing); 180 WebEventListenerProperties::Nothing);
185 } 181 }
186 } else { 182 } else {
187 client->hasTouchEventHandlers(true); 183 m_popup->widgetClient()->hasTouchEventHandlers(true);
188 } 184 }
189 } 185 }
190 WebEventListenerProperties eventListenerProperties( 186 WebEventListenerProperties eventListenerProperties(
191 LocalFrame*,
192 WebEventListenerClass eventClass) const override { 187 WebEventListenerClass eventClass) const override {
193 if (m_popup->m_layerTreeView) { 188 if (m_popup->m_layerTreeView)
194 return m_popup->m_layerTreeView->eventListenerProperties(eventClass); 189 return m_popup->m_layerTreeView->eventListenerProperties(eventClass);
195 }
196 return WebEventListenerProperties::Nothing; 190 return WebEventListenerProperties::Nothing;
197 } 191 }
198 192
199 void setHasScrollEventHandlers(LocalFrame* frame, 193 void setHasScrollEventHandlers(bool hasEventHandlers) override {
200 bool hasEventHandlers) override {
201 DCHECK(frame->isMainFrame());
202 if (m_popup->m_layerTreeView) 194 if (m_popup->m_layerTreeView)
203 m_popup->m_layerTreeView->setHaveScrollEventHandlers(hasEventHandlers); 195 m_popup->m_layerTreeView->setHaveScrollEventHandlers(hasEventHandlers);
204 } 196 }
205 197
198 bool hasScrollEventHandlers() const override {
199 if (m_popup->m_layerTreeView)
200 return m_popup->m_layerTreeView->haveScrollEventHandlers();
201 return false;
202 }
203
206 void setTouchAction(LocalFrame* frame, TouchAction touchAction) override { 204 void setTouchAction(LocalFrame* frame, TouchAction touchAction) override {
207 DCHECK(frame); 205 DCHECK(frame);
208 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame); 206 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame);
209 WebFrameWidgetBase* widget = webFrame->localRoot()->frameWidget(); 207 WebFrameWidgetBase* widget = webFrame->localRoot()->frameWidget();
210 if (!widget) 208 if (!widget)
211 return; 209 return;
212 210
213 if (WebWidgetClient* client = widget->client()) 211 if (WebWidgetClient* client = widget->client())
214 client->setTouchAction(static_cast<WebTouchAction>(touchAction)); 212 client->setTouchAction(static_cast<WebTouchAction>(touchAction));
215 } 213 }
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 // A WebPagePopupImpl instance usually has two references. 609 // A WebPagePopupImpl instance usually has two references.
612 // - One owned by the instance itself. It represents the visible widget. 610 // - One owned by the instance itself. It represents the visible widget.
613 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the 611 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the
614 // WebPagePopupImpl to close. 612 // WebPagePopupImpl to close.
615 // We need them because the closing operation is asynchronous and the widget 613 // We need them because the closing operation is asynchronous and the widget
616 // can be closed while the WebViewImpl is unaware of it. 614 // can be closed while the WebViewImpl is unaware of it.
617 return adoptRef(new WebPagePopupImpl(client)).leakRef(); 615 return adoptRef(new WebPagePopupImpl(client)).leakRef();
618 } 616 }
619 617
620 } // namespace blink 618 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/ChromeClientImpl.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698