| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/android/website_settings_popup_android.h" | 5 #include "chrome/browser/ui/android/website_settings_popup_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "chrome/browser/android/resource_mapper.h" | 10 #include "chrome/browser/android/resource_mapper.h" |
| 11 #include "chrome/browser/infobars/infobar_service.h" | 11 #include "chrome/browser/infobars/infobar_service.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" | |
| 14 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" | |
| 15 #include "chrome/browser/ui/website_settings/website_settings.h" | 13 #include "chrome/browser/ui/website_settings/website_settings.h" |
| 16 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
| 17 #include "content/public/browser/cert_store.h" | 15 #include "content/public/browser/cert_store.h" |
| 18 #include "content/public/browser/navigation_controller.h" | 16 #include "content/public/browser/navigation_controller.h" |
| 19 #include "content/public/browser/navigation_entry.h" | 17 #include "content/public/browser/navigation_entry.h" |
| 20 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
| 21 #include "content/public/common/ssl_status.h" | 19 #include "content/public/common/ssl_status.h" |
| 22 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
| 23 #include "jni/WebsiteSettingsPopup_jni.h" | 21 #include "jni/WebsiteSettingsPopup_jni.h" |
| 24 #include "net/cert/x509_certificate.h" | 22 #include "net/cert/x509_certificate.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 WebsiteSettingsPopupAndroid::~WebsiteSettingsPopupAndroid() {} | 103 WebsiteSettingsPopupAndroid::~WebsiteSettingsPopupAndroid() {} |
| 106 | 104 |
| 107 void WebsiteSettingsPopupAndroid::Destroy(JNIEnv* env, jobject obj) { | 105 void WebsiteSettingsPopupAndroid::Destroy(JNIEnv* env, jobject obj) { |
| 108 delete this; | 106 delete this; |
| 109 } | 107 } |
| 110 | 108 |
| 111 void WebsiteSettingsPopupAndroid::ResetCertDecisions( | 109 void WebsiteSettingsPopupAndroid::ResetCertDecisions( |
| 112 JNIEnv* env, | 110 JNIEnv* env, |
| 113 jobject obj, | 111 jobject obj, |
| 114 jobject java_web_contents) { | 112 jobject java_web_contents) { |
| 115 content::WebContents* web_contents = | 113 presenter_->OnSSLDecisionsRevokeButtonPressed(); |
| 116 content::WebContents::FromJavaWebContents(java_web_contents); | |
| 117 if (!web_contents) | |
| 118 return; | |
| 119 ChromeSSLHostStateDelegate* delegate = | |
| 120 presenter_->chrome_ssl_host_state_delegate(); | |
| 121 DCHECK(delegate); | |
| 122 delegate->RevokeUserDecisionsHard(presenter_->site_url().host()); | |
| 123 } | 114 } |
| 124 | 115 |
| 125 void WebsiteSettingsPopupAndroid::SetIdentityInfo( | 116 void WebsiteSettingsPopupAndroid::SetIdentityInfo( |
| 126 const IdentityInfo& identity_info) { | 117 const IdentityInfo& identity_info) { |
| 127 JNIEnv* env = base::android::AttachCurrentThread(); | 118 JNIEnv* env = base::android::AttachCurrentThread(); |
| 128 | 119 |
| 129 { | 120 { |
| 130 int icon_id = ResourceMapper::MapFromChromiumId( | 121 int icon_id = ResourceMapper::MapFromChromiumId( |
| 131 WebsiteSettingsUI::GetIdentityIconID(identity_info.identity_status)); | 122 WebsiteSettingsUI::GetIdentityIconID(identity_info.identity_status)); |
| 132 | 123 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 void WebsiteSettingsPopupAndroid::SetFirstVisit( | 196 void WebsiteSettingsPopupAndroid::SetFirstVisit( |
| 206 const base::string16& first_visit) { | 197 const base::string16& first_visit) { |
| 207 NOTIMPLEMENTED(); | 198 NOTIMPLEMENTED(); |
| 208 } | 199 } |
| 209 | 200 |
| 210 // static | 201 // static |
| 211 bool WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid( | 202 bool WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid( |
| 212 JNIEnv* env) { | 203 JNIEnv* env) { |
| 213 return RegisterNativesImpl(env); | 204 return RegisterNativesImpl(env); |
| 214 } | 205 } |
| OLD | NEW |