Bug 1276910 - Do not show "Add to home screen" prompt in private browsing. r=margaret, a=sylvestre
authorSebastian Kaspari <s.kaspari@gmail.com>
Mon, 06 Jun 2016 10:28:57 +0200
changeset 335282 55772f8675f35621f77d50a62d747aba71d7b069
parent 335281 d8adb38dd576398dacbfb96d2c247f8e0158bdf1
child 335283 5c8f37e61ac7af86accd5d86f6c9d10cd0eadf64
push id1146
push userCallek@gmail.com
push dateMon, 25 Jul 2016 16:35:44 +0000
treeherdermozilla-release@a55778f9cd5a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret, sylvestre
bugs1276910
milestone48.0a2
Bug 1276910 - Do not show "Add to home screen" prompt in private browsing. r=margaret, a=sylvestre
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
@@ -104,16 +104,21 @@ public class AddToHomeScreenPromotion im
             return;
         }
 
         if (!Tabs.getInstance().isSelectedTab(tab)) {
             // We only ever want to show this promotion for the current tab.
             return;
         }
 
+        if (tab.isPrivate()) {
+            // Never show the prompt for private browsing tabs.
+            return;
+        }
+
         if (Tabs.TabEvents.LOADED == msg) {
             ThreadUtils.postToBackgroundThread(new Runnable() {
                 @Override
                 public void run() {
                     maybeShowPromotionForUrl(tab.getURL(), tab.getTitle());
                 }
             });
         }