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" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 // site's identity was verified, then the headline contains the organization | 118 // site's identity was verified, then the headline contains the organization |
119 // name from the provided certificate. If the organization name is not | 119 // name from the provided certificate. If the organization name is not |
120 // available than the hostname of the site is used instead. | 120 // available than the hostname of the site is used instead. |
121 std::string headline; | 121 std::string headline; |
122 if (identity_info.cert_id) { | 122 if (identity_info.cert_id) { |
123 headline = identity_info.site_identity; | 123 headline = identity_info.site_identity; |
124 } | 124 } |
125 | 125 |
126 ScopedJavaLocalRef<jstring> description = ConvertUTF8ToJavaString( | 126 ScopedJavaLocalRef<jstring> description = ConvertUTF8ToJavaString( |
127 env, identity_info.identity_status_description); | 127 env, identity_info.identity_status_description); |
128 Java_WebsiteSettingsPopup_addSection(env, popup_jobject_.obj(), icon_id, | 128 Java_WebsiteSettingsPopup_addCertificateSection( |
129 ConvertUTF8ToJavaString(env, headline).obj(), description.obj()); | 129 env, |
130 popup_jobject_.obj(), | |
131 icon_id, | |
132 ConvertUTF8ToJavaString(env, headline).obj(), | |
133 description.obj()); | |
130 | 134 |
131 base::string16 certificate_label = | 135 base::string16 certificate_label = |
132 l10n_util::GetStringUTF16(IDS_PAGEINFO_CERT_INFO_BUTTON); | 136 l10n_util::GetStringUTF16(IDS_PAGEINFO_CERT_INFO_BUTTON); |
133 if (!certificate_label.empty()) { | 137 if (!certificate_label.empty()) { |
134 Java_WebsiteSettingsPopup_setCertificateViewer(env, popup_jobject_.obj(), | 138 Java_WebsiteSettingsPopup_setCertificateViewer( |
David Trainor- moved to gerrit
2014/07/23 17:23:54
Can we just pass the cert label to the function ab
Ian Wen
2014/07/23 18:28:26
Done.
| |
139 env, | |
140 popup_jobject_.obj(), | |
135 ConvertUTF16ToJavaString(env, certificate_label).obj()); | 141 ConvertUTF16ToJavaString(env, certificate_label).obj()); |
136 } | 142 } |
137 | |
138 Java_WebsiteSettingsPopup_addDivider(env, popup_jobject_.obj()); | |
139 } | 143 } |
140 | 144 |
141 { | 145 { |
142 int icon_id = ResourceMapper::MapFromChromiumId( | 146 int icon_id = ResourceMapper::MapFromChromiumId( |
143 WebsiteSettingsUI::GetConnectionIconID( | 147 WebsiteSettingsUI::GetConnectionIconID( |
144 identity_info.connection_status)); | 148 identity_info.connection_status)); |
145 | 149 |
146 ScopedJavaLocalRef<jstring> description = ConvertUTF8ToJavaString( | 150 ScopedJavaLocalRef<jstring> description = ConvertUTF8ToJavaString( |
147 env, identity_info.connection_status_description); | 151 env, identity_info.connection_status_description); |
148 Java_WebsiteSettingsPopup_addSection(env, popup_jobject_.obj(), icon_id, | 152 Java_WebsiteSettingsPopup_addDescriptionSection( |
149 NULL, description.obj()); | 153 env, popup_jobject_.obj(), icon_id, NULL, description.obj()); |
150 | |
151 Java_WebsiteSettingsPopup_addDivider(env, popup_jobject_.obj()); | |
152 } | 154 } |
153 | 155 |
154 Java_WebsiteSettingsPopup_addMoreInfoLink(env, popup_jobject_.obj(), | 156 Java_WebsiteSettingsPopup_addMoreInfoLink(env, popup_jobject_.obj(), |
155 ConvertUTF8ToJavaString( | 157 ConvertUTF8ToJavaString( |
156 env, l10n_util::GetStringUTF8(IDS_PAGE_INFO_HELP_CENTER_LINK)).obj()); | 158 env, l10n_util::GetStringUTF8(IDS_PAGE_INFO_HELP_CENTER_LINK)).obj()); |
157 Java_WebsiteSettingsPopup_showDialog(env, popup_jobject_.obj()); | 159 Java_WebsiteSettingsPopup_showDialog(env, popup_jobject_.obj()); |
158 } | 160 } |
159 | 161 |
160 void WebsiteSettingsPopupAndroid::SetCookieInfo( | 162 void WebsiteSettingsPopupAndroid::SetCookieInfo( |
161 const CookieInfoList& cookie_info_list) { | 163 const CookieInfoList& cookie_info_list) { |
(...skipping 14 matching lines...) Expand all Loading... | |
176 void WebsiteSettingsPopupAndroid::SetFirstVisit( | 178 void WebsiteSettingsPopupAndroid::SetFirstVisit( |
177 const base::string16& first_visit) { | 179 const base::string16& first_visit) { |
178 NOTIMPLEMENTED(); | 180 NOTIMPLEMENTED(); |
179 } | 181 } |
180 | 182 |
181 // static | 183 // static |
182 bool WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid( | 184 bool WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid( |
183 JNIEnv* env) { | 185 JNIEnv* env) { |
184 return RegisterNativesImpl(env); | 186 return RegisterNativesImpl(env); |
185 } | 187 } |
OLD | NEW |