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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
295 | 295 |
296 virtual ~ChromePrintContext() { } | 296 virtual ~ChromePrintContext() { } |
297 | 297 |
298 virtual void begin(float width, float height) | 298 virtual void begin(float width, float height) |
299 { | 299 { |
300 ASSERT(!m_printedPageWidth); | 300 ASSERT(!m_printedPageWidth); |
301 m_printedPageWidth = width; | 301 m_printedPageWidth = width; |
302 PrintContext::begin(m_printedPageWidth, height); | 302 PrintContext::begin(m_printedPageWidth, height); |
303 } | 303 } |
304 | 304 |
305 virtual void end() | |
306 { | |
307 PrintContext::end(); | |
Vitaly Buka (NO REVIEWS)
2014/08/13 19:37:07
it's incorrect to remove this calls
base class has
| |
308 } | |
309 | |
310 virtual float getPageShrink(int pageNumber) const | 305 virtual float getPageShrink(int pageNumber) const |
311 { | 306 { |
312 IntRect pageRect = m_pageRects[pageNumber]; | 307 IntRect pageRect = m_pageRects[pageNumber]; |
313 return m_printedPageWidth / pageRect.width(); | 308 return m_printedPageWidth / pageRect.width(); |
314 } | 309 } |
315 | 310 |
316 // Spools the printed page, a subrect of frame(). Skip the scale step. | 311 // Spools the printed page, a subrect of frame(). Skip the scale step. |
317 // NativeTheme doesn't play well with scaling. Scaling is done browser side | 312 // NativeTheme doesn't play well with scaling. Scaling is done browser side |
318 // instead. Returns the scale to be applied. | 313 // instead. Returns the scale to be applied. |
319 // On Linux, we don't have the problem with NativeTheme, hence we let WebKit | 314 // On Linux, we don't have the problem with NativeTheme, hence we let WebKit |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
374 float scale = getPageShrink(pageIndex); | 369 float scale = getPageShrink(pageIndex); |
375 graphicsContext.scale(scale, scale); | 370 graphicsContext.scale(scale, scale); |
376 #endif | 371 #endif |
377 spoolPage(graphicsContext, pageIndex); | 372 spoolPage(graphicsContext, pageIndex); |
378 graphicsContext.restore(); | 373 graphicsContext.restore(); |
379 | 374 |
380 currentHeight += pageSizeInPixels.height() + 1; | 375 currentHeight += pageSizeInPixels.height() + 1; |
381 } | 376 } |
382 } | 377 } |
383 | 378 |
384 virtual void computePageRects(const FloatRect& printRect, float headerHeight , float footerHeight, float userScaleFactor, float& outPageHeight) | |
385 { | |
Vitaly Buka (NO REVIEWS)
2014/08/13 19:37:07
same
| |
386 PrintContext::computePageRects(printRect, headerHeight, footerHeight, us erScaleFactor, outPageHeight); | |
387 } | |
388 | |
389 virtual int pageCount() const | |
390 { | |
391 return PrintContext::pageCount(); | |
392 } | |
393 | |
394 private: | 379 private: |
395 // Set when printing. | 380 // Set when printing. |
396 float m_printedPageWidth; | 381 float m_printedPageWidth; |
397 }; | 382 }; |
398 | 383 |
399 // Simple class to override some of PrintContext behavior. This is used when | 384 // Simple class to override some of PrintContext behavior. This is used when |
400 // the frame hosts a plugin that supports custom printing. In this case, we | 385 // the frame hosts a plugin that supports custom printing. In this case, we |
401 // want to delegate all printing related calls to the plugin. | 386 // want to delegate all printing related calls to the plugin. |
402 class ChromePluginPrintContext FINAL : public ChromePrintContext { | 387 class ChromePluginPrintContext FINAL : public ChromePrintContext { |
403 public: | 388 public: |
(...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1875 | 1860 |
1876 void WebLocalFrameImpl::invalidateAll() const | 1861 void WebLocalFrameImpl::invalidateAll() const |
1877 { | 1862 { |
1878 ASSERT(frame() && frame()->view()); | 1863 ASSERT(frame() && frame()->view()); |
1879 FrameView* view = frame()->view(); | 1864 FrameView* view = frame()->view(); |
1880 view->invalidateRect(view->frameRect()); | 1865 view->invalidateRect(view->frameRect()); |
1881 invalidateScrollbar(); | 1866 invalidateScrollbar(); |
1882 } | 1867 } |
1883 | 1868 |
1884 } // namespace blink | 1869 } // namespace blink |
OLD | NEW |