Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: default printer if none is provided #21956

Merged
merged 2 commits into from Jan 31, 2020
Merged

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Jan 29, 2020

Description of Change

Related to #21946, but distinct enough a unit of work that i've chosen to make this its own PR. This removes a section of printing.patch by choosing the system default if no printer is passed by the user. This is what happened previously at the chromium level, but as a result of not setting the kSettingDeviceName key; we can instead take control of this ourselves.

cc @deepak1556 @ckerr

Checklist

Release Notes

Notes: Use system default printer if none is provided.

@codebytere codebytere requested a review from a team as a code owner January 29, 2020 18:26
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jan 29, 2020
Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with minor change

shell/browser/api/atom_api_web_contents.cc Outdated Show resolved Hide resolved
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jan 30, 2020
Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linux crash seems legit, lets investigate before merging

@codebytere codebytere merged commit 08b1f0e into master Jan 31, 2020
@release-clerk
Copy link

release-clerk bot commented Jan 31, 2020

No Release Notes

@codebytere codebytere deleted the default-to-default-printer branch January 31, 2020 19:20
@trop
Copy link
Contributor

trop bot commented Jan 31, 2020

I was unable to backport this PR to "7-1-x" cleanly;
you will need to perform this backport manually.

@trop trop bot removed the target/7-1-x label Jan 31, 2020
@trop
Copy link
Contributor

trop bot commented Jan 31, 2020

I was unable to backport this PR to "8-x-y" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Feb 3, 2020

@codebytere has manually backported this PR to "8-x-y", please check out #22011

print_settings.SetStringKey(printing::kSettingDeviceName, printer_name);

auto* print_view_manager =
printing::PrintViewManagerBasic::FromWebContents(web_contents());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Continuing discussion about #21986 (comment) , the crash is caused by this line.

This function is registered as a weak callback to the task runner below, so that its not invoked when the api::WebContents is not available. Based on the crash it seems content::WebContents is not available in the callback, @zcbenz is it possible for api::WebContents to be alive while the content::WebContents is not ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
8.2.x
Fixed in 8.0.1
Development

Successfully merging this pull request may close these issues.

None yet

3 participants