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 "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 144 |
145 // Only show the certificate viewer link if the connection actually used a | 145 // Only show the certificate viewer link if the connection actually used a |
146 // certificate. | 146 // certificate. |
147 if (identity_info.identity_status != | 147 if (identity_info.identity_status != |
148 WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT) { | 148 WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT) { |
149 certificate_label = | 149 certificate_label = |
150 l10n_util::GetStringUTF16(IDS_PAGEINFO_CERT_INFO_BUTTON); | 150 l10n_util::GetStringUTF16(IDS_PAGEINFO_CERT_INFO_BUTTON); |
151 } | 151 } |
152 | 152 |
153 Java_ConnectionInfoPopup_addCertificateSection( | 153 Java_ConnectionInfoPopup_addCertificateSection( |
154 env, | 154 env, popup_jobject_, icon_id, ConvertUTF8ToJavaString(env, headline), |
155 popup_jobject_.obj(), | 155 description, ConvertUTF16ToJavaString(env, certificate_label)); |
156 icon_id, | |
157 ConvertUTF8ToJavaString(env, headline).obj(), | |
158 description.obj(), | |
159 ConvertUTF16ToJavaString(env, certificate_label).obj()); | |
160 | 156 |
161 if (identity_info.show_ssl_decision_revoke_button) { | 157 if (identity_info.show_ssl_decision_revoke_button) { |
162 base::string16 reset_button_label = l10n_util::GetStringUTF16( | 158 base::string16 reset_button_label = l10n_util::GetStringUTF16( |
163 IDS_PAGEINFO_RESET_INVALID_CERTIFICATE_DECISIONS_BUTTON); | 159 IDS_PAGEINFO_RESET_INVALID_CERTIFICATE_DECISIONS_BUTTON); |
164 Java_ConnectionInfoPopup_addResetCertDecisionsButton( | 160 Java_ConnectionInfoPopup_addResetCertDecisionsButton( |
165 env, | 161 env, popup_jobject_, |
166 popup_jobject_.obj(), | 162 ConvertUTF16ToJavaString(env, reset_button_label)); |
167 ConvertUTF16ToJavaString(env, reset_button_label).obj()); | |
168 } | 163 } |
169 } | 164 } |
170 | 165 |
171 { | 166 { |
172 int icon_id = ResourceMapper::MapFromChromiumId( | 167 int icon_id = ResourceMapper::MapFromChromiumId( |
173 WebsiteSettingsUI::GetConnectionIconID( | 168 WebsiteSettingsUI::GetConnectionIconID( |
174 identity_info.connection_status)); | 169 identity_info.connection_status)); |
175 | 170 |
176 ScopedJavaLocalRef<jstring> description = ConvertUTF8ToJavaString( | 171 ScopedJavaLocalRef<jstring> description = ConvertUTF8ToJavaString( |
177 env, identity_info.connection_status_description); | 172 env, identity_info.connection_status_description); |
178 Java_ConnectionInfoPopup_addDescriptionSection( | 173 Java_ConnectionInfoPopup_addDescriptionSection(env, popup_jobject_, icon_id, |
179 env, popup_jobject_.obj(), icon_id, nullptr, description.obj()); | 174 nullptr, description); |
180 } | 175 } |
181 | 176 |
182 Java_ConnectionInfoPopup_addMoreInfoLink( | 177 Java_ConnectionInfoPopup_addMoreInfoLink( |
183 env, | 178 env, popup_jobject_, |
184 popup_jobject_.obj(), | |
185 ConvertUTF8ToJavaString( | 179 ConvertUTF8ToJavaString( |
186 env, l10n_util::GetStringUTF8(IDS_PAGE_INFO_HELP_CENTER_LINK)).obj()); | 180 env, l10n_util::GetStringUTF8(IDS_PAGE_INFO_HELP_CENTER_LINK))); |
187 Java_ConnectionInfoPopup_showDialog(env, popup_jobject_.obj()); | 181 Java_ConnectionInfoPopup_showDialog(env, popup_jobject_); |
188 } | 182 } |
189 | 183 |
190 void ConnectionInfoPopupAndroid::SetCookieInfo( | 184 void ConnectionInfoPopupAndroid::SetCookieInfo( |
191 const CookieInfoList& cookie_info_list) { | 185 const CookieInfoList& cookie_info_list) { |
192 NOTIMPLEMENTED(); | 186 NOTIMPLEMENTED(); |
193 } | 187 } |
194 | 188 |
195 void ConnectionInfoPopupAndroid::SetPermissionInfo( | 189 void ConnectionInfoPopupAndroid::SetPermissionInfo( |
196 const PermissionInfoList& permission_info_list, | 190 const PermissionInfoList& permission_info_list, |
197 const ChosenObjectInfoList& chosen_object_info_list) { | 191 const ChosenObjectInfoList& chosen_object_info_list) { |
198 base::STLDeleteContainerPointers(chosen_object_info_list.begin(), | 192 base::STLDeleteContainerPointers(chosen_object_info_list.begin(), |
199 chosen_object_info_list.end()); | 193 chosen_object_info_list.end()); |
200 | 194 |
201 NOTIMPLEMENTED(); | 195 NOTIMPLEMENTED(); |
202 } | 196 } |
203 | 197 |
204 void ConnectionInfoPopupAndroid::SetSelectedTab( | 198 void ConnectionInfoPopupAndroid::SetSelectedTab( |
205 WebsiteSettingsUI::TabId tab_id) { | 199 WebsiteSettingsUI::TabId tab_id) { |
206 // 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. |
207 NOTIMPLEMENTED(); | 201 NOTIMPLEMENTED(); |
208 } | 202 } |
209 | 203 |
210 // static | 204 // static |
211 bool | 205 bool |
212 ConnectionInfoPopupAndroid::RegisterConnectionInfoPopupAndroid( | 206 ConnectionInfoPopupAndroid::RegisterConnectionInfoPopupAndroid( |
213 JNIEnv* env) { | 207 JNIEnv* env) { |
214 return RegisterNativesImpl(env); | 208 return RegisterNativesImpl(env); |
215 } | 209 } |
OLD | NEW |