Bug 1185173 - Update toolbar icons for passive mixed content. r=margaret
authorChenxia Liu <liuche@mozilla.com>
Wed, 05 Aug 2015 18:26:12 -0700
changeset 288320 d015d5ec2f321017f780b271c196e2e2b0795ef7
parent 288319 53d87544fdf4b93a562ef8dabbc85449c8b292e3
child 288321 4218f5a569ad33636d8ae2918ddbbbbd6e5f32ac
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1185173
milestone42.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 1185173 - Update toolbar icons for passive mixed content. r=margaret
mobile/android/base/resources/drawable-hdpi/warning_minor.png
mobile/android/base/resources/drawable-large-v11/site_security_level.xml
mobile/android/base/resources/drawable-xhdpi/warning_minor.png
mobile/android/base/resources/drawable-xxhdpi/warning_minor.png
mobile/android/base/resources/drawable/site_security_level.xml
mobile/android/base/toolbar/ToolbarDisplayLayout.java
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0a1f4867e20d11a2bd7d56e7100fb48038593a5e
GIT binary patch
literal 544
zc$@(s0^j|KP)<h;3K|Lk000e1NJLTq0015U0015c1^@s6J20-I00001b5ch_0Itp)
z=>Px$+DSw~R7efgmcdQ}F%X8^6}_n3d;;Q4pTL90XhIAGym0biIQSUGn_dN$7!r-~
zJ%lIlWQ-@FwbRY4yWMu%DPANgoenee_3t#KjQzLIC`~V5#O|BNBtE3+377l@awV6i
zm)-6wwN64!fOrMHmQo?r06V4z89bU!&lK<oVPJy~*P$~R%mf=&irajZpt6GmHq~OO
z7}X@ORV~tqs)NBUwaBHa4h9$1a=6Qk-|3-jgcoCSpTh_OSJX;&-|uy<U@&E4ZHnq3
zu&G2cInQAQTl)fg?FCoVBGEC2s`i3SwGLj{9iX}vOjV2Y5Y@HdD78rUsCI&5)gsrY
z+6i7uEz)aLTfttnNwS5tS<%j&nNg>@VZ>(3nw{zZAqV5}>=tYxmV+$G@txIrHh-<W
zK(yMGd@=*qS@R8k-tTlu@aj?f)W+<<QnLj1_BMy|MZz}sVW@}DB6m9sTdzyt(3_kj
zY}D(u=P<x_@XBsOb>3rIZ$WXR4V493&eU78Ri@Zi#a{p3YGX(CRP@T0VBc@J3Z65D
zzGV8S;hhY92rdvA2#m?(@fgxII1%h1vKBc_%GDtx>7#BocWypDzl3_y?2#)G5|rZi
i=I*xs;~}K|ZRig%qU^@0H8TDH0000<MNUMnLSTY9tN|VX
--- a/mobile/android/base/resources/drawable-large-v11/site_security_level.xml
+++ b/mobile/android/base/resources/drawable-large-v11/site_security_level.xml
@@ -2,15 +2,15 @@
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <level-list xmlns:android="http://schemas.android.com/apk/res/android">
 
     <item android:maxLevel="0" android:drawable="@drawable/site_security_unknown"/>
     <item android:maxLevel="1" android:drawable="@drawable/lock_secure"/>
-    <!-- Bug 1185600 will handle Passive Mixed Content and resolve this icon duplication -->
     <item android:maxLevel="2" android:drawable="@drawable/lock_secure"/>
-    <item android:maxLevel="3" android:drawable="@drawable/shield_enabled"/>
-    <item android:maxLevel="4" android:drawable="@drawable/shield_disabled"/>
-    <item android:maxLevel="5" android:drawable="@drawable/lock_disabled"/>
+    <item android:maxLevel="3" android:drawable="@drawable/warning_minor"/>
+    <item android:maxLevel="4" android:drawable="@drawable/lock_disabled"/>
+    <item android:maxLevel="5" android:drawable="@drawable/shield_enabled"/>
+    <item android:maxLevel="6" android:drawable="@drawable/shield_disabled"/>
 
 </level-list>
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4519e04d778d8d4c9212631a2166e28c33e9070b
GIT binary patch
literal 921
zc$@*517`e*P)<h;3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w+6j)egA5)JT8xS{{Fv*>j7kJqYZToggVpG?lzrOA$289!=8Pi-qIZICZ#P0
z$7*Z^=2*L_Vb|j$*K#W`wsKjZS|-70Z3Ir>F6kh?g|B`a;d0}rG^S$pS^bgnFAXoo
zqlafk#+m-qE<e31hx5jLa(AQI`-$y!IDxzWzK%=^_=+-PQT-N|y};b=MnMoCZqn`q
zPT{WBtT!6Ac2~^KAzwGR>|Dc56(Ub=JmB1EmAfw^g{|vb%e9@BcK4?5s<2gY?Y?Sn
z=~V7wMRMl3SSrA&)-ERmX)MQDt^gOJcupE{3zBW73a}LN?iMhRB-%_BV4=i!(rDX}
z{LPeE0ak<V6CuUC+yeeIleV$HW++)yzx#9>_3t$ADuArOAIcxQd}skM=l}o!07*qo
IM6N<$f-7Uir2qf`
--- a/mobile/android/base/resources/drawable/site_security_level.xml
+++ b/mobile/android/base/resources/drawable/site_security_level.xml
@@ -2,15 +2,15 @@
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <level-list xmlns:android="http://schemas.android.com/apk/res/android">
 
     <item android:maxLevel="0" android:drawable="@android:color/transparent"/>
     <item android:maxLevel="1" android:drawable="@drawable/lock_secure"/>
-    <!-- Bug 1185600 will handle Passive Mixed Content and resolve this icon duplication -->
     <item android:maxLevel="2" android:drawable="@drawable/lock_secure"/>
-    <item android:maxLevel="3" android:drawable="@drawable/shield_enabled"/>
-    <item android:maxLevel="4" android:drawable="@drawable/shield_disabled"/>
-    <item android:maxLevel="5" android:drawable="@drawable/lock_disabled"/>
+    <item android:maxLevel="3" android:drawable="@drawable/warning_minor"/>
+    <item android:maxLevel="4" android:drawable="@drawable/lock_disabled"/>
+    <item android:maxLevel="5" android:drawable="@drawable/shield_enabled"/>
+    <item android:maxLevel="6" android:drawable="@drawable/shield_disabled"/>
 
 </level-list>
--- a/mobile/android/base/toolbar/ToolbarDisplayLayout.java
+++ b/mobile/android/base/toolbar/ToolbarDisplayLayout.java
@@ -120,19 +120,22 @@ public class ToolbarDisplayLayout extend
 
     private AlphaAnimation mLockFadeIn;
     private TranslateAnimation mTitleSlideLeft;
     private TranslateAnimation mTitleSlideRight;
 
     private final SiteIdentityPopup mSiteIdentityPopup;
     private int mSecurityImageLevel;
 
-    private final int LEVEL_SHIELD_ENABLED = 3;
-    private final int LEVEL_SHIELD_DISABLED = 4;
-    private final int LEVEL_LOCK_DISABLED = 5;
+    // Levels for displaying Mixed Content state icons.
+    private final int LEVEL_WARNING_MINOR = 3;
+    private final int LEVEL_LOCK_DISABLED = 4;
+    // Levels for displaying Tracking Protection state icons.
+    private final int LEVEL_SHIELD_ENABLED = 5;
+    private final int LEVEL_SHIELD_DISABLED = 6;
 
     private PropertyAnimator mForwardAnim;
 
     private final ForegroundColorSpan mUrlColor;
     private final ForegroundColorSpan mBlockedColor;
     private final ForegroundColorSpan mDomainColor;
     private final ForegroundColorSpan mPrivateDomainColor;
 
@@ -414,41 +417,44 @@ public class ToolbarDisplayLayout extend
             siteIdentity = null;
         } else {
             siteIdentity = tab.getSiteIdentity();
         }
 
         mSiteIdentityPopup.setSiteIdentity(siteIdentity);
 
         final SecurityMode securityMode;
-        final MixedMode mixedMode;
+        final MixedMode activeMixedMode;
+        final MixedMode displayMixedMode;
         final TrackingMode trackingMode;
         if (siteIdentity == null) {
             securityMode = SecurityMode.UNKNOWN;
-            mixedMode = MixedMode.UNKNOWN;
+            activeMixedMode = MixedMode.UNKNOWN;
+            displayMixedMode = MixedMode.UNKNOWN;
             trackingMode = TrackingMode.UNKNOWN;
         } else {
             securityMode = siteIdentity.getSecurityMode();
-            // TODO: get both types of mixed modes.
-            mixedMode = siteIdentity.getMixedModeActive();
+            activeMixedMode = siteIdentity.getMixedModeActive();
+            displayMixedMode = siteIdentity.getMixedModeDisplay();
             trackingMode = siteIdentity.getTrackingMode();
         }
 
         // This is a bit tricky, but we have one icon and three potential indicators.
         // Default to the identity level
         int imageLevel = securityMode.ordinal();
 
-        // TODO: Update toolbar icons.
         // Check to see if any protection was overridden first
         if (trackingMode == TrackingMode.TRACKING_CONTENT_LOADED) {
             imageLevel = LEVEL_SHIELD_DISABLED;
         } else if (trackingMode == TrackingMode.TRACKING_CONTENT_BLOCKED) {
             imageLevel = LEVEL_SHIELD_ENABLED;
-        } else if (mixedMode == MixedMode.MIXED_CONTENT_LOADED) {
+        } else if (activeMixedMode == MixedMode.MIXED_CONTENT_LOADED) {
             imageLevel = LEVEL_LOCK_DISABLED;
+        } else if (displayMixedMode == MixedMode.MIXED_CONTENT_LOADED) {
+            imageLevel = LEVEL_WARNING_MINOR;
         }
 
         if (mSecurityImageLevel != imageLevel) {
             mSecurityImageLevel = imageLevel;
             mSiteSecurity.setImageLevel(mSecurityImageLevel);
             updatePageActions(flags);
         }
     }