Print enhancement: add webContents.printerList And a print option to select printer

Print enhancement: add webContents.printerList And a print option to select printer
This commit is contained in:
renaesop 2017-02-07 09:58:14 +08:00
parent 26135b412b
commit 7f2705b2d9
5 changed files with 12 additions and 13 deletions

View file

@ -115,7 +115,7 @@ void PrintSettingsToJobSettings(const PrintSettings& settings,
job_settings->SetInteger(kSettingDuplexMode, settings.duplex_mode());
job_settings->SetBoolean(kSettingLandscape, settings.landscape());
job_settings->SetString(kSettingDeviceName, settings.device_name());
job_settings->SetInteger("scaleFactor", 100);
job_settings->SetInteger(kSettingScaleFactor, 100);
job_settings->SetBoolean("rasterizePDF", false);
job_settings->SetInteger("desiredDpi", settings.desired_dpi());
@ -126,7 +126,7 @@ void PrintSettingsToJobSettings(const PrintSettings& settings,
job_settings->SetBoolean(kSettingPrintWithPrivet, false);
job_settings->SetBoolean(kSettingPrintWithExtension, false);
job_settings->SetBoolean("showSystemDialog", false);
job_settings->SetBoolean(kSettingShowSystemDialog, false);
job_settings->SetInteger(kSettingPreviewPageCount, 1);
}

View file

@ -102,16 +102,11 @@ void PrinterQuery::GetSettings(
DCHECK(!is_print_dialog_box_shown_);
StartWorker(callback);
// Real work is done in PrintJobWorker::GetSettings().
is_print_dialog_box_shown_ = ask_user_for_settings == ASK_USER;
is_print_dialog_box_shown_ = false;
worker_->PostTask(FROM_HERE,
base::Bind(&PrintJobWorker::GetSettings,
base::Unretained(worker_.get()),
is_print_dialog_box_shown_,
expected_page_count,
has_selection,
margin_type,
device_name));
base::Bind(&PrintJobWorker::GetSettings, base::Unretained(worker_.get()),
is_print_dialog_box_shown_, expected_page_count, has_selection,
margin_type, is_scripted, is_modifiable, device_name));
}
void PrinterQuery::SetSettings(

View file

@ -58,6 +58,8 @@ class PrinterQuery : public PrintJobWorkerOwner {
int expected_page_count,
bool has_selection,
MarginType margin_type,
bool is_scripted,
bool is_modifiable,
const base::string16& device_name,
const base::Closure& callback);

View file

@ -190,10 +190,12 @@ void PrintingMessageFilter::OnInitSettingWithDeviceName(const base::string16& de
// Loads default settings. This is asynchronous, only the IPC message sender
// will hang until the settings are retrieved.
printer_query->GetSettings(
PrinterQuery::DEFAULTS,
PrinterQuery::GetSettingsAskParam::DEFAULTS,
0,
false,
DEFAULT_MARGINS,
true,
true,
device_name,
base::Bind(&PrintingMessageFilter::OnGetDefaultPrintSettingsReply,
this,

2
vendor/native_mate vendored

@ -1 +1 @@
Subproject commit b5e5de626c6a57e44c7e6448d8bbaaac475d493c
Subproject commit 7197368c6d9e36696d23d33ec603701789da329d