Merge remote-tracking branch 'upstream/master'

# Conflicts:
#	atom/browser/api/atom_api_web_contents.cc
#	chromium_src/chrome/browser/printing/print_job_worker.cc
#	chromium_src/chrome/browser/printing/print_job_worker.h
#	chromium_src/chrome/browser/printing/print_view_manager_base.cc
#	chromium_src/chrome/browser/printing/print_view_manager_base.h
#	chromium_src/chrome/browser/printing/printer_query.cc
#	chromium_src/chrome/common/print_messages.cc
#	chromium_src/chrome/renderer/printing/print_web_view_helper.cc
This commit is contained in:
renaesop 2017-02-07 09:30:36 +08:00
commit 26135b412b
168 changed files with 1632 additions and 1755 deletions

View file

@ -360,7 +360,7 @@ bool PathProvider(int key, base::FilePath* result) {
#endif
cur = cur.Append(FILE_PATH_LITERAL("pnacl"));
break;
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
#if defined(WIDEVINE_CDM_IS_COMPONENT)
case chrome::DIR_COMPONENT_WIDEVINE_CDM:
if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
@ -376,7 +376,7 @@ bool PathProvider(int key, base::FilePath* result) {
return false;
cur = cur.AppendASCII(kWidevineCdmAdapterFileName);
break;
#endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
case chrome::FILE_RESOURCES_PACK:
#if defined(OS_MACOSX) && !defined(OS_IOS)
if (base::mac::AmIBundled()) {

View file

@ -83,12 +83,6 @@ IPC_MESSAGE_CONTROL3(ChromeUtilityMsg_PatchFileCourgette,
base::FilePath /* output_file */)
// Requests the utility process to respond with a
// ChromeUtilityHostMsg_ProcessStarted message once it has started. This may
// be used if the host process needs a handle to the running utility process.
IPC_MESSAGE_CONTROL0(ChromeUtilityMsg_StartupPing)
#if defined(OS_WIN)
// Invokes ui::base::win::OpenFileViaShell from the utility process.
IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_OpenFileViaShell,

View file

@ -8,23 +8,27 @@
#include "ui/gfx/geometry/size.h"
PrintMsg_Print_Params::PrintMsg_Print_Params()
: page_size(),
content_size(),
printable_area(),
margin_top(0),
margin_left(0),
dpi(0),
min_shrink(0),
max_shrink(0),
desired_dpi(0),
document_cookie(0),
selection_only(false),
supports_alpha_blend(false),
print_scaling_option(blink::WebPrintScalingOptionSourceSize),
title(),
url(),
should_print_backgrounds(false),
device_name() {
: page_size(),
content_size(),
printable_area(),
margin_top(0),
margin_left(0),
dpi(0),
scale_factor(1.0f),
desired_dpi(0),
document_cookie(0),
selection_only(false),
supports_alpha_blend(false),
preview_ui_id(-1),
preview_request_id(0),
is_first_request(false),
print_scaling_option(blink::WebPrintScalingOptionSourceSize),
print_to_pdf(false),
display_header_footer(false),
title(),
url(),
should_print_backgrounds(false),
device_name() {
}
PrintMsg_Print_Params::~PrintMsg_Print_Params() {}
@ -36,15 +40,19 @@ void PrintMsg_Print_Params::Reset() {
margin_top = 0;
margin_left = 0;
dpi = 0;
min_shrink = 0;
max_shrink = 0;
scale_factor = 1.0f;
desired_dpi = 0;
document_cookie = 0;
selection_only = false;
supports_alpha_blend = false;
preview_ui_id = -1;
preview_request_id = 0;
is_first_request = false;
print_scaling_option = blink::WebPrintScalingOptionSourceSize;
title.clear();
url.clear();
print_to_pdf = false;
display_header_footer = false;
title = base::string16();
url = base::string16();
should_print_backgrounds = false;
device_name.clear();
}

View file

@ -40,15 +40,18 @@ struct PrintMsg_Print_Params {
int margin_top;
int margin_left;
double dpi;
double min_shrink;
double max_shrink;
double scale_factor;
int desired_dpi;
bool rasterize_pdf;
int document_cookie;
bool selection_only;
bool supports_alpha_blend;
int32_t preview_ui_id;
int preview_request_id;
bool is_first_request;
blink::WebPrintScalingOption print_scaling_option;
bool print_to_pdf;
bool display_header_footer;
base::string16 title;
base::string16 url;
bool should_print_backgrounds;
@ -96,11 +99,8 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params)
// Specifies dots per inch.
IPC_STRUCT_TRAITS_MEMBER(dpi)
// Minimum shrink factor. See PrintSettings::min_shrink for more information.
IPC_STRUCT_TRAITS_MEMBER(min_shrink)
// Maximum shrink factor. See PrintSettings::max_shrink for more information.
IPC_STRUCT_TRAITS_MEMBER(max_shrink)
// Specifies the scale factor in percent
IPC_STRUCT_TRAITS_MEMBER(scale_factor)
// Desired apparent dpi on paper.
IPC_STRUCT_TRAITS_MEMBER(desired_dpi)
@ -114,9 +114,26 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params)
// Does the printer support alpha blending?
IPC_STRUCT_TRAITS_MEMBER(supports_alpha_blend)
// *** Parameters below are used only for print preview. ***
// The print preview ui associated with this request.
IPC_STRUCT_TRAITS_MEMBER(preview_ui_id)
// The id of the preview request.
IPC_STRUCT_TRAITS_MEMBER(preview_request_id)
// True if this is the first preview request.
IPC_STRUCT_TRAITS_MEMBER(is_first_request)
// Specifies the page scaling option for preview printing.
IPC_STRUCT_TRAITS_MEMBER(print_scaling_option)
// True if print to pdf is requested.
IPC_STRUCT_TRAITS_MEMBER(print_to_pdf)
// Specifies if the header and footer should be rendered.
IPC_STRUCT_TRAITS_MEMBER(display_header_footer)
// Title string to be printed as header if requested by the user.
IPC_STRUCT_TRAITS_MEMBER(title)
@ -305,9 +322,10 @@ IPC_MESSAGE_ROUTED2(PrintHostMsg_PrintPreviewFailed,
// Tell the utility process to start rendering the given PDF into a metafile.
// Utility process would be alive until
// ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop message.
IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles,
IPC::PlatformFileForTransit, /* input_file */
printing::PdfRenderSettings /* settings */)
IPC_MESSAGE_CONTROL3(ChromeUtilityMsg_RenderPDFPagesToMetafiles,
IPC::PlatformFileForTransit /* input_file */,
printing::PdfRenderSettings /* settings */,
bool /* print_text_with_gdi */)
// Requests conversion of the next page.
IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles_GetPage,
@ -326,4 +344,12 @@ IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageCount,
IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageDone,
bool /* success */,
float /* scale_factor */)
// Request that the given font characters be loaded by the browser so it's
// cached by the OS. Please see
// PdfToEmfUtilityProcessHostClient::OnPreCacheFontCharacters for details.
IPC_SYNC_MESSAGE_CONTROL2_0(ChromeUtilityHostMsg_PreCacheFontCharacters,
LOGFONT /* font_data */,
base::string16 /* characters */)
#endif

View file

@ -7,13 +7,13 @@
#include <vector>
#include "ipc/ipc_message_macros.h"
// #include "ipc/ipc_param_traits.h"
#include "ppapi/features/features.h"
#define IPC_MESSAGE_START ChromeMsgStart
// Renderer -> Browser messages.
#if defined(ENABLE_PEPPER_CDMS)
#if BUILDFLAG(ENABLE_PEPPER_CDMS)
// Returns whether any internal plugin supporting |mime_type| is registered and
// enabled. Does not determine whether the plugin can actually be instantiated
// (e.g. whether it has all its dependencies).