Use kPointsPerInch instead of desired_dpi
Changed in https://codereview.chromium.org/2788343003
This commit is contained in:
parent
9945fc5148
commit
7d1a49db48
3 changed files with 10 additions and 25 deletions
|
@ -15,7 +15,6 @@ PrintMsg_Print_Params::PrintMsg_Print_Params()
|
|||
margin_left(0),
|
||||
dpi(0),
|
||||
scale_factor(1.0f),
|
||||
desired_dpi(0),
|
||||
document_cookie(0),
|
||||
selection_only(false),
|
||||
supports_alpha_blend(false),
|
||||
|
@ -41,7 +40,6 @@ void PrintMsg_Print_Params::Reset() {
|
|||
margin_left = 0;
|
||||
dpi = 0;
|
||||
scale_factor = 1.0f;
|
||||
desired_dpi = 0;
|
||||
document_cookie = 0;
|
||||
selection_only = false;
|
||||
supports_alpha_blend = false;
|
||||
|
|
|
@ -41,7 +41,6 @@ struct PrintMsg_Print_Params {
|
|||
int margin_left;
|
||||
double dpi;
|
||||
double scale_factor;
|
||||
int desired_dpi;
|
||||
bool rasterize_pdf;
|
||||
int document_cookie;
|
||||
bool selection_only;
|
||||
|
@ -105,9 +104,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params)
|
|||
// Specifies the scale factor in percent
|
||||
IPC_STRUCT_TRAITS_MEMBER(scale_factor)
|
||||
|
||||
// Desired apparent dpi on paper.
|
||||
IPC_STRUCT_TRAITS_MEMBER(desired_dpi)
|
||||
|
||||
// Cookie for the document to ensure correctness.
|
||||
IPC_STRUCT_TRAITS_MEMBER(document_cookie)
|
||||
|
||||
|
|
|
@ -66,9 +66,8 @@ int GetDPI(const PrintMsg_Print_Params* print_params) {
|
|||
bool PrintMsg_Print_Params_IsValid(const PrintMsg_Print_Params& params) {
|
||||
return !params.content_size.IsEmpty() && !params.page_size.IsEmpty() &&
|
||||
!params.printable_area.IsEmpty() && params.document_cookie &&
|
||||
params.desired_dpi && params.dpi && params.margin_top >= 0 &&
|
||||
params.margin_left >= 0 && params.dpi > kMinDpi &&
|
||||
params.document_cookie != 0;
|
||||
params.dpi && params.margin_top >= 0 && params.margin_left >= 0 &&
|
||||
params.dpi > kMinDpi && params.document_cookie != 0;
|
||||
}
|
||||
|
||||
PrintMsg_Print_Params GetCssPrintParams(
|
||||
|
@ -218,31 +217,23 @@ void ComputeWebKitPrintParamsInDesiredDpi(
|
|||
webkit_print_params->print_scaling_option = print_params.print_scaling_option;
|
||||
|
||||
webkit_print_params->print_content_area.width =
|
||||
ConvertUnit(print_params.content_size.width(), dpi,
|
||||
print_params.desired_dpi);
|
||||
ConvertUnit(print_params.content_size.width(), dpi, kPointsPerInch);
|
||||
webkit_print_params->print_content_area.height =
|
||||
ConvertUnit(print_params.content_size.height(), dpi,
|
||||
print_params.desired_dpi);
|
||||
ConvertUnit(print_params.content_size.height(), dpi, kPointsPerInch);
|
||||
|
||||
webkit_print_params->printable_area.x =
|
||||
ConvertUnit(print_params.printable_area.x(), dpi,
|
||||
print_params.desired_dpi);
|
||||
ConvertUnit(print_params.printable_area.x(), dpi, kPointsPerInch);
|
||||
webkit_print_params->printable_area.y =
|
||||
ConvertUnit(print_params.printable_area.y(), dpi,
|
||||
print_params.desired_dpi);
|
||||
ConvertUnit(print_params.printable_area.y(), dpi, kPointsPerInch);
|
||||
webkit_print_params->printable_area.width =
|
||||
ConvertUnit(print_params.printable_area.width(), dpi,
|
||||
print_params.desired_dpi);
|
||||
ConvertUnit(print_params.printable_area.width(), dpi, kPointsPerInch);
|
||||
webkit_print_params->printable_area.height =
|
||||
ConvertUnit(print_params.printable_area.height(),
|
||||
dpi, print_params.desired_dpi);
|
||||
ConvertUnit(print_params.printable_area.height(), dpi, kPointsPerInch);
|
||||
|
||||
webkit_print_params->paper_size.width =
|
||||
ConvertUnit(print_params.page_size.width(), dpi,
|
||||
print_params.desired_dpi);
|
||||
ConvertUnit(print_params.page_size.width(), dpi, kPointsPerInch);
|
||||
webkit_print_params->paper_size.height =
|
||||
ConvertUnit(print_params.page_size.height(), dpi,
|
||||
print_params.desired_dpi);
|
||||
ConvertUnit(print_params.page_size.height(), dpi, kPointsPerInch);
|
||||
}
|
||||
|
||||
blink::WebPlugin* GetPlugin(const blink::WebFrame* frame) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue