X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fcore%2Fpage%2FPrintContext.h;h=04636f255cf9f61debb9befda0d4461569047f1d;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=6c99875598bbe09216bd6fdbf4ea60c10a937974;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/core/page/PrintContext.h b/src/third_party/WebKit/Source/core/page/PrintContext.h index 6c99875..04636f2 100644 --- a/src/third_party/WebKit/Source/core/page/PrintContext.h +++ b/src/third_party/WebKit/Source/core/page/PrintContext.h @@ -21,12 +21,13 @@ #ifndef PrintContext_h #define PrintContext_h +#include "platform/heap/Handle.h" #include "wtf/Forward.h" #include "wtf/HashMap.h" #include "wtf/Vector.h" #include "wtf/text/WTFString.h" -namespace WebCore { +namespace blink { class Element; class LocalFrame; @@ -36,10 +37,10 @@ class GraphicsContext; class IntRect; class Node; -class PrintContext { +class PrintContext : public NoBaseWillBeGarbageCollectedFinalized { public: explicit PrintContext(LocalFrame*); - ~PrintContext(); + virtual ~PrintContext(); LocalFrame* frame() const { return m_frame; } @@ -47,10 +48,11 @@ public: // FIXME: This means that CSS page breaks won't be on page boundary if the size is different than what was passed to begin(). That's probably not always desirable. // FIXME: Header and footer height should be applied before layout, not after. // FIXME: The printRect argument is only used to determine page aspect ratio, it would be better to pass a FloatSize with page dimensions instead. - void computePageRects(const FloatRect& printRect, float headerHeight, float footerHeight, float userScaleFactor, float& outPageHeight, bool allowHorizontalTiling = false); + virtual void computePageRects(const FloatRect& printRect, float headerHeight, float footerHeight, float userScaleFactor, float& outPageHeight); // Deprecated. Page size computation is already in this class, clients shouldn't be copying it. - void computePageRectsWithPageSize(const FloatSize& pageSizeInPixels, bool allowHorizontalTiling); + // FIXME: Everyone passes |false| for the second paramer. We should remove the second parameter. + virtual void computePageRectsWithPageSize(const FloatSize& pageSizeInPixels, bool allowHorizontalTiling); // These are only valid after page rects are computed. size_t pageCount() const { return m_pageRects.size(); } @@ -59,13 +61,10 @@ public: // Enter print mode, updating layout for new page size. // This function can be called multiple times to apply new print options without going back to screen mode. - void begin(float width, float height = 0); - - // FIXME: eliminate width argument. - void spoolPage(GraphicsContext& ctx, int pageNumber, float width); + virtual void begin(float width, float height = 0); // Return to screen mode. - void end(); + virtual void end(); // Used by layout tests. static int pageNumberForElement(Element*, const FloatSize& pageSizeInPixels); // Returns -1 if page isn't found. @@ -73,10 +72,8 @@ public: static bool isPageBoxVisible(LocalFrame* frame, int pageNumber); static String pageSizeAndMarginsInPixels(LocalFrame* frame, int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft); static int numberOfPages(LocalFrame*, const FloatSize& pageSizeInPixels); - // Draw all pages into a graphics context with lines which mean page boundaries. - // The height of the graphics context should be - // (pageSizeInPixels.height() + 1) * number-of-pages - 1 - static void spoolAllPagesWithBoundaries(LocalFrame*, GraphicsContext&, const FloatSize& pageSizeInPixels); + + virtual void trace(Visitor*); protected: void outputLinkedDestinations(GraphicsContext&, Node*, const IntRect& pageRect); @@ -91,7 +88,7 @@ private: // Used to prevent misuses of begin() and end() (e.g., call end without begin). bool m_isPrinting; - HashMap m_linkedDestinations; + WillBeHeapHashMap > m_linkedDestinations; bool m_linkedDestinationsValid; };