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 "chrome/grit/generated_resources.h" | 14 #include "chrome/grit/generated_resources.h" |
17 #include "content/public/browser/browser_context.h" | 15 #include "content/public/browser/browser_context.h" |
18 #include "content/public/browser/cert_store.h" | 16 #include "content/public/browser/cert_store.h" |
19 #include "content/public/browser/navigation_controller.h" | 17 #include "content/public/browser/navigation_controller.h" |
20 #include "content/public/browser/navigation_entry.h" | 18 #include "content/public/browser/navigation_entry.h" |
21 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
22 #include "content/public/common/ssl_status.h" | 20 #include "content/public/common/ssl_status.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_->OnRevokeSSLErrorBypassButtonPressed(); |
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 void WebsiteSettingsPopupAndroid::SetFirstVisit( | 189 void WebsiteSettingsPopupAndroid::SetFirstVisit( |
199 const base::string16& first_visit) { | 190 const base::string16& first_visit) { |
200 NOTIMPLEMENTED(); | 191 NOTIMPLEMENTED(); |
201 } | 192 } |
202 | 193 |
203 // static | 194 // static |
204 bool WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid( | 195 bool WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid( |
205 JNIEnv* env) { | 196 JNIEnv* env) { |
206 return RegisterNativesImpl(env); | 197 return RegisterNativesImpl(env); |
207 } | 198 } |
OLD | NEW |