Bug 1187107 - Add "Learn more" link about Mixed Content to Site Identity doorhanger. r=mhaigh

This commit is contained in:
Chenxia Liu 2015-07-30 18:44:06 -07:00
parent 0a92be9b50
commit 9634a230ff
2 changed files with 26 additions and 1 deletions

View File

@ -71,6 +71,16 @@
android:textAppearance="@style/TextAppearance.DoorHanger.Medium.Light"/>
</LinearLayout>
<TextView android:id="@+id/site_identity_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.DoorHanger.Medium"
android:textColor="@color/link_blue"
android:layout_marginTop="@dimen/doorhanger_section_padding_large"
android:text="@string/learn_more"
android:visibility="gone"/>
<TextView android:id="@+id/site_settings_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@ -50,10 +50,12 @@ import org.mozilla.gecko.widget.SiteLogins;
*/
public class SiteIdentityPopup extends AnchoredPopup implements GeckoEventListener {
public static enum ButtonType { DISABLE, ENABLE, KEEP_BLOCKING, CANCEL, COPY };
public static enum ButtonType { DISABLE, ENABLE, KEEP_BLOCKING, CANCEL, COPY }
private static final String LOGTAG = "GeckoSiteIdentityPopup";
private static final String MIXED_CONTENT_SUPPORT_URL =
"https://support.mozilla.org/kb/how-does-insecure-content-affect-safety-android";
private static final String TRACKING_CONTENT_SUPPORT_URL =
"https://support.mozilla.org/kb/firefox-android-tracking-protection";
@ -74,6 +76,7 @@ public class SiteIdentityPopup extends AnchoredPopup implements GeckoEventListen
private TextView mOwner;
private TextView mOwnerSupplemental;
private TextView mVerifier;
private TextView mLink;
private TextView mSiteSettingsLink;
private View mDivider;
@ -118,6 +121,14 @@ public class SiteIdentityPopup extends AnchoredPopup implements GeckoEventListen
mVerifier = (TextView) mIdentityKnownContainer.findViewById(R.id.verifier);
mDivider = mIdentity.findViewById(R.id.divider_doorhanger);
mLink = (TextView) mIdentity.findViewById(R.id.site_identity_link);
mLink.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Tabs.getInstance().loadUrlInTab(MIXED_CONTENT_SUPPORT_URL);
}
});
mSiteSettingsLink = (TextView) mIdentity.findViewById(R.id.site_settings_link);
}
@ -299,17 +310,21 @@ public class SiteIdentityPopup extends AnchoredPopup implements GeckoEventListen
if (siteIdentity.getMixedMode() == MixedMode.MIXED_CONTENT_BLOCKED) {
mMixedContentActivity.setVisibility(View.VISIBLE);
mMixedContentActivity.setText(R.string.mixed_content_blocked_all);
mLink.setVisibility(View.VISIBLE);
} else {
mMixedContentActivity.setVisibility(View.GONE);
mLink.setVisibility(View.GONE);
}
} else {
if (siteIdentity.getMixedMode() == MixedMode.MIXED_CONTENT_LOADED) {
mIcon.setImageResource(R.drawable.lock_disabled);
mMixedContentActivity.setVisibility(View.VISIBLE);
mMixedContentActivity.setText(R.string.mixed_content_protection_disabled);
mLink.setVisibility(View.VISIBLE);
} else {
mIcon.setImageResource(R.drawable.globe_light);
mMixedContentActivity.setVisibility(View.GONE);
mLink.setVisibility(View.GONE);
}
mSecurityState.setText(R.string.identity_connection_insecure);