mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium revision 0bfd25d4 (#381305)
- Delete include/cef_runnable.h (issue #1336). - Build the cef_unittests target using all Chromium headers. Add a USING_CHROMIUM_INCLUDES define and libcef_dll_wrapper_unittests target to support this. This change avoids compile errors due to the divergence of CEF and Chromium base/ header implementations. The libcef_dll_wrapper sources must now compile successfully with both CEF and Chromium base/ headers (issue #1632). - The onbeforeunload message specified via JavaScript is no longer passed to the client (see http://crbug.com/587940).
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
diff --git printing/common/print_messages.cc printing/common/print_messages.cc
|
||||
index c3469fc..9fc71ac 100644
|
||||
index e1a107a..1601811 100644
|
||||
--- printing/common/print_messages.cc
|
||||
+++ printing/common/print_messages.cc
|
||||
@@ -95,7 +95,6 @@ void PrintMsg_PrintPages_Params::Reset() {
|
||||
@@ -97,7 +97,6 @@ void PrintMsg_PrintPages_Params::Reset() {
|
||||
pages = std::vector<int>();
|
||||
}
|
||||
|
||||
@@ -10,13 +10,13 @@ index c3469fc..9fc71ac 100644
|
||||
PrintHostMsg_RequestPrintPreview_Params::
|
||||
PrintHostMsg_RequestPrintPreview_Params()
|
||||
: is_modifiable(false),
|
||||
@@ -117,4 +116,3 @@ PrintHostMsg_SetOptionsFromDocument_Params::
|
||||
@@ -119,4 +118,3 @@ PrintHostMsg_SetOptionsFromDocument_Params::
|
||||
PrintHostMsg_SetOptionsFromDocument_Params::
|
||||
~PrintHostMsg_SetOptionsFromDocument_Params() {
|
||||
}
|
||||
-#endif // defined(ENABLE_PRINT_PREVIEW)
|
||||
diff --git printing/common/print_messages.h printing/common/print_messages.h
|
||||
index 6060a1c..d051297 100644
|
||||
index 771a4c5..1d8c5ca 100644
|
||||
--- printing/common/print_messages.h
|
||||
+++ printing/common/print_messages.h
|
||||
@@ -70,7 +70,6 @@ struct PrintMsg_PrintPages_Params {
|
||||
@@ -35,7 +35,7 @@ index 6060a1c..d051297 100644
|
||||
|
||||
#endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_
|
||||
|
||||
@@ -182,7 +180,6 @@ IPC_STRUCT_TRAITS_BEGIN(printing::PageRange)
|
||||
@@ -176,7 +174,6 @@ IPC_STRUCT_TRAITS_BEGIN(printing::PageRange)
|
||||
IPC_STRUCT_TRAITS_MEMBER(to)
|
||||
IPC_STRUCT_TRAITS_END()
|
||||
|
||||
@@ -43,7 +43,7 @@ index 6060a1c..d051297 100644
|
||||
IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params)
|
||||
IPC_STRUCT_TRAITS_MEMBER(is_modifiable)
|
||||
IPC_STRUCT_TRAITS_MEMBER(webnode_only)
|
||||
@@ -203,7 +200,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params)
|
||||
@@ -197,7 +194,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params)
|
||||
// Specifies page range to be printed.
|
||||
IPC_STRUCT_TRAITS_MEMBER(page_ranges)
|
||||
IPC_STRUCT_TRAITS_END()
|
||||
@@ -51,7 +51,7 @@ index 6060a1c..d051297 100644
|
||||
|
||||
IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins)
|
||||
IPC_STRUCT_TRAITS_MEMBER(content_width)
|
||||
@@ -223,7 +219,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params)
|
||||
@@ -217,7 +213,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params)
|
||||
IPC_STRUCT_TRAITS_MEMBER(pages)
|
||||
IPC_STRUCT_TRAITS_END()
|
||||
|
||||
@@ -59,7 +59,7 @@ index 6060a1c..d051297 100644
|
||||
// Parameters to describe a rendered document.
|
||||
IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params)
|
||||
// A shared memory handle to metafile data.
|
||||
@@ -277,7 +272,6 @@ IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params)
|
||||
@@ -271,7 +266,6 @@ IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params)
|
||||
// Indicates whether the existing preview data needs to be cleared or not.
|
||||
IPC_STRUCT_MEMBER(bool, clear_preview_data)
|
||||
IPC_STRUCT_END()
|
||||
@@ -67,7 +67,7 @@ index 6060a1c..d051297 100644
|
||||
|
||||
// Parameters to describe a rendered page.
|
||||
IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params)
|
||||
@@ -315,22 +309,20 @@ IPC_STRUCT_END()
|
||||
@@ -309,22 +303,20 @@ IPC_STRUCT_END()
|
||||
|
||||
// Messages sent from the browser to the renderer.
|
||||
|
||||
@@ -92,7 +92,7 @@ index 6060a1c..d051297 100644
|
||||
|
||||
#if defined(ENABLE_BASIC_PRINTING)
|
||||
// Tells the render view to switch the CSS to print media type, renders every
|
||||
@@ -349,13 +341,11 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone,
|
||||
@@ -343,13 +335,11 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone,
|
||||
IPC_MESSAGE_ROUTED1(PrintMsg_SetScriptedPrintingBlocked,
|
||||
bool /* blocked */)
|
||||
|
||||
@@ -106,7 +106,7 @@ index 6060a1c..d051297 100644
|
||||
|
||||
// Messages sent from the renderer to the browser.
|
||||
|
||||
@@ -415,7 +405,6 @@ IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten,
|
||||
@@ -409,7 +399,6 @@ IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten,
|
||||
int /* fd in browser */) // Used only by Chrome OS.
|
||||
#endif // defined(OS_ANDROID)
|
||||
|
||||
@@ -114,7 +114,7 @@ index 6060a1c..d051297 100644
|
||||
// Asks the browser to do print preview.
|
||||
IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview,
|
||||
PrintHostMsg_RequestPrintPreview_Params /* params */)
|
||||
@@ -449,7 +438,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel,
|
||||
@@ -443,7 +432,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel,
|
||||
// The memory handle in this message is already valid in the browser process.
|
||||
IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting,
|
||||
PrintHostMsg_DidPreviewDocument_Params /* params */)
|
||||
@@ -122,7 +122,7 @@ index 6060a1c..d051297 100644
|
||||
|
||||
// This is sent when there are invalid printer settings.
|
||||
IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
|
||||
@@ -458,7 +446,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
|
||||
@@ -452,7 +440,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
|
||||
IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed,
|
||||
int /* document cookie */)
|
||||
|
||||
@@ -130,16 +130,16 @@ index 6060a1c..d051297 100644
|
||||
// Tell the browser print preview failed.
|
||||
IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed,
|
||||
int /* document cookie */)
|
||||
@@ -485,4 +472,3 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview,
|
||||
@@ -479,4 +466,3 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview,
|
||||
// Notify the browser to set print presets based on source PDF document.
|
||||
IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument,
|
||||
PrintHostMsg_SetOptionsFromDocument_Params /* params */)
|
||||
-#endif // defined(ENABLE_PRINT_PREVIEW)
|
||||
diff --git printing/renderer/print_web_view_helper.cc printing/renderer/print_web_view_helper.cc
|
||||
index 6a8f1c3..f66469e 100644
|
||||
index 823c957..51d8aa5 100644
|
||||
--- printing/renderer/print_web_view_helper.cc
|
||||
+++ printing/renderer/print_web_view_helper.cc
|
||||
@@ -81,6 +81,9 @@ const double kMinDpi = 1.0;
|
||||
@@ -80,6 +80,9 @@ const double kMinDpi = 1.0;
|
||||
|
||||
#if defined(ENABLE_PRINT_PREVIEW)
|
||||
bool g_is_preview_enabled = true;
|
||||
@@ -149,7 +149,7 @@ index 6a8f1c3..f66469e 100644
|
||||
|
||||
const char kPageLoadScriptFormat[] =
|
||||
"document.open(); document.write(%s); document.close();";
|
||||
@@ -95,9 +98,6 @@ void ExecuteScript(blink::WebFrame* frame,
|
||||
@@ -94,9 +97,6 @@ void ExecuteScript(blink::WebFrame* frame,
|
||||
std::string script = base::StringPrintf(script_format, json.c_str());
|
||||
frame->executeScript(blink::WebString(base::UTF8ToUTF16(script)));
|
||||
}
|
||||
@@ -159,7 +159,7 @@ index 6a8f1c3..f66469e 100644
|
||||
|
||||
int GetDPI(const PrintMsg_Print_Params* print_params) {
|
||||
#if defined(OS_MACOSX)
|
||||
@@ -307,7 +307,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame,
|
||||
@@ -306,7 +306,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame,
|
||||
return plugin && plugin->supportsPaginatedPrint();
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ index 6a8f1c3..f66469e 100644
|
||||
// Returns true if the current destination printer is PRINT_TO_PDF.
|
||||
bool IsPrintToPdfRequested(const base::DictionaryValue& job_settings) {
|
||||
bool print_to_pdf = false;
|
||||
@@ -329,7 +328,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebFrame* frame,
|
||||
@@ -328,7 +327,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebFrame* frame,
|
||||
}
|
||||
return frame_has_custom_page_size_style;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ index 6a8f1c3..f66469e 100644
|
||||
|
||||
// Disable scaling when either:
|
||||
// - The PDF specifies disabling scaling.
|
||||
@@ -376,7 +374,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame,
|
||||
@@ -375,7 +373,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame,
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -183,7 +183,7 @@ index 6a8f1c3..f66469e 100644
|
||||
bool FitToPageEnabled(const base::DictionaryValue& job_settings) {
|
||||
bool fit_to_paper_size = false;
|
||||
if (!job_settings.GetBoolean(kSettingFitToPageEnabled, &fit_to_paper_size)) {
|
||||
@@ -418,7 +415,6 @@ blink::WebPrintScalingOption GetPrintScalingOption(
|
||||
@@ -417,7 +414,6 @@ blink::WebPrintScalingOption GetPrintScalingOption(
|
||||
}
|
||||
return blink::WebPrintScalingOptionFitToPrintableArea;
|
||||
}
|
||||
@@ -191,7 +191,7 @@ index 6a8f1c3..f66469e 100644
|
||||
|
||||
PrintMsg_Print_Params CalculatePrintParamsForCss(
|
||||
blink::WebFrame* frame,
|
||||
@@ -502,7 +498,6 @@ blink::WebView* FrameReference::view() {
|
||||
@@ -501,7 +497,6 @@ blink::WebView* FrameReference::view() {
|
||||
return view_;
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ index 6a8f1c3..f66469e 100644
|
||||
// static - Not anonymous so that platform implementations can use it.
|
||||
void PrintWebViewHelper::PrintHeaderAndFooter(
|
||||
blink::WebCanvas* canvas,
|
||||
@@ -558,7 +553,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
|
||||
@@ -557,7 +552,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
|
||||
web_view->close();
|
||||
frame->close();
|
||||
}
|
||||
@@ -207,7 +207,7 @@ index 6a8f1c3..f66469e 100644
|
||||
|
||||
// static - Not anonymous so that platform implementations can use it.
|
||||
float PrintWebViewHelper::RenderPageContent(blink::WebFrame* frame,
|
||||
@@ -831,6 +825,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view,
|
||||
@@ -833,6 +827,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view,
|
||||
print_for_preview_(false),
|
||||
delegate_(std::move(delegate)),
|
||||
print_node_in_progress_(false),
|
||||
@@ -215,7 +215,7 @@ index 6a8f1c3..f66469e 100644
|
||||
is_loading_(false),
|
||||
is_scripted_preview_delayed_(false),
|
||||
ipc_nesting_level_(0),
|
||||
@@ -889,10 +884,8 @@ void PrintWebViewHelper::PrintPage(blink::WebLocalFrame* frame,
|
||||
@@ -891,10 +886,8 @@ void PrintWebViewHelper::PrintPage(blink::WebLocalFrame* frame,
|
||||
return;
|
||||
|
||||
if (g_is_preview_enabled) {
|
||||
@@ -226,7 +226,7 @@ index 6a8f1c3..f66469e 100644
|
||||
} else {
|
||||
#if defined(ENABLE_BASIC_PRINTING)
|
||||
Print(frame, blink::WebNode(), true);
|
||||
@@ -916,14 +909,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
|
||||
@@ -918,14 +911,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
|
||||
IPC_MESSAGE_HANDLER(PrintMsg_PrintPages, OnPrintPages)
|
||||
IPC_MESSAGE_HANDLER(PrintMsg_PrintForSystemDialog, OnPrintForSystemDialog)
|
||||
#endif // defined(ENABLE_BASIC_PRINTING)
|
||||
@@ -241,7 +241,7 @@ index 6a8f1c3..f66469e 100644
|
||||
IPC_MESSAGE_HANDLER(PrintMsg_SetScriptedPrintingBlocked,
|
||||
SetScriptedPrintBlocked)
|
||||
IPC_MESSAGE_UNHANDLED(handled = false)
|
||||
@@ -975,7 +964,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() {
|
||||
@@ -977,7 +966,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() {
|
||||
}
|
||||
#endif // defined(ENABLE_BASIC_PRINTING)
|
||||
|
||||
@@ -249,7 +249,7 @@ index 6a8f1c3..f66469e 100644
|
||||
void PrintWebViewHelper::OnPrintForPrintPreview(
|
||||
const base::DictionaryValue& job_settings) {
|
||||
CHECK_LE(ipc_nesting_level_, 1);
|
||||
@@ -1040,7 +1028,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
|
||||
@@ -1042,7 +1030,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
|
||||
DidFinishPrinting(FAIL_PRINT);
|
||||
}
|
||||
}
|
||||
@@ -257,7 +257,7 @@ index 6a8f1c3..f66469e 100644
|
||||
|
||||
void PrintWebViewHelper::GetPageSizeAndContentAreaFromPageLayout(
|
||||
const PageSizeMargins& page_layout_in_points,
|
||||
@@ -1065,7 +1052,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo(
|
||||
@@ -1067,7 +1054,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo(
|
||||
ignore_css_margins_ = (margins_type != DEFAULT_MARGINS);
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ index 6a8f1c3..f66469e 100644
|
||||
void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) {
|
||||
if (ipc_nesting_level_ > 1)
|
||||
return;
|
||||
@@ -1226,7 +1212,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
|
||||
@@ -1228,7 +1214,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ index 6a8f1c3..f66469e 100644
|
||||
bool PrintWebViewHelper::RenderPreviewPage(
|
||||
int page_number,
|
||||
const PrintMsg_Print_Params& print_params) {
|
||||
@@ -1255,7 +1241,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
|
||||
@@ -1257,7 +1243,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
|
||||
}
|
||||
return PreviewPageRendered(page_number, draft_metafile.get());
|
||||
}
|
||||
@@ -283,7 +283,7 @@ index 6a8f1c3..f66469e 100644
|
||||
|
||||
bool PrintWebViewHelper::FinalizePrintReadyDocument() {
|
||||
DCHECK(!is_print_ready_metafile_sent_);
|
||||
@@ -1285,7 +1271,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() {
|
||||
@@ -1287,7 +1273,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() {
|
||||
Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params));
|
||||
return true;
|
||||
}
|
||||
@@ -291,7 +291,7 @@ index 6a8f1c3..f66469e 100644
|
||||
|
||||
void PrintWebViewHelper::OnPrintingDone(bool success) {
|
||||
if (ipc_nesting_level_ > 1)
|
||||
@@ -1300,7 +1285,6 @@ void PrintWebViewHelper::SetScriptedPrintBlocked(bool blocked) {
|
||||
@@ -1302,7 +1287,6 @@ void PrintWebViewHelper::SetScriptedPrintBlocked(bool blocked) {
|
||||
is_scripted_printing_blocked_ = blocked;
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ index 6a8f1c3..f66469e 100644
|
||||
void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
|
||||
if (ipc_nesting_level_ > 1)
|
||||
return;
|
||||
@@ -1311,7 +1295,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
|
||||
@@ -1313,7 +1297,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
|
||||
// that instead.
|
||||
auto plugin = delegate_->GetPdfElement(frame);
|
||||
if (!plugin.isNull()) {
|
||||
@@ -309,7 +309,7 @@ index 6a8f1c3..f66469e 100644
|
||||
return;
|
||||
}
|
||||
print_preview_context_.InitWithFrame(frame);
|
||||
@@ -1319,7 +1305,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
|
||||
@@ -1321,7 +1307,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
|
||||
? PRINT_PREVIEW_USER_INITIATED_SELECTION
|
||||
: PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME);
|
||||
}
|
||||
@@ -317,7 +317,7 @@ index 6a8f1c3..f66469e 100644
|
||||
|
||||
bool PrintWebViewHelper::IsPrintingEnabled() {
|
||||
bool result = false;
|
||||
@@ -1345,11 +1330,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -1347,11 +1332,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
// Make a copy of the node, in case RenderView::OnContextMenuClosed resets
|
||||
// its |context_menu_node_|.
|
||||
@@ -330,7 +330,7 @@ index 6a8f1c3..f66469e 100644
|
||||
} else {
|
||||
#if defined(ENABLE_BASIC_PRINTING)
|
||||
blink::WebNode duplicate_node(node);
|
||||
@@ -1415,7 +1398,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
|
||||
@@ -1417,7 +1400,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -338,7 +338,7 @@ index 6a8f1c3..f66469e 100644
|
||||
case FAIL_PREVIEW:
|
||||
int cookie =
|
||||
print_pages_params_ ? print_pages_params_->params.document_cookie : 0;
|
||||
@@ -1427,7 +1409,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
|
||||
@@ -1429,7 +1411,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
|
||||
}
|
||||
print_preview_context_.Failed(notify_browser_of_print_failure_);
|
||||
break;
|
||||
@@ -346,7 +346,7 @@ index 6a8f1c3..f66469e 100644
|
||||
}
|
||||
prep_frame_view_.reset();
|
||||
print_pages_params_.reset();
|
||||
@@ -1559,7 +1540,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
|
||||
@@ -1561,7 +1542,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -354,7 +354,7 @@ index 6a8f1c3..f66469e 100644
|
||||
bool PrintWebViewHelper::SetOptionsFromPdfDocument(
|
||||
PrintHostMsg_SetOptionsFromDocument_Params* options) {
|
||||
blink::WebLocalFrame* source_frame = print_preview_context_.source_frame();
|
||||
@@ -1668,7 +1648,6 @@ bool PrintWebViewHelper::UpdatePrintSettings(
|
||||
@@ -1670,7 +1650,6 @@ bool PrintWebViewHelper::UpdatePrintSettings(
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -362,46 +362,31 @@ index 6a8f1c3..f66469e 100644
|
||||
|
||||
#if defined(ENABLE_BASIC_PRINTING)
|
||||
bool PrintWebViewHelper::GetPrintSettingsFromUser(blink::WebLocalFrame* frame,
|
||||
@@ -1760,11 +1739,14 @@ void PrintWebViewHelper::PrintPageInternal(
|
||||
gfx::Rect canvas_area =
|
||||
params.params.display_header_footer ? gfx::Rect(page_size) : content_area;
|
||||
|
||||
-#if defined(OS_WIN) || defined(ENABLE_PRINT_PREVIEW)
|
||||
+#if defined(OS_WIN)
|
||||
float webkit_page_shrink_factor =
|
||||
frame->getPrintPageShrink(params.page_number);
|
||||
float scale_factor = css_scale_factor * webkit_page_shrink_factor;
|
||||
+#else
|
||||
+ float scale_factor = css_scale_factor / 1.25f;
|
||||
#endif
|
||||
+
|
||||
// TODO(thestig) GetVectorCanvasForNewPage() and RenderPageContent() take a
|
||||
// different scale factor vs Windows. Figure out why and combine the two.
|
||||
#if defined(OS_WIN)
|
||||
@@ -1780,14 +1762,12 @@ void PrintWebViewHelper::PrintPageInternal(
|
||||
@@ -1778,7 +1757,6 @@ void PrintWebViewHelper::PrintPageInternal(
|
||||
|
||||
MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
|
||||
|
||||
-#if defined(ENABLE_PRINT_PREVIEW)
|
||||
if (params.params.display_header_footer) {
|
||||
// |page_number| is 0-based, so 1 is added.
|
||||
PrintHeaderAndFooter(canvas, params.page_number + 1,
|
||||
print_preview_context_.total_page_count(), *frame,
|
||||
scale_factor, page_layout_in_points, params.params);
|
||||
// TODO(thestig): Figure out why Linux needs this. The value may be
|
||||
// |printingMinimumShrinkFactor|.
|
||||
@@ -1793,7 +1771,6 @@ void PrintWebViewHelper::PrintPageInternal(
|
||||
scale_factor / fudge_factor, page_layout_in_points,
|
||||
params.params);
|
||||
}
|
||||
-#endif // defined(ENABLE_PRINT_PREVIEW)
|
||||
|
||||
float webkit_scale_factor =
|
||||
RenderPageContent(frame, params.page_number, canvas_area, content_area,
|
||||
@@ -1836,7 +1816,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
|
||||
#endif // defined(OS_WIN)
|
||||
@@ -1829,7 +1806,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
|
||||
return true;
|
||||
}
|
||||
|
||||
-#if defined(ENABLE_PRINT_PREVIEW)
|
||||
void PrintWebViewHelper::ShowScriptedPrintPreview() {
|
||||
if (is_scripted_preview_delayed_) {
|
||||
is_scripted_preview_delayed_ = false;
|
||||
@@ -1964,7 +1943,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
|
||||
@@ -1957,7 +1933,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
|
||||
Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params));
|
||||
return true;
|
||||
}
|
||||
@@ -410,7 +395,7 @@ index 6a8f1c3..f66469e 100644
|
||||
PrintWebViewHelper::PrintPreviewContext::PrintPreviewContext()
|
||||
: total_page_count_(0),
|
||||
diff --git printing/renderer/print_web_view_helper.h printing/renderer/print_web_view_helper.h
|
||||
index ca10384..7aacfbc 100644
|
||||
index 39ef858..3c4f89e 100644
|
||||
--- printing/renderer/print_web_view_helper.h
|
||||
+++ printing/renderer/print_web_view_helper.h
|
||||
@@ -137,9 +137,7 @@ class PrintWebViewHelper
|
||||
@@ -507,10 +492,10 @@ index ca10384..7aacfbc 100644
|
||||
bool is_loading_;
|
||||
bool is_scripted_preview_delayed_;
|
||||
diff --git printing/renderer/print_web_view_helper_mac.mm printing/renderer/print_web_view_helper_mac.mm
|
||||
index 08a1c10..4a80a2d 100644
|
||||
index 6552666..8899b6d 100644
|
||||
--- printing/renderer/print_web_view_helper_mac.mm
|
||||
+++ printing/renderer/print_web_view_helper_mac.mm
|
||||
@@ -69,7 +69,6 @@ void PrintWebViewHelper::PrintPageInternal(
|
||||
@@ -68,7 +68,6 @@ void PrintWebViewHelper::PrintPageInternal(
|
||||
Send(new PrintHostMsg_DidPrintPage(routing_id(), page_params));
|
||||
}
|
||||
|
||||
@@ -518,7 +503,7 @@ index 08a1c10..4a80a2d 100644
|
||||
bool PrintWebViewHelper::RenderPreviewPage(
|
||||
int page_number,
|
||||
const PrintMsg_Print_Params& print_params) {
|
||||
@@ -110,7 +109,6 @@ bool PrintWebViewHelper::RenderPreviewPage(
|
||||
@@ -104,7 +103,6 @@ bool PrintWebViewHelper::RenderPreviewPage(
|
||||
}
|
||||
return PreviewPageRendered(page_number, draft_metafile.get());
|
||||
}
|
||||
@@ -526,7 +511,7 @@ index 08a1c10..4a80a2d 100644
|
||||
|
||||
void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
|
||||
int page_number,
|
||||
@@ -145,14 +143,12 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
|
||||
@@ -139,14 +137,12 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
|
||||
|
||||
MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
|
||||
skia::SetIsPreviewMetafile(*canvas, is_preview);
|
||||
|
Reference in New Issue
Block a user