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

Issue 732833 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Back from new tab from Chrome Home closes Chrome

Project Member Reported by dgn@chromium.org, Jun 13 2017

Issue description

1. Launch Chrome with Chrome Home enabled
2. Do whatever
3. Open new tab
4. Select suggestion from Chrome Home
5. Press back

Expected: Navigate back from the page, here that would mean coming back to ChromeHome over the tab switcher which was the previous state

Actual: Chrome goes in the background

That is related to issue 708935 where we made the back button put Chrome in the background when we were on the Chrome Home NTP. Now that the NTP is the Home sheet over the tab switcher, I sounds like we should go back there instead of closing the app.

If we care for maintaining existing behaviours, in regular Chrome, back returns to the NTP where a new navigation can be initiated rather than closing the app.
 

Comment 1 by k...@chromium.org, Jun 13 2017

Cc: cl...@chromium.org
If I recall, this change happened because we made the NTP a modal dialog. I'm not sure how hard this would be to do with the new NTP. @Theresa do you know?

However, one thing I might imagine is that since the NTP is modal, you would lose the ability to go forward from the NTP if you tapped back too many times which could be bad.
Cc: mdjones@chromium.org
+mdjones@ Since he's worked with some of the back-press logic.

Chrome goes to the background because there's nothing in the navigation history to go back to and ChromeTabbedActivity's logic in handleBackPressed() determines that we should minimize the app rather than closing the tab.

We don't currently track tabs opened from the option menu/new tab button separately from tabs opened via push notifications, keyboard shortcuts or other Chrome UI surfaces, though, so we may need a new TabLaunchType. But we should be able to do something in ChromeTabbedActivity#handleBackPressed() if we want to change the behavior.

Comment 3 by k...@chromium.org, Jun 15 2017

The main trade off I see is that the user can't go forward when hitting the NTP and may end up closing the tab (and removing all the history). However, I suspect this is a rare case so I'm fine with returning to the NTP. @Chris - do you have any thoughts here?

Comment 4 by k...@chromium.org, Jun 15 2017

Alternatively we can bring up Chrome Home to half height on the current page without going back to the full NTP Chrome Home.

Comment 5 by dgn@chromium.org, Jun 15 2017

In this case my expectation was that the tab would close. That's what happens on intents from other apps or when opening pages in a new tab. Which is why I would expect to go back to the NTP-over-tab-switcher state (i.e. preferring #c3 tp #c4)

Comment 6 by k...@chromium.org, Jun 15 2017

Closing the tab would be a change from today's behavior so I'd be a little more cautious about that. Many people use back repeatedly to close Chrome and we have no been closing their tab when they do so, meaning changing this behavior may be surprising. I'm not against the idea though.
 Issue 736810  has been merged into this issue.

Comment 8 by k...@chromium.org, Jun 26 2017

Ah yes - adding comment in.

We have been receiving feedback reports about users thinking their back button was broken by closing the app.

When the user navigates to a page from the NTP and taps back, we should go back to the NTP. Ideally, if the user taps back again, we can then close the app (to preserve the old behavior).
Ted, Kingston and I discussed this offline. A simple(ish) v1 approach would be to open the bottom sheet over the current tab instead of minimizing the app; if the user presses back again we would close the bottom sheet and a minimize the app. We can use TabLaunchType.FROM_CHROME_UI to determine when open the bottom sheet over the current tab; we need new tracking (probably in bottom sheet) to determine when to minimize the app on a successive back press.
Project Member

Comment 10 by bugdroid1@chromium.org, Jul 7 2017

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

commit f9a5bc602e1637160708dc1b7f168e777fc2b7ae
Author: Matthew Jones <mdjones@chromium.org>
Date: Fri Jul 07 16:23:58 2017

[Home] Back button opens sheet if back navigation impossible

If a tab is created via Chrome's UI, hitting the back button will
eventually expand the bottom sheet before sending Chrome to the
background. Tests for the intended behaviors have been added as
well.

BUG= 732833 

Change-Id: I8d8308dcb7e21d1ee49fa3ab439cf7387c78f86b
Reviewed-on: https://chromium-review.googlesource.com/550929
Commit-Queue: Matthew Jones <mdjones@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#484945}
[modify] https://crrev.com/f9a5bc602e1637160708dc1b7f168e777fc2b7ae/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
[modify] https://crrev.com/f9a5bc602e1637160708dc1b7f168e777fc2b7ae/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java
[modify] https://crrev.com/f9a5bc602e1637160708dc1b7f168e777fc2b7ae/chrome/android/java_sources.gni
[add] https://crrev.com/f9a5bc602e1637160708dc1b7f168e777fc2b7ae/chrome/android/javatests/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetBackBehaviorTest.java

Status: Fixed (was: Assigned)
Marking as fixed, we can discuss followups to this in a different bug.

Sign in to add a comment