Bug 84312 - [Chromium] Added more params to Chromium-Webkit print api to implement auto fit to page functionality.
Summary: [Chromium] Added more params to Chromium-Webkit print api to implement auto f...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Printing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-18 20:06 PDT by kmadhusu
Modified: 2012-05-15 18:42 PDT (History)
6 users (show)

See Also:


Attachments
Patch (11.65 KB, patch)
2012-04-18 20:08 PDT, kmadhusu
no flags Details | Formatted Diff | Diff
Patch (17.47 KB, patch)
2012-04-20 15:17 PDT, kmadhusu
no flags Details | Formatted Diff | Diff
Patch (14.36 KB, patch)
2012-04-23 10:30 PDT, kmadhusu
no flags Details | Formatted Diff | Diff
Patch (14.35 KB, patch)
2012-04-29 12:43 PDT, kmadhusu
no flags Details | Formatted Diff | Diff
Patch (17.84 KB, patch)
2012-05-11 14:04 PDT, kmadhusu
no flags Details | Formatted Diff | Diff
Patch (17.66 KB, patch)
2012-05-11 14:16 PDT, kmadhusu
no flags Details | Formatted Diff | Diff
Patch (17.63 KB, patch)
2012-05-15 14:45 PDT, kmadhusu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kmadhusu 2012-04-18 20:06:43 PDT
To fix crbug.com/85132, I need to pass additional print params such as selected printer paper size, printable area and scale to fit value to the plugin print context. Therefore, I modified printBegin() function accordingly. Please review and let me know your comments.
Comment 1 kmadhusu 2012-04-18 20:08:58 PDT
Created attachment 137828 [details]
Patch
Comment 2 WebKit Review Bot 2012-04-18 20:10:54 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 3 kmadhusu 2012-04-19 11:09:54 PDT
Comment on attachment 137828 [details]
Patch

Patch is not ready for review yet. I will update the review flag as soon as it is ready for review. 

Thanks.
Comment 4 kmadhusu 2012-04-20 15:17:53 PDT
Created attachment 138175 [details]
Patch
Comment 5 kmadhusu 2012-04-23 10:30:51 PDT
Created attachment 138378 [details]
Patch
Comment 6 kmadhusu 2012-04-23 10:33:18 PDT
Latest patch uses WebPrintScalingOption.h. This is a new header file. I would like to commit that header file first to support Chrome side changes. Therefore, I uploaded that header file patch in https://bugs.webkit.org/show_bug.cgi?id=84608.
Comment 7 WebKit Review Bot 2012-04-23 22:59:53 PDT
Comment on attachment 138378 [details]
Patch

Attachment 138378 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12518135
Comment 8 kmadhusu 2012-04-29 12:43:50 PDT
Created attachment 139405 [details]
Patch
Comment 9 kmadhusu 2012-04-29 12:48:15 PDT
Updated patch and it is ready for review.
Comment 10 kmadhusu 2012-05-01 15:24:59 PDT
ping.
Comment 11 kmadhusu 2012-05-07 13:42:31 PDT
fishd@: Can you please review the latest patch?

Thanks.
Comment 12 Darin Fisher (:fishd, Google) 2012-05-09 11:52:46 PDT
Comment on attachment 139405 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=139405&action=review

> Source/WebKit/chromium/public/WebFrame.h:468
> +    // TODO(kmadhusu@chromium.org): This is a temporary interface to avoid the

nit: webkit style doesn't use TODO(user).  just use FIXME.

> Source/WebKit/chromium/public/WebFrame.h:488
> +    virtual int printBegin(const WebSize& printContentSize,

I suspect it would be better to bottle up these parameters into a WebPrintParams
struct.  See for example WebPluginParams.  Exclude the constrainToNode parameter
so that you can reuse WebPrintParams in the WebPlugin printBegin method.

> Source/WebKit/chromium/public/WebPlugin.h:104
> +    // TODO(kmadhusu@chromium.org): Change the data type of printScalingOption to

nit: TODO(user) -> FIXME

Use WebPrintParams here too.
Comment 13 kmadhusu 2012-05-11 14:04:44 PDT
Created attachment 141493 [details]
Patch
Comment 14 kmadhusu 2012-05-11 14:16:05 PDT
Created attachment 141495 [details]
Patch
Comment 15 kmadhusu 2012-05-14 10:52:23 PDT
Comment on attachment 139405 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=139405&action=review

Addressed review comments. PTAL. Thanks.

>> Source/WebKit/chromium/public/WebFrame.h:468
>> +    // TODO(kmadhusu@chromium.org): This is a temporary interface to avoid the
> 
> nit: webkit style doesn't use TODO(user).  just use FIXME.

Fixed.

>> Source/WebKit/chromium/public/WebFrame.h:488
>> +    virtual int printBegin(const WebSize& printContentSize,
> 
> I suspect it would be better to bottle up these parameters into a WebPrintParams
> struct.  See for example WebPluginParams.  Exclude the constrainToNode parameter
> so that you can reuse WebPrintParams in the WebPlugin printBegin method.

Done.

>> Source/WebKit/chromium/public/WebPlugin.h:104
>> +    // TODO(kmadhusu@chromium.org): Change the data type of printScalingOption to
> 
> nit: TODO(user) -> FIXME
> 
> Use WebPrintParams here too.

Done.
Comment 16 Darin Fisher (:fishd, Google) 2012-05-15 13:29:37 PDT
Comment on attachment 141495 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=141495&action=review

> Source/WebKit/chromium/public/WebPrintParams.h:60
> +          , printScalingOption(WebPrintScalingOptionFitToPrintableArea) { }

nit: indentation

unindent the comma-prefixed rows by 2 spaces

> Source/WebKit/chromium/public/WebPrintParams.h:64
> +          , printableArea(printableArea)

nit: indentation
Comment 17 kmadhusu 2012-05-15 14:45:31 PDT
Created attachment 142063 [details]
Patch
Comment 18 kmadhusu 2012-05-15 14:48:56 PDT
Comment on attachment 141495 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=141495&action=review

Fixed nits.

>> Source/WebKit/chromium/public/WebPrintParams.h:60
>> +          , printScalingOption(WebPrintScalingOptionFitToPrintableArea) { }
> 
> nit: indentation
> 
> unindent the comma-prefixed rows by 2 spaces

Fixed.

>> Source/WebKit/chromium/public/WebPrintParams.h:64
>> +          , printableArea(printableArea)
> 
> nit: indentation

Fixed.
Comment 19 WebKit Review Bot 2012-05-15 18:42:01 PDT
Comment on attachment 142063 [details]
Patch

Clearing flags on attachment: 142063

Committed r117200: <http://trac.webkit.org/changeset/117200>
Comment 20 WebKit Review Bot 2012-05-15 18:42:07 PDT
All reviewed patches have been landed.  Closing bug.