Chromium Code Reviews| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 | 62 |
| 63 void PageWidgetDelegate::animate(Page* page, double monotonicFrameBeginTime) | 63 void PageWidgetDelegate::animate(Page* page, double monotonicFrameBeginTime) |
| 64 { | 64 { |
| 65 RefPtr<FrameView> view = mainFrameView(page); | 65 RefPtr<FrameView> view = mainFrameView(page); |
| 66 if (!view) | 66 if (!view) |
| 67 return; | 67 return; |
| 68 page->autoscrollController().animate(monotonicFrameBeginTime); | 68 page->autoscrollController().animate(monotonicFrameBeginTime); |
| 69 page->animator().serviceScriptedAnimations(monotonicFrameBeginTime); | 69 page->animator().serviceScriptedAnimations(monotonicFrameBeginTime); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void PageWidgetDelegate::layout(Page* page) | 72 void PageWidgetDelegate::layout(Page* page, LocalFrame* rootFrame) |
| 73 { | 73 { |
| 74 if (!page || !page->mainFrame()) | 74 if (!page) |
|
eseidel
2014/07/11 16:33:03
Why is it valid to call this method with a null pa
kenrb
2014/07/11 20:03:33
It was added explicitly in r169672. I am not certa
dcheng
2014/07/11 21:22:52
Do you mind filing a bug and assigning it to me? T
| |
| 75 return; | 75 return; |
| 76 page->animator().updateLayoutAndStyleForPainting(); | 76 |
| 77 if (!rootFrame) { | |
|
eseidel
2014/07/11 16:33:03
Why not make this a default =0 argument then? Or
kenrb
2014/07/11 20:03:33
Done.
| |
| 78 if (!page->mainFrame() || !page->mainFrame()->isLocalFrame()) | |
|
eseidel
2014/07/11 16:33:03
How can a page not have a mainFrame? Or a page's
kenrb
2014/07/11 20:03:33
I don't know about a null mainFrame (see above rev
| |
| 79 return; | |
| 80 rootFrame = toLocalFrame(page->mainFrame()); | |
| 81 } | |
| 82 | |
| 83 page->animator().updateLayoutAndStyleForPainting(rootFrame); | |
| 77 } | 84 } |
| 78 | 85 |
| 79 void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background) | 86 void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background) |
| 80 { | 87 { |
| 81 if (rect.isEmpty()) | 88 if (rect.isEmpty()) |
| 82 return; | 89 return; |
| 83 GraphicsContext gc(canvas); | 90 GraphicsContext gc(canvas); |
| 84 gc.setCertainlyOpaque(background == Opaque); | 91 gc.setCertainlyOpaque(background == Opaque); |
| 85 gc.applyDeviceScaleFactor(page->deviceScaleFactor()); | 92 gc.applyDeviceScaleFactor(page->deviceScaleFactor()); |
| 86 gc.setUseHighResMarkers(page->deviceScaleFactor() > 1.5f); | 93 gc.setUseHighResMarkers(page->deviceScaleFactor() > 1.5f); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 { | 212 { |
| 206 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m ainFrame.view(), event)); | 213 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m ainFrame.view(), event)); |
| 207 } | 214 } |
| 208 | 215 |
| 209 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo uchEvent& event) | 216 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo uchEvent& event) |
| 210 { | 217 { |
| 211 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m ainFrame.view(), event)); | 218 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m ainFrame.view(), event)); |
| 212 } | 219 } |
| 213 | 220 |
| 214 } | 221 } |
| OLD | NEW |