| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "web/PageWidgetDelegate.h" | 32 #include "web/PageWidgetDelegate.h" |
| 33 | 33 |
| 34 #include "core/frame/FrameProtector.h" |
| 34 #include "core/frame/FrameView.h" | 35 #include "core/frame/FrameView.h" |
| 35 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
| 36 #include "core/page/AutoscrollController.h" | 37 #include "core/page/AutoscrollController.h" |
| 37 #include "core/page/EventHandler.h" | 38 #include "core/page/EventHandler.h" |
| 38 #include "core/page/Page.h" | 39 #include "core/page/Page.h" |
| 39 #include "core/rendering/RenderView.h" | 40 #include "core/rendering/RenderView.h" |
| 40 #include "core/rendering/compositing/RenderLayerCompositor.h" | 41 #include "core/rendering/compositing/RenderLayerCompositor.h" |
| 41 #include "platform/Logging.h" | 42 #include "platform/Logging.h" |
| 42 #include "platform/graphics/GraphicsContext.h" | 43 #include "platform/graphics/GraphicsContext.h" |
| 43 #include "public/web/WebInputEvent.h" | 44 #include "public/web/WebInputEvent.h" |
| 44 #include "web/PageOverlayList.h" | 45 #include "web/PageOverlayList.h" |
| 45 #include "web/WebInputEventConversion.h" | 46 #include "web/WebInputEventConversion.h" |
| 46 #include "wtf/CurrentTime.h" | 47 #include "wtf/CurrentTime.h" |
| 47 | 48 |
| 48 namespace blink { | 49 namespace blink { |
| 49 | 50 |
| 50 static inline FrameView* rootFrameView(Page* page, LocalFrame* rootFrame) | 51 static inline FrameView* rootFrameView(Page* page, LocalFrame* rootFrame) |
| 51 { | 52 { |
| 52 if (rootFrame) | 53 if (rootFrame) |
| 53 return rootFrame->view(); | 54 return rootFrame->view(); |
| 54 if (!page) | 55 if (!page) |
| 55 return 0; | 56 return 0; |
| 56 if (!page->mainFrame()->isLocalFrame()) | 57 if (!page->mainFrame()->isLocalFrame()) |
| 57 return 0; | 58 return 0; |
| 58 return toLocalFrame(page->mainFrame())->view(); | 59 return toLocalFrame(page->mainFrame())->view(); |
| 59 } | 60 } |
| 60 | 61 |
| 61 void PageWidgetDelegate::animate(Page* page, double monotonicFrameBeginTime, Loc
alFrame* rootFrame) | 62 void PageWidgetDelegate::animate(Page* page, double monotonicFrameBeginTime, Loc
alFrame* rootFrame) |
| 62 { | 63 { |
| 63 RefPtr<FrameView> view = rootFrameView(page, rootFrame); | 64 FrameView* view = rootFrameView(page, rootFrame); |
| 64 WTF_LOG(ScriptedAnimationController, "PageWidgetDelegate::animate: view = %d
", !view ? 0 : 1); | 65 WTF_LOG(ScriptedAnimationController, "PageWidgetDelegate::animate: view = %d
", !view ? 0 : 1); |
| 65 if (!view) | 66 if (!view) |
| 66 return; | 67 return; |
| 68 |
| 69 FrameViewProtector protect(view); |
| 67 page->autoscrollController().animate(monotonicFrameBeginTime); | 70 page->autoscrollController().animate(monotonicFrameBeginTime); |
| 68 page->animator().serviceScriptedAnimations(monotonicFrameBeginTime); | 71 page->animator().serviceScriptedAnimations(monotonicFrameBeginTime); |
| 69 } | 72 } |
| 70 | 73 |
| 71 void PageWidgetDelegate::layout(Page* page, LocalFrame* rootFrame) | 74 void PageWidgetDelegate::layout(Page* page, LocalFrame* rootFrame) |
| 72 { | 75 { |
| 73 if (!page) | 76 if (!page) |
| 74 return; | 77 return; |
| 75 | 78 |
| 76 if (!rootFrame) { | 79 if (!rootFrame) { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 { | 215 { |
| 213 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m
ainFrame.view(), event)); | 216 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m
ainFrame.view(), event)); |
| 214 } | 217 } |
| 215 | 218 |
| 216 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo
uchEvent& event) | 219 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo
uchEvent& event) |
| 217 { | 220 { |
| 218 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m
ainFrame.view(), event)); | 221 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m
ainFrame.view(), event)); |
| 219 } | 222 } |
| 220 | 223 |
| 221 } // namespace blink | 224 } // namespace blink |
| OLD | NEW |