New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 755373 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Printing on interstitial page hangs

Project Member Reported by ctzsm@chromium.org, Aug 14 2017

Issue description

Chrome Version: Develop Build

What steps will reproduce the problem?
(1) go to https://expired.badssl.com
(2) three dots on the top right -> share -> Print
(3) Observe

Printing UI shows "Preparing preview..." forever.
 
screen.png
100 KB View Download

Comment 1 by ctzsm@chromium.org, Aug 14 2017

Cc: tedc...@chromium.org thestig@chromium.org
Labels: OS-Android
The root issue is that we are not checking the return value of bool PrintNow()
https://chromium.googlesource.com/chromium/src/+/master/chrome/browser/android/tab_android.cc#600

In bool PrintNowInternal() we checked if there was an interstitial then don't do printing job, so check bool PrintNow() return value is sufficient, it will cause onWriteFailed called, then Android framework notifies user that there was something wrong.

But in turns of UX, I think we should disable printing option, make it consistent with desktop version, i.e. no "print" option, nor Ctrl + P works. Or even disable share at all.

tedchoc@, does disable "share" or "Print" on interstitial page sound reasonable?
I think disabling either print or share seems fine to me.  I don't see why we'd want to be able to do either of those if we are showing an interstitial.

I guess should we be disabling download, bookmark and other items as well?
Cc: k...@chromium.org
+ktam for any product weigh in here
Project Member

Comment 4 by bugdroid1@chromium.org, Aug 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/883520af718bb5409b6819e92534f42340ae389e

commit 883520af718bb5409b6819e92534f42340ae389e
Author: Shimi Zhang <ctzsm@chromium.org>
Date: Tue Aug 15 00:12:31 2017

[Android] Check return value of PrintNow()

Printing job hangs on interstitial page because we ignored
the return value of print_view_manager->PrintNow(rfh), in
PrintNowInternal(), which is called in PrintNow(), we checked
if current web_contents() was showing interstitial page then
returned false.

Now we are returning false if PrintNow() returns false. So
on interstiatial page or web_contents() crashed, we can safely
terminate printing job and notify user there is something
wrong in the backend withoug confusing user.

Bug:  755373 
Change-Id: I07a4a0c4204a86c849813c782481d6ee8d72ec67
Reviewed-on: https://chromium-review.googlesource.com/614658
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#494258}
[modify] https://crrev.com/883520af718bb5409b6819e92534f42340ae389e/chrome/browser/android/tab_android.cc

Comment 5 by k...@chromium.org, Aug 15 2017

Yes, I'm fine with disabling print/share on interstitials. There's not much to act on there.
Project Member

Comment 6 by bugdroid1@chromium.org, Aug 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/463c44df5a3c9006c3cdf6e1253a8ba478906d5f

commit 463c44df5a3c9006c3cdf6e1253a8ba478906d5f
Author: Shimi Zhang <ctzsm@chromium.org>
Date: Thu Aug 17 06:16:45 2017

[Android] Disabling share/print option for interstitials

We can not do printing job for an interstitial page, and "share" is
not meaningful for interstitial either. So disabling them to not
confuse user.

Bug:  755373 
Change-Id: Ib23858aebccc797eb04b323a9b7af00821e27fda
Reviewed-on: https://chromium-review.googlesource.com/616249
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495092}
[modify] https://crrev.com/463c44df5a3c9006c3cdf6e1253a8ba478906d5f/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
[modify] https://crrev.com/463c44df5a3c9006c3cdf6e1253a8ba478906d5f/chrome/android/java/src/org/chromium/chrome/browser/printing/PrintShareActivity.java

Comment 7 by ctzsm@chromium.org, Aug 24 2017

Status: Fixed (was: Assigned)

Sign in to add a comment