2021-05-19 23:15:47 +00:00
|
|
|
// Copyright 2020 Microsoft, Inc. All rights reserved.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "shell/browser/printing/print_view_manager_electron.h"
|
|
|
|
|
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
#include "build/build_config.h"
|
|
|
|
|
|
|
|
namespace electron {
|
|
|
|
|
|
|
|
PrintViewManagerElectron::PrintViewManagerElectron(
|
|
|
|
content::WebContents* web_contents)
|
|
|
|
: PrintViewManagerBase(web_contents) {}
|
|
|
|
|
2021-06-04 04:16:13 +00:00
|
|
|
PrintViewManagerElectron::~PrintViewManagerElectron() = default;
|
2021-05-19 23:15:47 +00:00
|
|
|
|
2021-08-24 00:52:17 +00:00
|
|
|
// static
|
|
|
|
void PrintViewManagerElectron::BindPrintManagerHost(
|
|
|
|
mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost> receiver,
|
|
|
|
content::RenderFrameHost* rfh) {
|
|
|
|
auto* web_contents = content::WebContents::FromRenderFrameHost(rfh);
|
|
|
|
if (!web_contents)
|
|
|
|
return;
|
|
|
|
auto* print_manager = PrintViewManagerElectron::FromWebContents(web_contents);
|
|
|
|
if (!print_manager)
|
|
|
|
return;
|
|
|
|
print_manager->BindReceiver(std::move(receiver), rfh);
|
|
|
|
}
|
|
|
|
|
2021-05-19 23:15:47 +00:00
|
|
|
void PrintViewManagerElectron::SetupScriptedPrintPreview(
|
|
|
|
SetupScriptedPrintPreviewCallback callback) {
|
|
|
|
std::move(callback).Run();
|
|
|
|
}
|
|
|
|
|
|
|
|
void PrintViewManagerElectron::ShowScriptedPrintPreview(
|
|
|
|
bool source_is_modifiable) {}
|
|
|
|
|
|
|
|
void PrintViewManagerElectron::RequestPrintPreview(
|
|
|
|
printing::mojom::RequestPrintPreviewParamsPtr params) {}
|
|
|
|
|
|
|
|
void PrintViewManagerElectron::CheckForCancel(int32_t preview_ui_id,
|
|
|
|
int32_t request_id,
|
|
|
|
CheckForCancelCallback callback) {
|
|
|
|
}
|
|
|
|
|
2021-10-21 18:51:36 +00:00
|
|
|
WEB_CONTENTS_USER_DATA_KEY_IMPL(PrintViewManagerElectron);
|
2021-05-19 23:15:47 +00:00
|
|
|
|
|
|
|
} // namespace electron
|