From 034b23ff4165bb9f84e4d6a4fbb52be75cc1a7b1 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Wed, 23 Sep 2015 14:48:28 -0700 Subject: [PATCH] Bug 1173147 - Explicitly show Android chooser when there is more than one intent URI match in pb. r=sebastian After this changeset series, the expected flow for web links is: * If not pb, open the Intent URI * If pb and no matching applications, open about:neterror * If pb and one matching application, show this dialog * If pb and > 1 matching application, show the Android system chooser When the user explicitly chooses to share (and thus should infer they're exiting Private Browsing), we don't show the dialog. Custom URIs sort of work: I tested `mailto` and it worked as expected but `tel` does not work as expected (i.e. it doesn't show the dialog). Perhaps there's an explicit "Open dialer" code path. To figure this out, I tested this patch against my Intent URI test page [1]. Decisions around explicitly showing the Android chooser: When there are multiple application matches to an Intent URI, we want to show the Android Intent Chooser. However, we have no way of distinguishing regular tabs from private tabs to the chooser. Thus, if a user chooses "Always" in regular browsing mode, the chooser will not be shown and the URL will be opened. Therefore we explicitly show the chooser (which notably does not have an "Always" option). [1]: https://people.mozilla.org/~mcomella/test/uri.html --HG-- extra : commitid : 1cCVQe5jmNx extra : rebase_source : 146766c2ac5cf8814288377453253debc2ff3f8a --- mobile/android/base/locales/en-US/android_strings.dtd | 8 ++++++++ mobile/android/base/strings.xml.in | 1 + ...rnalIntentDuringPrivateBrowsingPromptFragment.java | 11 ++++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/mobile/android/base/locales/en-US/android_strings.dtd b/mobile/android/base/locales/en-US/android_strings.dtd index a448e4ef5786..8058cae1ddf4 100644 --- a/mobile/android/base/locales/en-US/android_strings.dtd +++ b/mobile/android/base/locales/en-US/android_strings.dtd @@ -710,6 +710,14 @@ just addresses the organization to follow, e.g. "This site is run by " --> clicks a link that will open an external Android application. "&formatS;" will be replaced with the name of the application that will be opened. --> + +