Changeset 54069 in webkit
- Timestamp:
- Jan 29, 2010 9:56:44 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r54068 r54069 1 2010-01-29 Ben Murdoch <benm@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 [Android] Android needs functionality in the ChromeClient to be informed when touch events are and are not needed by the webpage. 6 https://bugs.webkit.org/show_bug.cgi?id=34215 7 8 Add a function on the ChromeClient that WebCore can use to inform the platform when it needs touch events. This way the platform can optimise by not forwarding the events if they are not required. 9 10 No new tests as the only implementation is specific to Android. 11 12 * dom/Document.cpp: 13 (WebCore::Document::detach): Check if this is the top level document and if so, stop forwarding touch events. 14 (WebCore::Document::addListenerTypeIfNeeded): Inform the ChromeClient it should start forwarding touch events and guard touch event code properly. 15 * history/CachedFrame.cpp: 16 (WebCore::CachedFrameBase::restore): If the document uses touch events, inform the ChromeClient to start forwarding them. 17 (WebCore::CachedFrame::CachedFrame): If the document uses touch events, inform the ChromeClient to stop forwarding them, as the document is being put into the page cache. 18 * loader/EmptyClients.h: 19 (WebCore::EmptyChromeClient::needTouchEvents): Add an empty implementation. 20 * page/ChromeClient.h: Add the needTouchEvents() function. 21 1 22 2010-01-29 Alexander Pavlov <apavlov@chromium.org> 2 23 -
trunk/WebCore/dom/Document.cpp
r54005 r54069 1519 1519 if (view) 1520 1520 view->detachCustomScrollbars(); 1521 1522 #if ENABLE(TOUCH_EVENTS) 1523 Page* ownerPage = page(); 1524 if (ownerPage && (m_frame == ownerPage->mainFrame())) { 1525 // Inform the Chrome Client that it no longer needs to 1526 // foward touch events to WebCore as the document is being 1527 // destroyed. It may start again if a subsequent page 1528 // registers a touch event listener. 1529 ownerPage->chrome()->client()->needTouchEvents(false); 1530 } 1531 #endif 1521 1532 } 1522 1533 … … 3070 3081 else if (eventType == eventNames().beforeloadEvent) 3071 3082 addListenerType(BEFORELOAD_LISTENER); 3083 #if ENABLE(TOUCH_EVENTS) 3072 3084 else if (eventType == eventNames().touchstartEvent 3073 3085 || eventType == eventNames().touchmoveEvent 3074 3086 || eventType == eventNames().touchendEvent 3075 || eventType == eventNames().touchcancelEvent) 3087 || eventType == eventNames().touchcancelEvent) { 3076 3088 addListenerType(TOUCH_LISTENER); 3089 if (Page* page = this->page()) 3090 page->chrome()->client()->needTouchEvents(true); 3091 } 3092 #endif 3077 3093 } 3078 3094 -
trunk/WebCore/history/CachedFrame.cpp
r53274 r54069 43 43 #endif 44 44 45 #if ENABLE(TOUCH_EVENTS) 46 #include "Chrome.h" 47 #include "ChromeClient.h" 48 #include "Page.h" 49 #endif 50 45 51 namespace WebCore { 46 52 … … 101 107 102 108 m_document->dispatchWindowEvent(PageTransitionEvent::create(eventNames().pageshowEvent, true), m_document); 109 #if ENABLE(TOUCH_EVENTS) 110 if (m_document->hasListenerType(Document::TOUCH_LISTENER)) 111 m_document->page()->chrome()->client()->needTouchEvents(true); 112 #endif 103 113 } 104 114 … … 146 156 LOG(PageCache, "Finished creating CachedFrame for child frame with url '%s' and DocumentLoader %p\n", m_url.string().utf8().data(), m_documentLoader.get()); 147 157 #endif 158 159 #if ENABLE(TOUCH_EVENTS) 160 if (m_document->hasListenerType(Document::TOUCH_LISTENER)) 161 m_document->page()->chrome()->client()->needTouchEvents(false); 162 #endif 148 163 } 149 164 -
trunk/WebCore/loader/EmptyClients.h
r52158 r54069 166 166 virtual void scheduleCompositingLayerSync() {}; 167 167 #endif 168 169 #if ENABLE(TOUCH_EVENTS) 170 virtual void needTouchEvents(bool) { } 171 #endif 168 172 }; 169 173 -
trunk/WebCore/page/ChromeClient.h
r50477 r54069 222 222 #endif 223 223 224 #if ENABLE(TOUCH_EVENTS) 225 virtual void needTouchEvents(bool) = 0; 226 #endif 227 224 228 protected: 225 229 virtual ~ChromeClient() { } -
trunk/WebKit/qt/ChangeLog
r54064 r54069 1 2010-01-29 Ben Murdoch <benm@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 [Android] Android needs functionality in the ChromeClient to be informed when touch events are and are not needed by the webpage. 6 https://bugs.webkit.org/show_bug.cgi?id=34215 7 8 Add needTouchEvents() to the ChromeClient which is called when the page decides it needs or no longer needs to be informed of touch events. 9 10 * WebCoreSupport/ChromeClientQt.h: 11 (WebCore::ChromeClientQt::needTouchEvents): Add an empty implementation. 12 1 13 2010-01-29 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 14 -
trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h
r53618 r54069 133 133 #endif 134 134 135 #if ENABLE(TOUCH_EVENTS) 136 virtual void needTouchEvents(bool) { } 137 #endif 138 135 139 virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); 136 140
Note: See TracChangeset
for help on using the changeset viewer.