diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-19 17:36:22 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-19 17:36:22 +0000 |
commit | 88a3eccb5605fc9224ce59c76473b7aae2c31bc8 (patch) | |
tree | 9c31830256ada147c4f19ffb90659da3fb97fa3d /webkit/glue/webframe_impl.h | |
parent | f3735c5dc0269579afc173d9e519243c305e1186 (diff) | |
download | chromium_src-88a3eccb5605fc9224ce59c76473b7aae2c31bc8.zip chromium_src-88a3eccb5605fc9224ce59c76473b7aae2c31bc8.tar.gz chromium_src-88a3eccb5605fc9224ce59c76473b7aae2c31bc8.tar.bz2 |
Remove code duplicated from webcore and use the common PrintContext facility.
Review URL: http://codereview.chromium.org/20470
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webframe_impl.h')
-rw-r--r-- | webkit/glue/webframe_impl.h | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/webkit/glue/webframe_impl.h b/webkit/glue/webframe_impl.h index 96045e1..8684cb7 100644 --- a/webkit/glue/webframe_impl.h +++ b/webkit/glue/webframe_impl.h @@ -40,6 +40,7 @@ MSVC_PUSH_WARNING_LEVEL(0); MSVC_POP_WARNING(); class AltErrorPageResourceFetcher; +class ChromePrintContext; class WebDataSourceImpl; class WebErrorImpl; class WebHistoryItemImpl; @@ -157,7 +158,8 @@ class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> { virtual WebTextInput* GetTextInput(); - virtual bool ExecuteCoreCommandByName(const std::string& name, const std::string& value); + virtual bool ExecuteCoreCommandByName(const std::string& name, + const std::string& value); virtual bool IsCoreCommandEnabled(const std::string& name); virtual void AddMessageToConsole(const std::wstring& msg, @@ -167,19 +169,10 @@ class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> { virtual gfx::Size ScrollOffset() const; - virtual bool SetPrintingMode(bool printing, - float page_width_min, - float page_width_max, - int* width); - virtual int ComputePageRects(const gfx::Size& page_size_px); - virtual void GetPageRect(int page, gfx::Rect* page_size) const; - virtual bool SpoolPage(int page, skia::PlatformCanvas* canvas); - - // Reformats this frame for printing or for screen display, depending on - // |printing| flag. Acts recursively on inner frames. - // Note: It fails if the main frame failed to load. It will succeed even if a - // child frame failed to load. - void SetPrinting(bool printing, float page_width_min, float page_width_max); + virtual bool BeginPrint(const gfx::Size& page_size_px, + int* page_count); + virtual float PrintPage(int page, skia::PlatformCanvas* canvas); + virtual void EndPrint(); PassRefPtr<WebCore::Frame> CreateChildFrame( const WebCore::FrameLoadRequest&, @@ -245,12 +238,9 @@ class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> { // Sets whether the WebFrameImpl allows its document to be scrolled. // If the parameter is true, allow the document to be scrolled. - // Otherwise, disallow scrolling + // Otherwise, disallow scrolling. void SetAllowsScrolling(bool flag); - // Returns true if the frame CSS is in "printing" mode. - bool printing() const { return printing_; } - // Registers a listener for the specified user name input element. The // listener will receive notifications for blur and when autocomplete should // be triggered. @@ -411,11 +401,9 @@ class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> { // Clears the map of password listeners. void ClearPasswordListeners(); - // In "printing" mode. Used as a state check. - bool printing_; - - // For each printed page, the view of the document in pixels. - Vector<WebCore::IntRect> pages_; + // Valid between calls to BeginPrint() and EndPrint(). Containts the print + // information. Is used by PrintPage(). + scoped_ptr<ChromePrintContext> print_context_; // The input fields that are interested in edit events and their associated // listeners. |