Bug 1414084 - Part 17 - Fix setting of private browsing theme state. r?grisha draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Fri, 02 Mar 2018 18:01:28 +0100
changeset 823892 8902c9e7ecd2b9cd7e2f0f79f3c0bdcc64c6710a
parent 823891 3d32da755f021757770513b5ffb23872f62af05e
push id117809
push usermozilla@buttercookie.de
push dateSun, 29 Jul 2018 18:19:15 +0000
reviewersgrisha
bugs1414084
milestone63.0a1
Bug 1414084 - Part 17 - Fix setting of private browsing theme state. r?grisha Previously, this wasn't noticeable since adding/removing a PageAction would call refreshPageActionIcons(), which would do the correct thing, but now a newly created PageActionLayout can start with an already pre-populated mPageAction- List, which means that the subsequently arriving call to setPrivateMode() will erroneously activate the private mode tinting for all PageActions that support it. MozReview-Commit-ID: EvNx1Q9vwZ5
mobile/android/base/java/org/mozilla/gecko/toolbar/PageActionLayout.java
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/PageActionLayout.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/PageActionLayout.java
@@ -121,17 +121,17 @@ public class PageActionLayout extends Th
     }
 
     @Override
     public void setPrivateMode(boolean isPrivate) {
         super.setPrivateMode(isPrivate);
         for (int i = 0; i < getChildCount(); i++) {
             View child = getChildAt(i);
             if (child instanceof ThemedImageButton) {
-                ((ThemedImageButton) child).setPrivateMode(true);
+                ((ThemedImageButton) child).setPrivateMode(isPrivate);
             }
         }
     }
 
     private void setNumberShown(int count) {
         ThreadUtils.assertOnUiThread();
 
         mMaxVisiblePageActions = count;