Remove some unused IPC messages.
This commit is contained in:
parent
47439cd77c
commit
93243ef223
5 changed files with 0 additions and 116 deletions
|
@ -132,7 +132,6 @@ class Window : public mate::EventEmitter,
|
||||||
bool IsDocumentEdited();
|
bool IsDocumentEdited();
|
||||||
void CapturePage(mate::Arguments* args);
|
void CapturePage(mate::Arguments* args);
|
||||||
void Print(mate::Arguments* args);
|
void Print(mate::Arguments* args);
|
||||||
void PrintToPDF(mate::Arguments* args);
|
|
||||||
void SetProgressBar(double progress);
|
void SetProgressBar(double progress);
|
||||||
void SetOverlayIcon(const gfx::Image& overlay,
|
void SetOverlayIcon(const gfx::Image& overlay,
|
||||||
const std::string& description);
|
const std::string& description);
|
||||||
|
|
|
@ -76,21 +76,6 @@ PrintPreviewMessageHandler::PrintPreviewMessageHandler(
|
||||||
PrintPreviewMessageHandler::~PrintPreviewMessageHandler() {
|
PrintPreviewMessageHandler::~PrintPreviewMessageHandler() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintPreviewMessageHandler::OnDidGetPreviewPageCount(
|
|
||||||
const PrintHostMsg_DidGetPreviewPageCount_Params& params) {
|
|
||||||
if (params.page_count <= 0) {
|
|
||||||
NOTREACHED();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PrintPreviewMessageHandler::OnDidPreviewPage(
|
|
||||||
const PrintHostMsg_DidPreviewPage_Params& params) {
|
|
||||||
int page_number = params.page_number;
|
|
||||||
if (page_number < FIRST_PAGE_INDEX || !params.data_size)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PrintPreviewMessageHandler::OnMetafileReadyForPrinting(
|
void PrintPreviewMessageHandler::OnMetafileReadyForPrinting(
|
||||||
const PrintHostMsg_DidPreviewDocument_Params& params) {
|
const PrintHostMsg_DidPreviewDocument_Params& params) {
|
||||||
// Always try to stop the worker.
|
// Always try to stop the worker.
|
||||||
|
@ -116,10 +101,6 @@ bool PrintPreviewMessageHandler::OnMessageReceived(
|
||||||
const IPC::Message& message) {
|
const IPC::Message& message) {
|
||||||
bool handled = true;
|
bool handled = true;
|
||||||
IPC_BEGIN_MESSAGE_MAP(PrintPreviewMessageHandler, message)
|
IPC_BEGIN_MESSAGE_MAP(PrintPreviewMessageHandler, message)
|
||||||
IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetPreviewPageCount,
|
|
||||||
OnDidGetPreviewPageCount)
|
|
||||||
IPC_MESSAGE_HANDLER(PrintHostMsg_DidPreviewPage,
|
|
||||||
OnDidPreviewPage)
|
|
||||||
IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting,
|
IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting,
|
||||||
OnMetafileReadyForPrinting)
|
OnMetafileReadyForPrinting)
|
||||||
IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewFailed,
|
IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewFailed,
|
||||||
|
|
|
@ -12,22 +12,12 @@
|
||||||
#include "content/public/browser/web_contents_observer.h"
|
#include "content/public/browser/web_contents_observer.h"
|
||||||
#include "content/public/browser/web_contents_user_data.h"
|
#include "content/public/browser/web_contents_user_data.h"
|
||||||
|
|
||||||
struct PrintHostMsg_DidGetPreviewPageCount_Params;
|
|
||||||
struct PrintHostMsg_DidPreviewDocument_Params;
|
struct PrintHostMsg_DidPreviewDocument_Params;
|
||||||
struct PrintHostMsg_DidPreviewPage_Params;
|
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
class WebContents;
|
class WebContents;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace mate {
|
|
||||||
class Dictionary;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace gfx {
|
|
||||||
class Rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace printing {
|
namespace printing {
|
||||||
|
|
||||||
struct PageSizeMargins;
|
struct PageSizeMargins;
|
||||||
|
@ -53,9 +43,6 @@ class PrintPreviewMessageHandler
|
||||||
friend class content::WebContentsUserData<PrintPreviewMessageHandler>;
|
friend class content::WebContentsUserData<PrintPreviewMessageHandler>;
|
||||||
|
|
||||||
// Message handlers.
|
// Message handlers.
|
||||||
void OnDidGetPreviewPageCount(
|
|
||||||
const PrintHostMsg_DidGetPreviewPageCount_Params& params);
|
|
||||||
void OnDidPreviewPage(const PrintHostMsg_DidPreviewPage_Params& params);
|
|
||||||
void OnMetafileReadyForPrinting(
|
void OnMetafileReadyForPrinting(
|
||||||
const PrintHostMsg_DidPreviewDocument_Params& params);
|
const PrintHostMsg_DidPreviewDocument_Params& params);
|
||||||
void OnPrintPreviewFailed(int document_cookie, int request_id);
|
void OnPrintPreviewFailed(int document_cookie, int request_id);
|
||||||
|
|
|
@ -187,40 +187,6 @@ IPC_STRUCT_BEGIN(PrintHostMsg_ScriptedPrint_Params)
|
||||||
IPC_STRUCT_MEMBER(printing::MarginType, margin_type)
|
IPC_STRUCT_MEMBER(printing::MarginType, margin_type)
|
||||||
IPC_STRUCT_END()
|
IPC_STRUCT_END()
|
||||||
|
|
||||||
// Parameters to describe a rendered preview page.
|
|
||||||
IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewPage_Params)
|
|
||||||
// A shared memory handle to metafile data for a draft document of the page.
|
|
||||||
IPC_STRUCT_MEMBER(base::SharedMemoryHandle, metafile_data_handle)
|
|
||||||
|
|
||||||
// Size of metafile data.
|
|
||||||
IPC_STRUCT_MEMBER(uint32, data_size)
|
|
||||||
|
|
||||||
// |page_number| is zero-based and can be |printing::INVALID_PAGE_INDEX| if it
|
|
||||||
// is just a check.
|
|
||||||
IPC_STRUCT_MEMBER(int, page_number)
|
|
||||||
|
|
||||||
// The id of the preview request.
|
|
||||||
IPC_STRUCT_MEMBER(int, preview_request_id)
|
|
||||||
IPC_STRUCT_END()
|
|
||||||
|
|
||||||
// Parameters sent along with the page count.
|
|
||||||
IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params)
|
|
||||||
// Cookie for the document to ensure correctness.
|
|
||||||
IPC_STRUCT_MEMBER(int, document_cookie)
|
|
||||||
|
|
||||||
// Total page count.
|
|
||||||
IPC_STRUCT_MEMBER(int, page_count)
|
|
||||||
|
|
||||||
// Indicates whether the previewed document is modifiable.
|
|
||||||
IPC_STRUCT_MEMBER(bool, is_modifiable)
|
|
||||||
|
|
||||||
// The id of the preview request.
|
|
||||||
IPC_STRUCT_MEMBER(int, preview_request_id)
|
|
||||||
|
|
||||||
// Indicates whether the existing preview data needs to be cleared or not.
|
|
||||||
IPC_STRUCT_MEMBER(bool, clear_preview_data)
|
|
||||||
IPC_STRUCT_END()
|
|
||||||
|
|
||||||
// Parameters to describe a rendered document.
|
// Parameters to describe a rendered document.
|
||||||
IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params)
|
IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params)
|
||||||
// A shared memory handle to metafile data.
|
// A shared memory handle to metafile data.
|
||||||
|
@ -318,20 +284,12 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
|
||||||
IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed,
|
IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed,
|
||||||
int /* document cookie */)
|
int /* document cookie */)
|
||||||
|
|
||||||
// Notify the browser a print preview page has been rendered.
|
|
||||||
IPC_MESSAGE_ROUTED1(PrintHostMsg_DidPreviewPage,
|
|
||||||
PrintHostMsg_DidPreviewPage_Params /* params */)
|
|
||||||
|
|
||||||
// Sends back to the browser the complete rendered document (non-draft mode,
|
// Sends back to the browser the complete rendered document (non-draft mode,
|
||||||
// used for printing) that was requested by a PrintMsg_PrintPreview message.
|
// used for printing) that was requested by a PrintMsg_PrintPreview message.
|
||||||
// The memory handle in this message is already valid in the browser process.
|
// The memory handle in this message is already valid in the browser process.
|
||||||
IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting,
|
IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting,
|
||||||
PrintHostMsg_DidPreviewDocument_Params /* params */)
|
PrintHostMsg_DidPreviewDocument_Params /* params */)
|
||||||
|
|
||||||
// Notify the browser the number of pages in the print preview document.
|
|
||||||
IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount,
|
|
||||||
PrintHostMsg_DidGetPreviewPageCount_Params /* params */)
|
|
||||||
|
|
||||||
IPC_MESSAGE_ROUTED2(PrintHostMsg_PrintPreviewFailed,
|
IPC_MESSAGE_ROUTED2(PrintHostMsg_PrintPreviewFailed,
|
||||||
int /* document cookie */,
|
int /* document cookie */,
|
||||||
int /* request_id */);
|
int /* request_id */);
|
||||||
|
|
|
@ -777,31 +777,6 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PageSizeMargins default_page_layout;
|
|
||||||
ComputePageLayoutInPointsForCss(print_preview_context_.prepared_frame(), 0,
|
|
||||||
print_params, ignore_css_margins_, NULL,
|
|
||||||
&default_page_layout);
|
|
||||||
|
|
||||||
//bool has_page_size_style =
|
|
||||||
//PrintingFrameHasPageSizeStyle(print_preview_context_.prepared_frame(),
|
|
||||||
//print_preview_context_.total_page_count());
|
|
||||||
int dpi = GetDPI(&print_params);
|
|
||||||
|
|
||||||
gfx::Rect printable_area_in_points(
|
|
||||||
ConvertUnit(print_params.printable_area.x(), dpi, kPointsPerInch),
|
|
||||||
ConvertUnit(print_params.printable_area.y(), dpi, kPointsPerInch),
|
|
||||||
ConvertUnit(print_params.printable_area.width(), dpi, kPointsPerInch),
|
|
||||||
ConvertUnit(print_params.printable_area.height(), dpi, kPointsPerInch));
|
|
||||||
|
|
||||||
|
|
||||||
PrintHostMsg_DidGetPreviewPageCount_Params params;
|
|
||||||
params.page_count = print_preview_context_.total_page_count();
|
|
||||||
params.is_modifiable = print_preview_context_.IsModifiable();
|
|
||||||
params.document_cookie = print_params.document_cookie;
|
|
||||||
params.preview_request_id = print_params.preview_request_id;
|
|
||||||
params.clear_preview_data = print_preview_context_.generate_draft_pages();
|
|
||||||
Send(new PrintHostMsg_DidGetPreviewPageCount(routing_id(), params));
|
|
||||||
|
|
||||||
while (!print_preview_context_.IsFinalPageRendered()) {
|
while (!print_preview_context_.IsFinalPageRendered()) {
|
||||||
int page_number = print_preview_context_.GetNextPageNumber();
|
int page_number = print_preview_context_.GetNextPageNumber();
|
||||||
DCHECK_GE(page_number, 0);
|
DCHECK_GE(page_number, 0);
|
||||||
|
@ -1226,22 +1201,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintHostMsg_DidPreviewPage_Params preview_page_params;
|
|
||||||
// Get the size of the resulting metafile.
|
|
||||||
uint32 buf_size = metafile->GetDataSize();
|
|
||||||
DCHECK_GT(buf_size, 0u);
|
|
||||||
if (!CopyMetafileDataToSharedMem(
|
|
||||||
metafile, &(preview_page_params.metafile_data_handle))) {
|
|
||||||
LOG(ERROR) << "CopyMetafileDataToSharedMem failed";
|
|
||||||
print_preview_context_.set_error(PREVIEW_ERROR_METAFILE_COPY_FAILED);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
preview_page_params.data_size = buf_size;
|
|
||||||
preview_page_params.page_number = page_number;
|
|
||||||
preview_page_params.preview_request_id =
|
|
||||||
print_pages_params_->params.preview_request_id;
|
|
||||||
|
|
||||||
Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue