Bug 1276910 - Do not show "Add to home screen" prompt in private browsing. r=margaret
authorSebastian Kaspari <s.kaspari@gmail.com>
Wed, 01 Jun 2016 10:02:51 +0200
changeset 340901 faa1661edc002da6a574b08a4b24c9a55f29e6d3
parent 340900 e3d409d10dea7c1c94630abf52e6e9245a77f448
child 340902 7cd31f8bca620bd6942349de365937a8115ae46b
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1276910
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1276910 - Do not show "Add to home screen" prompt in private browsing. r=margaret MozReview-Commit-ID: DFoMnyx4Gde
mobile/android/base/java/org/mozilla/gecko/promotion/AddToHomeScreenPromotion.java
--- a/mobile/android/base/java/org/mozilla/gecko/promotion/AddToHomeScreenPromotion.java
+++ b/mobile/android/base/java/org/mozilla/gecko/promotion/AddToHomeScreenPromotion.java
@@ -129,16 +129,21 @@ public class AddToHomeScreenPromotion ex
             // We only ever want to show this promotion for the current tab.
             return;
         }
 
         if (Tabs.TabEvents.LOADED != msg) {
             return;
         }
 
+        if (tab.isPrivate()) {
+            // Never show the prompt for private browsing tabs.
+            return;
+        }
+
         if (!isInForeground) {
             // We only want to show this prompt if this tab is in the foreground and not on top
             // of the tabs tray.
             return;
         }
 
         ThreadUtils.postToBackgroundThread(new Runnable() {
             @Override