Index: chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java b/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java |
index 51b32a8063f2e74aecc403b96b645764bd06932e..16c9b02220c39d27431a85e523d4f9268dface7b 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java |
@@ -42,7 +42,9 @@ public class WebsiteSettingsPopup implements OnClickListener { |
private final int mPaddingWide, mPaddingThin; |
private TextView mCertificateViewer, mMoreInfoLink; |
private ViewGroup mCertificateLayout, mDescriptionLayout; |
+ private TextView mResetCertDecisions; |
private String mLinkUrl; |
+ private final long mNativeWebsiteSettingsPopup; |
private WebsiteSettingsPopup(Context context, WebContents webContents) { |
mContext = context; |
@@ -62,7 +64,7 @@ public class WebsiteSettingsPopup implements OnClickListener { |
mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); |
mDialog.setCanceledOnTouchOutside(true); |
// This needs to come after other member initialization. |
- final long nativeWebsiteSettingsPopup = nativeInit(this, webContents); |
+ mNativeWebsiteSettingsPopup = nativeInit(this, webContents); |
final WebContentsObserverAndroid webContentsObserver = |
new WebContentsObserverAndroid(mWebContents) { |
@Override |
@@ -75,9 +77,9 @@ public class WebsiteSettingsPopup implements OnClickListener { |
mDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { |
@Override |
public void onDismiss(DialogInterface dialog) { |
- assert nativeWebsiteSettingsPopup != 0; |
+ assert mNativeWebsiteSettingsPopup != 0; |
webContentsObserver.detachFromWebContents(); |
- nativeDestroy(nativeWebsiteSettingsPopup); |
+ nativeDestroy(mNativeWebsiteSettingsPopup); |
} |
}); |
} |
@@ -140,6 +142,20 @@ public class WebsiteSettingsPopup implements OnClickListener { |
} |
@CalledByNative |
+ private void addResetCertDecisionsButton(String label) { |
+ assert mNativeWebsiteSettingsPopup != 0; |
+ assert mResetCertDecisions == null; |
+ mResetCertDecisions = new TextView(mContext); |
+ mResetCertDecisions.setText(label); |
+ mResetCertDecisions.setTextColor( |
+ mContext.getResources().getColor(R.color.website_settings_popup_text_link)); |
+ mResetCertDecisions.setTextSize(DESCRIPTION_TEXT_SIZE_SP); |
+ mResetCertDecisions.setOnClickListener(this); |
+ mResetCertDecisions.setPadding(0, 0, 0, mPaddingWide); |
+ mCertificateLayout.addView(mResetCertDecisions); |
+ } |
+ |
+ @CalledByNative |
private void addMoreInfoLink(String linkText) { |
addUrl(linkText, HELP_URL); |
} |
@@ -186,6 +202,8 @@ public class WebsiteSettingsPopup implements OnClickListener { |
i.putExtra(Browser.EXTRA_APPLICATION_ID, mContext.getPackageName()); |
mContext.startActivity(i); |
} catch (URISyntaxException ex) {} |
+ } else if (mResetCertDecisions == v) { |
+ nativeResetCertDecisions(mNativeWebsiteSettingsPopup, mWebContents); |
} |
} |
@@ -206,5 +224,6 @@ public class WebsiteSettingsPopup implements OnClickListener { |
private static native long nativeInit(WebsiteSettingsPopup popup, WebContents webContents); |
private native void nativeDestroy(long nativeWebsiteSettingsPopupAndroid); |
+ private native void nativeResetCertDecisions(long nativeWebsiteSettingsPopupAndroid, WebContents webContents); |
private native byte[][] nativeGetCertificateChain(WebContents webContents); |
-} |
+} |