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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 } | 398 } |
399 | 399 |
400 private: | 400 private: |
401 // Set when printing. | 401 // Set when printing. |
402 float m_printedPageWidth; | 402 float m_printedPageWidth; |
403 }; | 403 }; |
404 | 404 |
405 // Simple class to override some of PrintContext behavior. This is used when | 405 // Simple class to override some of PrintContext behavior. This is used when |
406 // the frame hosts a plugin that supports custom printing. In this case, we | 406 // the frame hosts a plugin that supports custom printing. In this case, we |
407 // want to delegate all printing related calls to the plugin. | 407 // want to delegate all printing related calls to the plugin. |
408 class ChromePluginPrintContext FINAL : public ChromePrintContext { | 408 class ChromePluginPrintContext final : public ChromePrintContext { |
409 public: | 409 public: |
410 ChromePluginPrintContext(LocalFrame* frame, WebPluginContainerImpl* plugin,
const WebPrintParams& printParams) | 410 ChromePluginPrintContext(LocalFrame* frame, WebPluginContainerImpl* plugin,
const WebPrintParams& printParams) |
411 : ChromePrintContext(frame), m_plugin(plugin), m_printParams(printParams
) | 411 : ChromePrintContext(frame), m_plugin(plugin), m_printParams(printParams
) |
412 { | 412 { |
413 } | 413 } |
414 | 414 |
415 virtual ~ChromePluginPrintContext() { } | 415 virtual ~ChromePluginPrintContext() { } |
416 | 416 |
417 virtual void begin(float width, float height) OVERRIDE | 417 virtual void begin(float width, float height) override |
418 { | 418 { |
419 } | 419 } |
420 | 420 |
421 virtual void end() OVERRIDE | 421 virtual void end() override |
422 { | 422 { |
423 m_plugin->printEnd(); | 423 m_plugin->printEnd(); |
424 } | 424 } |
425 | 425 |
426 virtual float getPageShrink(int pageNumber) const OVERRIDE | 426 virtual float getPageShrink(int pageNumber) const override |
427 { | 427 { |
428 // We don't shrink the page (maybe we should ask the widget ??) | 428 // We don't shrink the page (maybe we should ask the widget ??) |
429 return 1.0; | 429 return 1.0; |
430 } | 430 } |
431 | 431 |
432 virtual void computePageRects(const FloatRect& printRect, float headerHeight
, float footerHeight, float userScaleFactor, float& outPageHeight) OVERRIDE | 432 virtual void computePageRects(const FloatRect& printRect, float headerHeight
, float footerHeight, float userScaleFactor, float& outPageHeight) override |
433 { | 433 { |
434 m_printParams.printContentArea = IntRect(printRect); | 434 m_printParams.printContentArea = IntRect(printRect); |
435 m_pageRects.fill(IntRect(printRect), m_plugin->printBegin(m_printParams)
); | 435 m_pageRects.fill(IntRect(printRect), m_plugin->printBegin(m_printParams)
); |
436 } | 436 } |
437 | 437 |
438 virtual void computePageRectsWithPageSize(const FloatSize& pageSizeInPixels,
bool allowHorizontalTiling) OVERRIDE | 438 virtual void computePageRectsWithPageSize(const FloatSize& pageSizeInPixels,
bool allowHorizontalTiling) override |
439 { | 439 { |
440 ASSERT_NOT_REACHED(); | 440 ASSERT_NOT_REACHED(); |
441 } | 441 } |
442 | 442 |
443 protected: | 443 protected: |
444 // Spools the printed page, a subrect of frame(). Skip the scale step. | 444 // Spools the printed page, a subrect of frame(). Skip the scale step. |
445 // NativeTheme doesn't play well with scaling. Scaling is done browser side | 445 // NativeTheme doesn't play well with scaling. Scaling is done browser side |
446 // instead. Returns the scale to be applied. | 446 // instead. Returns the scale to be applied. |
447 virtual float spoolPage(GraphicsContext& context, int pageNumber) OVERRIDE | 447 virtual float spoolPage(GraphicsContext& context, int pageNumber) override |
448 { | 448 { |
449 m_plugin->printPage(pageNumber, &context); | 449 m_plugin->printPage(pageNumber, &context); |
450 return 1.0; | 450 return 1.0; |
451 } | 451 } |
452 | 452 |
453 private: | 453 private: |
454 // Set when printing. | 454 // Set when printing. |
455 WebPluginContainerImpl* m_plugin; | 455 WebPluginContainerImpl* m_plugin; |
456 WebPrintParams m_printParams; | 456 WebPrintParams m_printParams; |
457 }; | 457 }; |
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1916 | 1916 |
1917 void WebLocalFrameImpl::invalidateAll() const | 1917 void WebLocalFrameImpl::invalidateAll() const |
1918 { | 1918 { |
1919 ASSERT(frame() && frame()->view()); | 1919 ASSERT(frame() && frame()->view()); |
1920 FrameView* view = frame()->view(); | 1920 FrameView* view = frame()->view(); |
1921 view->invalidateRect(view->frameRect()); | 1921 view->invalidateRect(view->frameRect()); |
1922 invalidateScrollbar(); | 1922 invalidateScrollbar(); |
1923 } | 1923 } |
1924 | 1924 |
1925 } // namespace blink | 1925 } // namespace blink |
OLD | NEW |