Bug 847578: Reduce redundant views in site identity popup. [r=mfinkle]

--HG--
extra : rebase_source : 8c85017a16f09ec47d5845d9d66d1ce2af31f4ad
This commit is contained in:
Sriram Ramasubramanian 2013-03-11 14:07:11 -07:00
parent 43bfb10216
commit 4d3126ec42
3 changed files with 7 additions and 37 deletions

View File

@ -76,9 +76,7 @@ public class SiteIdentityPopup extends PopupWindow {
mHost = (TextView) layout.findViewById(R.id.host);
mOwner = (TextView) layout.findViewById(R.id.owner);
mSupplemental = (TextView) layout.findViewById(R.id.supplemental);
mVerifier = (TextView) layout.findViewById(R.id.verifier);
mEncrypted = (TextView) layout.findViewById(R.id.encrypted);
mLarry = (ImageView) layout.findViewById(R.id.larry);
mArrow = (ImageView) layout.findViewById(R.id.arrow);
@ -120,24 +118,20 @@ public class SiteIdentityPopup extends PopupWindow {
mHost.setText(host);
String owner = identityData.getString("owner");
mOwner.setText(owner);
String verifier = identityData.getString("verifier");
mVerifier.setText(verifier);
String encrypted = identityData.getString("encrypted");
mEncrypted.setText(encrypted);
} catch (JSONException e) {
Log.e(LOGTAG, "Exception trying to get identity data", e);
return;
}
try {
String supplemental = identityData.getString("supplemental");
mSupplemental.setText(supplemental);
mSupplemental.setVisibility(View.VISIBLE);
owner += "\n" + supplemental;
} catch (JSONException e) { }
mOwner.setText(owner);
String verifier = identityData.getString("verifier");
String encrypted = identityData.getString("encrypted");
mVerifier.setText(verifier + "\n" + encrypted);
} catch (JSONException e) {
mSupplemental.setVisibility(View.GONE);
Log.e(LOGTAG, "Exception trying to get identity data", e);
return;
}
if (mode.equals(VERIFIED)) {
@ -145,13 +139,11 @@ public class SiteIdentityPopup extends PopupWindow {
mLarry.setImageResource(R.drawable.larry_blue);
mHost.setTextColor(mResources.getColor(R.color.identity_verified));
mOwner.setTextColor(mResources.getColor(R.color.identity_verified));
mSupplemental.setTextColor(mResources.getColor(R.color.identity_verified));
} else {
// Use a green theme for EV
mLarry.setImageResource(R.drawable.larry_green);
mHost.setTextColor(mResources.getColor(R.color.identity_identified));
mOwner.setTextColor(mResources.getColor(R.color.identity_identified));
mSupplemental.setTextColor(mResources.getColor(R.color.identity_identified));
}
int[] anchorLocation = new int[2];

View File

@ -42,11 +42,6 @@
android:layout_height="wrap_content"
android:textSize="18sp"/>
<TextView android:id="@+id/supplemental"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"/>
<TextView android:id="@+id/verifier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -54,12 +49,6 @@
android:textColor="@color/doorhanger_text"
android:paddingTop="12dip"/>
<TextView android:id="@+id/encrypted"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/doorhanger_text"/>
</LinearLayout>
<ImageView android:id="@+id/larry"

View File

@ -42,11 +42,6 @@
android:layout_height="wrap_content"
android:textSize="18sp"/>
<TextView android:id="@+id/supplemental"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"/>
<TextView android:id="@+id/verifier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -54,12 +49,6 @@
android:textColor="@color/doorhanger_text"
android:paddingTop="12dip"/>
<TextView android:id="@+id/encrypted"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/doorhanger_text"/>
</LinearLayout>
<ImageView android:id="@+id/larry"