| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/connection_info_popup_android.h" | 5 #include "chrome/browser/ui/android/connection_info_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" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // site's identity was verified, then the headline contains the organization | 130 // site's identity was verified, then the headline contains the organization |
| 131 // name from the provided certificate. If the organization name is not | 131 // name from the provided certificate. If the organization name is not |
| 132 // available than the hostname of the site is used instead. | 132 // available than the hostname of the site is used instead. |
| 133 std::string headline; | 133 std::string headline; |
| 134 if (identity_info.cert_id) { | 134 if (identity_info.cert_id) { |
| 135 headline = identity_info.site_identity; | 135 headline = identity_info.site_identity; |
| 136 } | 136 } |
| 137 | 137 |
| 138 ScopedJavaLocalRef<jstring> description = | 138 ScopedJavaLocalRef<jstring> description = |
| 139 ConvertUTF8ToJavaString(env, identity_info.identity_status_description); | 139 ConvertUTF8ToJavaString(env, identity_info.identity_status_description); |
| 140 base::string16 certificate_label = | 140 base::string16 certificate_label; |
| 141 l10n_util::GetStringUTF16(IDS_PAGEINFO_CERT_INFO_BUTTON); | 141 |
| 142 // Only show the certificate viewer link if the connection actually used a |
| 143 // certificate. |
| 144 if (identity_info.identity_status != |
| 145 WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT) { |
| 146 certificate_label = |
| 147 l10n_util::GetStringUTF16(IDS_PAGEINFO_CERT_INFO_BUTTON); |
| 148 } |
| 149 |
| 142 Java_ConnectionInfoPopup_addCertificateSection( | 150 Java_ConnectionInfoPopup_addCertificateSection( |
| 143 env, | 151 env, |
| 144 popup_jobject_.obj(), | 152 popup_jobject_.obj(), |
| 145 icon_id, | 153 icon_id, |
| 146 ConvertUTF8ToJavaString(env, headline).obj(), | 154 ConvertUTF8ToJavaString(env, headline).obj(), |
| 147 description.obj(), | 155 description.obj(), |
| 148 ConvertUTF16ToJavaString(env, certificate_label).obj()); | 156 ConvertUTF16ToJavaString(env, certificate_label).obj()); |
| 149 | 157 |
| 150 if (identity_info.show_ssl_decision_revoke_button) { | 158 if (identity_info.show_ssl_decision_revoke_button) { |
| 151 base::string16 reset_button_label = l10n_util::GetStringUTF16( | 159 base::string16 reset_button_label = l10n_util::GetStringUTF16( |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // There's no tab UI on Android - only connection info is shown. | 200 // There's no tab UI on Android - only connection info is shown. |
| 193 NOTIMPLEMENTED(); | 201 NOTIMPLEMENTED(); |
| 194 } | 202 } |
| 195 | 203 |
| 196 // static | 204 // static |
| 197 bool | 205 bool |
| 198 ConnectionInfoPopupAndroid::RegisterConnectionInfoPopupAndroid( | 206 ConnectionInfoPopupAndroid::RegisterConnectionInfoPopupAndroid( |
| 199 JNIEnv* env) { | 207 JNIEnv* env) { |
| 200 return RegisterNativesImpl(env); | 208 return RegisterNativesImpl(env); |
| 201 } | 209 } |
| OLD | NEW |