| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 IntRect pageRect = m_pageRects[pageNumber]; | 350 IntRect pageRect = m_pageRects[pageNumber]; |
| 351 return m_printedPageWidth / pageRect.width(); | 351 return m_printedPageWidth / pageRect.width(); |
| 352 } | 352 } |
| 353 | 353 |
| 354 float spoolSinglePage(WebCanvas* canvas, int pageNumber) | 354 float spoolSinglePage(WebCanvas* canvas, int pageNumber) |
| 355 { | 355 { |
| 356 dispatchEventsForPrintingOnAllFrames(); | 356 dispatchEventsForPrintingOnAllFrames(); |
| 357 if (!frame()->document() || !frame()->document()->layoutView()) | 357 if (!frame()->document() || !frame()->document()->layoutView()) |
| 358 return 0; | 358 return 0; |
| 359 | 359 |
| 360 frame()->view()->updateLayoutAndStyleForPainting(); | 360 frame()->view()->updateAllLifecyclePhases(); |
| 361 if (!frame()->document() || !frame()->document()->layoutView()) | 361 if (!frame()->document() || !frame()->document()->layoutView()) |
| 362 return 0; | 362 return 0; |
| 363 | 363 |
| 364 IntRect pageRect = m_pageRects[pageNumber]; | 364 IntRect pageRect = m_pageRects[pageNumber]; |
| 365 SkPictureBuilder pictureBuilder(pageRect, &skia::getMetaData(*canvas)); | 365 SkPictureBuilder pictureBuilder(pageRect, &skia::getMetaData(*canvas)); |
| 366 pictureBuilder.context().setPrinting(true); | 366 pictureBuilder.context().setPrinting(true); |
| 367 | 367 |
| 368 float scale = spoolPage(pictureBuilder.context(), pageNumber); | 368 float scale = spoolPage(pictureBuilder.context(), pageNumber); |
| 369 pictureBuilder.endRecording()->playback(canvas); | 369 pictureBuilder.endRecording()->playback(canvas); |
| 370 outputLinkedDestinations(canvas, pageRect); | 370 outputLinkedDestinations(canvas, pageRect); |
| 371 return scale; | 371 return scale; |
| 372 } | 372 } |
| 373 | 373 |
| 374 void spoolAllPagesWithBoundaries(WebCanvas* canvas, const FloatSize& pageSiz
eInPixels) | 374 void spoolAllPagesWithBoundaries(WebCanvas* canvas, const FloatSize& pageSiz
eInPixels) |
| 375 { | 375 { |
| 376 dispatchEventsForPrintingOnAllFrames(); | 376 dispatchEventsForPrintingOnAllFrames(); |
| 377 if (!frame()->document() || !frame()->document()->layoutView()) | 377 if (!frame()->document() || !frame()->document()->layoutView()) |
| 378 return; | 378 return; |
| 379 | 379 |
| 380 frame()->view()->updateLayoutAndStyleForPainting(); | 380 frame()->view()->updateAllLifecyclePhases(); |
| 381 if (!frame()->document() || !frame()->document()->layoutView()) | 381 if (!frame()->document() || !frame()->document()->layoutView()) |
| 382 return; | 382 return; |
| 383 | 383 |
| 384 float pageHeight; | 384 float pageHeight; |
| 385 computePageRects(FloatRect(FloatPoint(0, 0), pageSizeInPixels), 0, 0, 1,
pageHeight); | 385 computePageRects(FloatRect(FloatPoint(0, 0), pageSizeInPixels), 0, 0, 1,
pageHeight); |
| 386 | 386 |
| 387 const float pageWidth = pageSizeInPixels.width(); | 387 const float pageWidth = pageSizeInPixels.width(); |
| 388 size_t numPages = pageRects().size(); | 388 size_t numPages = pageRects().size(); |
| 389 int totalHeight = numPages * (pageSizeInPixels.height() + 1) - 1; | 389 int totalHeight = numPages * (pageSizeInPixels.height() + 1) - 1; |
| 390 IntRect allPagesRect(0, 0, pageWidth, totalHeight); | 390 IntRect allPagesRect(0, 0, pageWidth, totalHeight); |
| (...skipping 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2189 } | 2189 } |
| 2190 | 2190 |
| 2191 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const | 2191 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const |
| 2192 { | 2192 { |
| 2193 if (!frame()) | 2193 if (!frame()) |
| 2194 return WebSandboxFlags::None; | 2194 return WebSandboxFlags::None; |
| 2195 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); | 2195 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); |
| 2196 } | 2196 } |
| 2197 | 2197 |
| 2198 } // namespace blink | 2198 } // namespace blink |
| OLD | NEW |