Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1190)

Unified Diff: chrome/browser/ui/android/website_settings_popup_android.cc

Issue 418133012: Add button to page info to revoke user certificate decisions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits from pkasting and rsesek Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/android/website_settings_popup_android.cc
diff --git a/chrome/browser/ui/android/website_settings_popup_android.cc b/chrome/browser/ui/android/website_settings_popup_android.cc
index c5a35f7b31f7efde788ae280e5bc7917d2a79be4..20b1600e0f32b2ca5f149b819b8c54324c5fe0d2 100644
--- a/chrome/browser/ui/android/website_settings_popup_android.cc
+++ b/chrome/browser/ui/android/website_settings_popup_android.cc
@@ -11,9 +11,11 @@
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/website_settings/website_settings.h"
+#include "content/public/browser/browser_context.h"
#include "content/public/browser/cert_store.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/ssl_host_state.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/ssl_status.h"
#include "grit/generated_resources.h"
@@ -105,6 +107,19 @@ void WebsiteSettingsPopupAndroid::Destroy(JNIEnv* env, jobject obj) {
delete this;
}
+void WebsiteSettingsPopupAndroid::ResetCertDecisions(
+ JNIEnv* env,
+ jobject obj,
+ jobject java_web_contents) {
+ content::WebContents* web_contents =
+ content::WebContents::FromJavaWebContents(java_web_contents);
+ if (!web_contents)
+ return;
+ content::BrowserContext* context = web_contents->GetBrowserContext();
+ content::SSLHostState::GetFor(context)
+ ->RevokeAllowAndDenyPreferences(presenter_->GetSiteURL().host());
Ted C 2014/07/28 20:15:50 same line wrapping nit as the other files
jww 2014/08/06 00:51:47 Done.
+}
+
void WebsiteSettingsPopupAndroid::SetIdentityInfo(
const IdentityInfo& identity_info) {
JNIEnv* env = base::android::AttachCurrentThread();
@@ -125,8 +140,34 @@ void WebsiteSettingsPopupAndroid::SetIdentityInfo(
ScopedJavaLocalRef<jstring> description = ConvertUTF8ToJavaString(
env, identity_info.identity_status_description);
+ Java_WebsiteSettingsPopup_addDescriptionSection(
+ env,
+ popup_jobject_.obj(),
+ icon_id,
+ ConvertUTF8ToJavaString(env, headline).obj(),
+ description.obj());
+
base::string16 certificate_label =
- l10n_util::GetStringUTF16(IDS_PAGEINFO_CERT_INFO_BUTTON);
+ l10n_util::GetStringUTF16(IDS_PAGEINFO_CERT_INFO_BUTTON);
+ if (!certificate_label.empty()) {
+ Java_WebsiteSettingsPopup_addCertificateSection(
+ env,
+ popup_jobject_.obj(),
+ icon_id,
+ ConvertUTF8ToJavaString(env, headline).obj(),
+ description.obj(),
+ ConvertUTF16ToJavaString(env, certificate_label).obj());
+ }
+
+ if (identity_info.certificate_decision_made) {
+ base::string16 reset_button_label = l10n_util::GetStringUTF16(
+ IDS_PAGEINFO_RESET_INVALID_CERTIFICATE_DECISIONS_BUTTON);
+ Java_WebsiteSettingsPopup_addResetCertDecisionsButton(
+ env,
+ popup_jobject_.obj(),
+ ConvertUTF16ToJavaString(env, reset_button_label).obj());
+ }
+
Java_WebsiteSettingsPopup_addCertificateSection(
env,
popup_jobject_.obj(),

Powered by Google App Engine
This is Rietveld 408576698