[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 4237dd5 | 2012-06-05 00:00:32 | [diff] [blame] | 5 | #include "chrome/browser/ui/website_settings/website_settings.h" |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 6 | |
avi | 655876a | 2015-12-25 07:18:15 | [diff] [blame] | 7 | #include <stddef.h> |
| 8 | #include <stdint.h> |
| 9 | |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 10 | #include <string> |
| 11 | #include <vector> |
| 12 | |
[email protected] | eb2140c | 2013-07-29 12:37:34 | [diff] [blame] | 13 | #include "base/command_line.h" |
[email protected] | 15b09254 | 2012-05-16 13:08:14 | [diff] [blame] | 14 | #include "base/i18n/time_formatting.h" |
avi | 655876a | 2015-12-25 07:18:15 | [diff] [blame] | 15 | #include "base/macros.h" |
avi | 09dd4d0 | 2016-10-14 20:40:09 | [diff] [blame] | 16 | #include "base/memory/ptr_util.h" |
[email protected] | 71cd5ef | 2014-08-13 21:22:04 | [diff] [blame] | 17 | #include "base/metrics/field_trial.h" |
asvitkine | 7503603 | 2016-09-01 20:49:34 | [diff] [blame] | 18 | #include "base/metrics/histogram_macros.h" |
[email protected] | 3ea1b18 | 2013-02-08 22:38:41 | [diff] [blame] | 19 | #include "base/strings/string_number_conversions.h" |
[email protected] | 774cc3c | 2013-06-07 20:26:45 | [diff] [blame] | 20 | #include "base/strings/utf_string_conversions.h" |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 21 | #include "base/values.h" |
avi | 655876a | 2015-12-25 07:18:15 | [diff] [blame] | 22 | #include "build/build_config.h" |
jialiul | 02aad2d | 2015-04-01 18:56:03 | [diff] [blame] | 23 | #include "chrome/browser/browser_process.h" |
[email protected] | 6b8a3c74 | 2014-07-25 00:25:35 | [diff] [blame] | 24 | #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h" |
[email protected] | b0cb5e8 | 2012-07-19 19:22:47 | [diff] [blame] | 25 | #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" |
| 26 | #include "chrome/browser/browsing_data/browsing_data_database_helper.h" |
| 27 | #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" |
| 28 | #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" |
| 29 | #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" |
peconn | 5100d43 | 2015-09-16 12:03:08 | [diff] [blame] | 30 | #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
vabr | bab3ffcb | 2016-10-04 10:08:10 | [diff] [blame] | 31 | #include "chrome/browser/content_settings/local_shared_objects_container.h" |
[email protected] | 77a91c7 | 2012-08-13 16:19:34 | [diff] [blame] | 32 | #include "chrome/browser/history/history_service_factory.h" |
palmer | f2cba0d | 2015-08-27 23:15:06 | [diff] [blame] | 33 | #include "chrome/browser/infobars/infobar_service.h" |
reillyg | 85f57db | 2016-01-12 23:14:38 | [diff] [blame] | 34 | #include "chrome/browser/permissions/chooser_context_base.h" |
tsergeant | f1e8935 | 2016-01-15 20:34:54 | [diff] [blame] | 35 | #include "chrome/browser/permissions/permission_uma_util.h" |
| 36 | #include "chrome/browser/permissions/permission_util.h" |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 37 | #include "chrome/browser/profiles/profile.h" |
[email protected] | 71cd5ef | 2014-08-13 21:22:04 | [diff] [blame] | 38 | #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" |
| 39 | #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" |
[email protected] | 4237dd5 | 2012-06-05 00:00:32 | [diff] [blame] | 40 | #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
reillyg | 85f57db | 2016-01-12 23:14:38 | [diff] [blame] | 41 | #include "chrome/browser/usb/usb_chooser_context.h" |
| 42 | #include "chrome/browser/usb/usb_chooser_context_factory.h" |
[email protected] | 71cd5ef | 2014-08-13 21:22:04 | [diff] [blame] | 43 | #include "chrome/common/chrome_switches.h" |
jsbell | ddb849e | 2015-08-27 00:12:56 | [diff] [blame] | 44 | #include "chrome/common/url_constants.h" |
thestig | 884a160 | 2014-08-27 01:29:39 | [diff] [blame] | 45 | #include "chrome/grit/chromium_strings.h" |
| 46 | #include "chrome/grit/generated_resources.h" |
reillyg | 85f57db | 2016-01-12 23:14:38 | [diff] [blame] | 47 | #include "chrome/grit/theme_resources.h" |
mukai | 8eaec82 | 2014-10-25 17:53:16 | [diff] [blame] | 48 | #include "components/content_settings/core/browser/content_settings_utils.h" |
| 49 | #include "components/content_settings/core/browser/host_content_settings_map.h" |
palmer | 0da10b3 | 2015-02-11 00:42:19 | [diff] [blame] | 50 | #include "components/content_settings/core/common/content_settings.h" |
vasilii | f62dbf9 | 2014-09-05 10:23:13 | [diff] [blame] | 51 | #include "components/content_settings/core/common/content_settings_pattern.h" |
nzolghadr | d87a308d | 2016-12-07 15:45:56 | [diff] [blame] | 52 | #include "components/rappor/public/rappor_utils.h" |
| 53 | #include "components/rappor/rappor_service_impl.h" |
felt | 2493b445 | 2015-09-17 20:33:59 | [diff] [blame] | 54 | #include "components/ssl_errors/error_info.h" |
thestig | 4a2e88e | 2016-08-27 23:23:51 | [diff] [blame] | 55 | #include "components/strings/grit/components_chromium_strings.h" |
| 56 | #include "components/strings/grit/components_strings.h" |
palmer | 153af98 | 2015-09-15 02:04:19 | [diff] [blame] | 57 | #include "components/url_formatter/elide_url.h" |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 58 | #include "content/public/browser/browser_thread.h" |
tsergeant | f1e8935 | 2016-01-15 20:34:54 | [diff] [blame] | 59 | #include "content/public/browser/permission_type.h" |
[email protected] | e22d64f | 2012-09-10 09:03:23 | [diff] [blame] | 60 | #include "content/public/browser/user_metrics.h" |
[email protected] | eb2140c | 2013-07-29 12:37:34 | [diff] [blame] | 61 | #include "content/public/common/content_switches.h" |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 62 | #include "content/public/common/url_constants.h" |
[email protected] | 6e7845ae | 2013-03-29 21:48:11 | [diff] [blame] | 63 | #include "net/cert/cert_status_flags.h" |
| 64 | #include "net/cert/x509_certificate.h" |
[email protected] | 536fd0b | 2013-03-14 17:41:57 | [diff] [blame] | 65 | #include "net/ssl/ssl_cipher_suite_names.h" |
| 66 | #include "net/ssl/ssl_connection_status_flags.h" |
tfarina | 29a3a174 | 2016-10-28 18:47:33 | [diff] [blame] | 67 | #include "third_party/boringssl/src/include/openssl/ssl.h" |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 68 | #include "ui/base/l10n/l10n_util.h" |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 69 | |
[email protected] | 24a9f1c9 | 2013-11-13 12:33:37 | [diff] [blame] | 70 | #if defined(OS_CHROMEOS) |
| 71 | #include "chrome/browser/chromeos/policy/policy_cert_service.h" |
| 72 | #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" |
| 73 | #endif |
| 74 | |
estade | 3feb83f | 2015-09-01 23:00:49 | [diff] [blame] | 75 | #if !defined(OS_ANDROID) |
mgiuca | a319f21 | 2016-01-14 03:30:11 | [diff] [blame] | 76 | #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" |
estade | 3feb83f | 2015-09-01 23:00:49 | [diff] [blame] | 77 | #include "chrome/browser/ui/website_settings/website_settings_infobar_delegate.h" |
| 78 | #endif |
| 79 | |
[email protected] | ab6df3b1 | 2013-12-24 23:32:26 | [diff] [blame] | 80 | using base::ASCIIToUTF16; |
| 81 | using base::UTF8ToUTF16; |
[email protected] | f729d7a | 2013-12-26 07:07:56 | [diff] [blame] | 82 | using base::UTF16ToUTF8; |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 83 | using content::BrowserThread; |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 84 | |
| 85 | namespace { |
| 86 | |
jww | 1ed8ea7 | 2014-09-02 20:43:25 | [diff] [blame] | 87 | // Events for UMA. Do not reorder or change! |
| 88 | enum SSLCertificateDecisionsDidRevoke { |
| 89 | USER_CERT_DECISIONS_NOT_REVOKED = 0, |
| 90 | USER_CERT_DECISIONS_REVOKED, |
| 91 | END_OF_SSL_CERTIFICATE_DECISIONS_DID_REVOKE_ENUM |
| 92 | }; |
| 93 | |
palmer | 0da10b3 | 2015-02-11 00:42:19 | [diff] [blame] | 94 | // The list of content settings types to display on the Website Settings UI. THE |
| 95 | // ORDER OF THESE ITEMS IS IMPORTANT. To propose changing it, email |
| 96 | // [email protected]. |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 97 | ContentSettingsType kPermissionType[] = { |
sashab | 2b2a314f | 2015-01-17 06:42:21 | [diff] [blame] | 98 | CONTENT_SETTINGS_TYPE_GEOLOCATION, |
sashab | 2b2a314f | 2015-01-17 06:42:21 | [diff] [blame] | 99 | CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, |
| 100 | CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, |
palmer | 0da10b3 | 2015-02-11 00:42:19 | [diff] [blame] | 101 | CONTENT_SETTINGS_TYPE_NOTIFICATIONS, |
palmer | 7715e33 | 2016-05-27 00:41:19 | [diff] [blame] | 102 | CONTENT_SETTINGS_TYPE_JAVASCRIPT, |
lshang | e085f20 | 2016-06-14 01:25:08 | [diff] [blame] | 103 | #if !defined(OS_ANDROID) |
palmer | 7715e33 | 2016-05-27 00:41:19 | [diff] [blame] | 104 | CONTENT_SETTINGS_TYPE_PLUGINS, |
| 105 | CONTENT_SETTINGS_TYPE_IMAGES, |
lshang | e085f20 | 2016-06-14 01:25:08 | [diff] [blame] | 106 | #endif |
palmer | 7715e33 | 2016-05-27 00:41:19 | [diff] [blame] | 107 | CONTENT_SETTINGS_TYPE_POPUPS, |
nsatragno | 670fe92 | 2016-04-08 14:10:50 | [diff] [blame] | 108 | CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, |
palmer | 7715e33 | 2016-05-27 00:41:19 | [diff] [blame] | 109 | CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, |
finnur | 46cafd4 | 2016-09-22 10:27:17 | [diff] [blame] | 110 | CONTENT_SETTINGS_TYPE_AUTOPLAY, |
palmer | 7715e33 | 2016-05-27 00:41:19 | [diff] [blame] | 111 | CONTENT_SETTINGS_TYPE_MIDI_SYSEX, |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 112 | }; |
| 113 | |
mgiuca | a319f21 | 2016-01-14 03:30:11 | [diff] [blame] | 114 | // Determines whether to show permission |type| in the Website Settings UI. Only |
| 115 | // applies to permissions listed in |kPermissionType|. |
| 116 | bool ShouldShowPermission(ContentSettingsType type) { |
mgiuca | a319f21 | 2016-01-14 03:30:11 | [diff] [blame] | 117 | #if !defined(OS_ANDROID) |
finnur | 46cafd4 | 2016-09-22 10:27:17 | [diff] [blame] | 118 | // Autoplay is Android-only at the moment. |
mgiuca | 273b967 | 2016-11-11 02:22:20 | [diff] [blame] | 119 | if (type == CONTENT_SETTINGS_TYPE_AUTOPLAY) |
mgiuca | 0f3e1f7 | 2016-05-13 01:56:27 | [diff] [blame] | 120 | return false; |
mgiuca | a319f21 | 2016-01-14 03:30:11 | [diff] [blame] | 121 | #endif |
| 122 | |
| 123 | return true; |
| 124 | } |
| 125 | |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 126 | void CheckContentStatus(security_state::ContentStatus content_status, |
estark | 00e83f1 | 2016-08-19 18:24:04 | [diff] [blame] | 127 | bool* displayed, |
| 128 | bool* ran) { |
| 129 | switch (content_status) { |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 130 | case security_state::CONTENT_STATUS_DISPLAYED: |
estark | 00e83f1 | 2016-08-19 18:24:04 | [diff] [blame] | 131 | *displayed = true; |
| 132 | break; |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 133 | case security_state::CONTENT_STATUS_RAN: |
estark | 00e83f1 | 2016-08-19 18:24:04 | [diff] [blame] | 134 | *ran = true; |
| 135 | break; |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 136 | case security_state::CONTENT_STATUS_DISPLAYED_AND_RAN: |
estark | 00e83f1 | 2016-08-19 18:24:04 | [diff] [blame] | 137 | *displayed = true; |
| 138 | *ran = true; |
| 139 | break; |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 140 | case security_state::CONTENT_STATUS_UNKNOWN: |
| 141 | case security_state::CONTENT_STATUS_NONE: |
estark | 00e83f1 | 2016-08-19 18:24:04 | [diff] [blame] | 142 | break; |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | void CheckForInsecureContent( |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 147 | const security_state::SecurityInfo& security_info, |
estark | 00e83f1 | 2016-08-19 18:24:04 | [diff] [blame] | 148 | bool* displayed, |
| 149 | bool* ran) { |
| 150 | CheckContentStatus(security_info.mixed_content_status, displayed, ran); |
| 151 | // Only consider subresources with certificate errors if the main |
| 152 | // resource was loaded over HTTPS without major certificate errors. If |
| 153 | // the main resource had a certificate error, then it would not be |
| 154 | // that useful (and would potentially be confusing) to warn about |
| 155 | // subesources that had certificate errors too. |
| 156 | if (net::IsCertStatusError(security_info.cert_status) && |
| 157 | !net::IsCertStatusMinorError(security_info.cert_status)) { |
| 158 | return; |
| 159 | } |
| 160 | CheckContentStatus(security_info.content_with_cert_errors_status, displayed, |
| 161 | ran); |
| 162 | } |
| 163 | |
estark | fcfccdb8 | 2016-11-14 02:17:29 | [diff] [blame] | 164 | void GetSiteIdentityByMaliciousContentStatus( |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 165 | security_state::MaliciousContentStatus malicious_content_status, |
estark | fcfccdb8 | 2016-11-14 02:17:29 | [diff] [blame] | 166 | WebsiteSettings::SiteIdentityStatus* status, |
| 167 | base::string16* details) { |
| 168 | switch (malicious_content_status) { |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 169 | case security_state::MALICIOUS_CONTENT_STATUS_NONE: |
estark | fcfccdb8 | 2016-11-14 02:17:29 | [diff] [blame] | 170 | NOTREACHED(); |
| 171 | break; |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 172 | case security_state::MALICIOUS_CONTENT_STATUS_MALWARE: |
estark | fcfccdb8 | 2016-11-14 02:17:29 | [diff] [blame] | 173 | *status = WebsiteSettings::SITE_IDENTITY_STATUS_MALWARE; |
| 174 | *details = |
lgarron | a0a14a48 | 2017-01-12 03:04:10 | [diff] [blame^] | 175 | l10n_util::GetStringUTF16(IDS_PAGEINFO_MALWARE_DETAILS); |
estark | fcfccdb8 | 2016-11-14 02:17:29 | [diff] [blame] | 176 | break; |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 177 | case security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING: |
estark | fcfccdb8 | 2016-11-14 02:17:29 | [diff] [blame] | 178 | *status = WebsiteSettings::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING; |
| 179 | *details = l10n_util::GetStringUTF16( |
lgarron | a0a14a48 | 2017-01-12 03:04:10 | [diff] [blame^] | 180 | IDS_PAGEINFO_SOCIAL_ENGINEERING_DETAILS); |
estark | fcfccdb8 | 2016-11-14 02:17:29 | [diff] [blame] | 181 | break; |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 182 | case security_state::MALICIOUS_CONTENT_STATUS_UNWANTED_SOFTWARE: |
estark | fcfccdb8 | 2016-11-14 02:17:29 | [diff] [blame] | 183 | *status = WebsiteSettings::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE; |
| 184 | *details = l10n_util::GetStringUTF16( |
lgarron | a0a14a48 | 2017-01-12 03:04:10 | [diff] [blame^] | 185 | IDS_PAGEINFO_UNWANTED_SOFTWARE_DETAILS); |
estark | fcfccdb8 | 2016-11-14 02:17:29 | [diff] [blame] | 186 | break; |
| 187 | } |
| 188 | } |
| 189 | |
jshin | 1fb7646 | 2016-04-05 22:13:03 | [diff] [blame] | 190 | base::string16 GetSimpleSiteName(const GURL& url) { |
benwells | 2337b810 | 2016-04-20 01:53:53 | [diff] [blame] | 191 | return url_formatter::FormatUrlForSecurityDisplay( |
| 192 | url, url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS); |
palmer | 153af98 | 2015-09-15 02:04:19 | [diff] [blame] | 193 | } |
| 194 | |
reillyg | 85f57db | 2016-01-12 23:14:38 | [diff] [blame] | 195 | ChooserContextBase* GetUsbChooserContext(Profile* profile) { |
| 196 | return UsbChooserContextFactory::GetForProfile(profile); |
| 197 | } |
| 198 | |
| 199 | // The list of chooser types that need to display entries in the Website |
| 200 | // Settings UI. THE ORDER OF THESE ITEMS IS IMPORTANT. To propose changing it, |
| 201 | // email [email protected]. |
| 202 | WebsiteSettings::ChooserUIInfo kChooserUIInfo[] = { |
reillyg | 58f82ab | 2016-08-03 01:49:52 | [diff] [blame] | 203 | {CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA, &GetUsbChooserContext, |
| 204 | IDR_BLOCKED_USB, IDR_ALLOWED_USB, IDS_WEBSITE_SETTINGS_USB_DEVICE_LABEL, |
reillyg | 85f57db | 2016-01-12 23:14:38 | [diff] [blame] | 205 | IDS_WEBSITE_SETTINGS_DELETE_USB_DEVICE, "name"}, |
| 206 | }; |
| 207 | |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 208 | } // namespace |
| 209 | |
| 210 | WebsiteSettings::WebsiteSettings( |
| 211 | WebsiteSettingsUI* ui, |
| 212 | Profile* profile, |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 213 | TabSpecificContentSettings* tab_specific_content_settings, |
palmer | f2cba0d | 2015-08-27 23:15:06 | [diff] [blame] | 214 | content::WebContents* web_contents, |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 215 | const GURL& url, |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 216 | const security_state::SecurityInfo& security_info) |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 217 | : TabSpecificContentSettings::SiteDataObserver( |
| 218 | tab_specific_content_settings), |
dominickn | bdd53b5f | 2016-09-28 01:08:13 | [diff] [blame] | 219 | content::WebContentsObserver(web_contents), |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 220 | ui_(ui), |
[email protected] | 66f15731 | 2012-08-01 13:50:26 | [diff] [blame] | 221 | show_info_bar_(false), |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 222 | site_url_(url), |
| 223 | site_identity_status_(SITE_IDENTITY_STATUS_UNKNOWN), |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 224 | site_connection_status_(SITE_CONNECTION_STATUS_UNKNOWN), |
alshabalin | 5e894c1 | 2016-10-25 06:47:46 | [diff] [blame] | 225 | show_ssl_decision_revoke_button_(false), |
peconn | 5100d43 | 2015-09-16 12:03:08 | [diff] [blame] | 226 | content_settings_(HostContentSettingsMapFactory::GetForProfile(profile)), |
[email protected] | 71cd5ef | 2014-08-13 21:22:04 | [diff] [blame] | 227 | chrome_ssl_host_state_delegate_( |
jww | 1ed8ea7 | 2014-09-02 20:43:25 | [diff] [blame] | 228 | ChromeSSLHostStateDelegateFactory::GetForProfile(profile)), |
palmer | 153af98 | 2015-09-15 02:04:19 | [diff] [blame] | 229 | did_revoke_user_ssl_decisions_(false), |
estark | 8d67cd7a | 2016-10-24 05:06:41 | [diff] [blame] | 230 | profile_(profile), |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 231 | security_level_(security_state::NONE) { |
estark | a3121f6b | 2015-09-18 21:15:59 | [diff] [blame] | 232 | Init(url, security_info); |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 233 | |
| 234 | PresentSitePermissions(); |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 235 | PresentSiteData(); |
[email protected] | 24c8818c | 2012-04-25 09:57:41 | [diff] [blame] | 236 | PresentSiteIdentity(); |
[email protected] | e22d64f | 2012-09-10 09:03:23 | [diff] [blame] | 237 | |
| 238 | // Every time the Website Settings UI is opened a |WebsiteSettings| object is |
| 239 | // created. So this counts how ofter the Website Settings UI is opened. |
lgarron | 04a9350 | 2014-11-04 22:25:04 | [diff] [blame] | 240 | RecordWebsiteSettingsAction(WEBSITE_SETTINGS_OPENED); |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 241 | } |
| 242 | |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 243 | WebsiteSettings::~WebsiteSettings() { |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 244 | } |
| 245 | |
lgarron | 04a9350 | 2014-11-04 22:25:04 | [diff] [blame] | 246 | void WebsiteSettings::RecordWebsiteSettingsAction( |
| 247 | WebsiteSettingsAction action) { |
| 248 | UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Action", |
| 249 | action, |
| 250 | WEBSITE_SETTINGS_COUNT); |
| 251 | |
estark | 8d67cd7a | 2016-10-24 05:06:41 | [diff] [blame] | 252 | std::string histogram_name; |
palmer | ee0e5af | 2015-06-05 03:10:40 | [diff] [blame] | 253 | |
estark | 8d67cd7a | 2016-10-24 05:06:41 | [diff] [blame] | 254 | if (site_url_.SchemeIsCryptographic()) { |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 255 | if (security_level_ == security_state::SECURE || |
| 256 | security_level_ == security_state::EV_SECURE) { |
estark | 8d67cd7a | 2016-10-24 05:06:41 | [diff] [blame] | 257 | UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpsUrl.Valid", |
| 258 | action, WEBSITE_SETTINGS_COUNT); |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 259 | } else if (security_level_ == security_state::NONE) { |
estark | 8d67cd7a | 2016-10-24 05:06:41 | [diff] [blame] | 260 | UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpsUrl.Downgraded", |
| 261 | action, WEBSITE_SETTINGS_COUNT); |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 262 | } else if (security_level_ == security_state::DANGEROUS) { |
estark | 8d67cd7a | 2016-10-24 05:06:41 | [diff] [blame] | 263 | UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpsUrl.Dangerous", |
| 264 | action, WEBSITE_SETTINGS_COUNT); |
| 265 | } |
| 266 | return; |
| 267 | } |
| 268 | |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 269 | if (security_level_ == security_state::HTTP_SHOW_WARNING) { |
estark | 8d67cd7a | 2016-10-24 05:06:41 | [diff] [blame] | 270 | UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpUrl.Warning", |
| 271 | action, WEBSITE_SETTINGS_COUNT); |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 272 | } else if (security_level_ == security_state::DANGEROUS) { |
estark | 8d67cd7a | 2016-10-24 05:06:41 | [diff] [blame] | 273 | UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpUrl.Dangerous", |
| 274 | action, WEBSITE_SETTINGS_COUNT); |
| 275 | } else { |
| 276 | UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpUrl.Neutral", |
| 277 | action, WEBSITE_SETTINGS_COUNT); |
lgarron | 04a9350 | 2014-11-04 22:25:04 | [diff] [blame] | 278 | } |
| 279 | } |
| 280 | |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 281 | void WebsiteSettings::OnSitePermissionChanged(ContentSettingsType type, |
| 282 | ContentSetting setting) { |
[email protected] | e22d64f | 2012-09-10 09:03:23 | [diff] [blame] | 283 | // Count how often a permission for a specific content type is changed using |
| 284 | // the Website Settings UI. |
raymes | 4a13d43 | 2015-09-08 00:44:07 | [diff] [blame] | 285 | size_t num_values; |
| 286 | int histogram_value = ContentSettingTypeToHistogramValue(type, &num_values); |
sashab | 9debecd | 2014-12-18 04:15:56 | [diff] [blame] | 287 | UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.OriginInfo.PermissionChanged", |
raymes | 4a13d43 | 2015-09-08 00:44:07 | [diff] [blame] | 288 | histogram_value, num_values); |
sashab | 9debecd | 2014-12-18 04:15:56 | [diff] [blame] | 289 | |
| 290 | if (setting == ContentSetting::CONTENT_SETTING_ALLOW) { |
| 291 | UMA_HISTOGRAM_ENUMERATION( |
| 292 | "WebsiteSettings.OriginInfo.PermissionChanged.Allowed", histogram_value, |
raymes | 4a13d43 | 2015-09-08 00:44:07 | [diff] [blame] | 293 | num_values); |
tommycli | 34cf29bf | 2016-09-08 05:46:25 | [diff] [blame] | 294 | |
| 295 | if (type == CONTENT_SETTINGS_TYPE_PLUGINS) { |
| 296 | rappor::SampleDomainAndRegistryFromGURL( |
| 297 | g_browser_process->rappor_service(), |
| 298 | "ContentSettings.Plugins.AddedAllowException", site_url_); |
| 299 | } |
sashab | 9debecd | 2014-12-18 04:15:56 | [diff] [blame] | 300 | } else if (setting == ContentSetting::CONTENT_SETTING_BLOCK) { |
| 301 | UMA_HISTOGRAM_ENUMERATION( |
| 302 | "WebsiteSettings.OriginInfo.PermissionChanged.Blocked", histogram_value, |
raymes | 4a13d43 | 2015-09-08 00:44:07 | [diff] [blame] | 303 | num_values); |
sashab | 9debecd | 2014-12-18 04:15:56 | [diff] [blame] | 304 | } |
[email protected] | e22d64f | 2012-09-10 09:03:23 | [diff] [blame] | 305 | |
lgarron | 04a9350 | 2014-11-04 22:25:04 | [diff] [blame] | 306 | // This is technically redundant given the histogram above, but putting the |
| 307 | // total count of permission changes in another histogram makes it easier to |
| 308 | // compare it against other kinds of actions in WebsiteSettings[PopupView]. |
| 309 | RecordWebsiteSettingsAction(WEBSITE_SETTINGS_CHANGED_PERMISSION); |
| 310 | |
stefanocs | 8b3490cc | 2016-07-28 05:32:52 | [diff] [blame] | 311 | PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter( |
| 312 | this->profile_, this->site_url_, this->site_url_, type, |
| 313 | PermissionSourceUI::OIB); |
| 314 | |
raymes | fbaaaaa | 2015-11-10 02:20:40 | [diff] [blame] | 315 | content_settings_->SetNarrowestContentSetting(site_url_, site_url_, type, |
| 316 | setting); |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 317 | |
[email protected] | 66f15731 | 2012-08-01 13:50:26 | [diff] [blame] | 318 | show_info_bar_ = true; |
[email protected] | 2f45d54 | 2012-08-22 08:47:24 | [diff] [blame] | 319 | |
[email protected] | 2f45d54 | 2012-08-22 08:47:24 | [diff] [blame] | 320 | // Refresh the UI to reflect the new setting. |
| 321 | PresentSitePermissions(); |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 322 | } |
| 323 | |
reillyg | 85f57db | 2016-01-12 23:14:38 | [diff] [blame] | 324 | void WebsiteSettings::OnSiteChosenObjectDeleted( |
| 325 | const ChooserUIInfo& ui_info, |
| 326 | const base::DictionaryValue& object) { |
| 327 | // TODO(reillyg): Create metrics for revocations. crbug.com/556845 |
| 328 | ChooserContextBase* context = ui_info.get_context(profile_); |
reillyg | 36a7fab3 | 2016-01-28 19:15:10 | [diff] [blame] | 329 | const GURL origin = site_url_.GetOrigin(); |
| 330 | context->RevokeObjectPermission(origin, origin, object); |
reillyg | 85f57db | 2016-01-12 23:14:38 | [diff] [blame] | 331 | |
| 332 | show_info_bar_ = true; |
| 333 | |
| 334 | // Refresh the UI to reflect the changed settings. |
| 335 | PresentSitePermissions(); |
| 336 | } |
| 337 | |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 338 | void WebsiteSettings::OnSiteDataAccessed() { |
| 339 | PresentSiteData(); |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 340 | } |
| 341 | |
[email protected] | 66f15731 | 2012-08-01 13:50:26 | [diff] [blame] | 342 | void WebsiteSettings::OnUIClosing() { |
estade | 3feb83f | 2015-09-01 23:00:49 | [diff] [blame] | 343 | #if defined(OS_ANDROID) |
| 344 | NOTREACHED(); |
| 345 | #else |
dominickn | bdd53b5f | 2016-09-28 01:08:13 | [diff] [blame] | 346 | if (show_info_bar_ && web_contents() && !web_contents()->IsBeingDestroyed()) { |
palmer | f2cba0d | 2015-08-27 23:15:06 | [diff] [blame] | 347 | InfoBarService* infobar_service = |
dominickn | bdd53b5f | 2016-09-28 01:08:13 | [diff] [blame] | 348 | InfoBarService::FromWebContents(web_contents()); |
palmer | f2cba0d | 2015-08-27 23:15:06 | [diff] [blame] | 349 | if (infobar_service) |
| 350 | WebsiteSettingsInfoBarDelegate::Create(infobar_service); |
| 351 | } |
jww | 1ed8ea7 | 2014-09-02 20:43:25 | [diff] [blame] | 352 | |
| 353 | SSLCertificateDecisionsDidRevoke user_decision = |
| 354 | did_revoke_user_ssl_decisions_ ? USER_CERT_DECISIONS_REVOKED |
| 355 | : USER_CERT_DECISIONS_NOT_REVOKED; |
| 356 | |
| 357 | UMA_HISTOGRAM_ENUMERATION("interstitial.ssl.did_user_revoke_decisions", |
| 358 | user_decision, |
| 359 | END_OF_SSL_CERTIFICATE_DECISIONS_DID_REVOKE_ENUM); |
estade | 3feb83f | 2015-09-01 23:00:49 | [diff] [blame] | 360 | #endif |
jww | 1ed8ea7 | 2014-09-02 20:43:25 | [diff] [blame] | 361 | } |
| 362 | |
| 363 | void WebsiteSettings::OnRevokeSSLErrorBypassButtonPressed() { |
| 364 | DCHECK(chrome_ssl_host_state_delegate_); |
jww | 6a55df7 | 2014-09-05 19:59:29 | [diff] [blame] | 365 | chrome_ssl_host_state_delegate_->RevokeUserAllowExceptionsHard( |
| 366 | site_url().host()); |
jww | 1ed8ea7 | 2014-09-02 20:43:25 | [diff] [blame] | 367 | did_revoke_user_ssl_decisions_ = true; |
[email protected] | 66f15731 | 2012-08-01 13:50:26 | [diff] [blame] | 368 | } |
| 369 | |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 370 | void WebsiteSettings::Init(const GURL& url, |
| 371 | const security_state::SecurityInfo& security_info) { |
meacer | de53fcff | 2016-10-12 19:21:57 | [diff] [blame] | 372 | #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 373 | // On desktop, internal URLs aren't handled by this class. Instead, a |
| 374 | // custom and simpler popup is shown. |
| 375 | DCHECK(!url.SchemeIs(content::kChromeUIScheme) && |
| 376 | !url.SchemeIs(content::kChromeDevToolsScheme) && |
| 377 | !url.SchemeIs(content::kViewSourceScheme) && |
| 378 | !url.SchemeIs(content_settings::kExtensionScheme)); |
| 379 | #endif |
| 380 | |
sashab | 97894ce | 2014-10-22 10:08:33 | [diff] [blame] | 381 | bool isChromeUINativeScheme = false; |
zpeng | db4a58e | 2017-01-10 17:40:32 | [diff] [blame] | 382 | #if defined(OS_ANDROID) |
sashab | 97894ce | 2014-10-22 10:08:33 | [diff] [blame] | 383 | isChromeUINativeScheme = url.SchemeIs(chrome::kChromeUINativeScheme); |
| 384 | #endif |
| 385 | |
estark | 8d67cd7a | 2016-10-24 05:06:41 | [diff] [blame] | 386 | security_level_ = security_info.security_level; |
| 387 | |
upendrag.gowda | 60886a6e | 2015-10-31 05:51:09 | [diff] [blame] | 388 | if (url.SchemeIs(url::kAboutScheme)) { |
| 389 | // All about: URLs except about:blank are redirected. |
| 390 | DCHECK_EQ(url::kAboutBlankURL, url.spec()); |
| 391 | site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; |
| 392 | site_identity_details_ = |
| 393 | l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY); |
| 394 | site_connection_status_ = SITE_CONNECTION_STATUS_UNENCRYPTED; |
| 395 | site_connection_details_ = l10n_util::GetStringFUTF16( |
| 396 | IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, |
| 397 | UTF8ToUTF16(url.spec())); |
| 398 | return; |
| 399 | } |
| 400 | |
| 401 | if (url.SchemeIs(content::kChromeUIScheme) || isChromeUINativeScheme) { |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 402 | site_identity_status_ = SITE_IDENTITY_STATUS_INTERNAL_PAGE; |
| 403 | site_identity_details_ = |
| 404 | l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE); |
| 405 | site_connection_status_ = SITE_CONNECTION_STATUS_INTERNAL_PAGE; |
| 406 | return; |
| 407 | } |
| 408 | |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 409 | // Identity section. |
jam | 8ae7cad | 2016-09-08 23:55:21 | [diff] [blame] | 410 | certificate_ = security_info.certificate; |
[email protected] | f61c1ce | 2012-05-09 13:55:11 | [diff] [blame] | 411 | |
estark | fcfccdb8 | 2016-11-14 02:17:29 | [diff] [blame] | 412 | if (security_info.malicious_content_status != |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 413 | security_state::MALICIOUS_CONTENT_STATUS_NONE) { |
estark | fcfccdb8 | 2016-11-14 02:17:29 | [diff] [blame] | 414 | // The site has been flagged by Safe Browsing as dangerous. |
| 415 | GetSiteIdentityByMaliciousContentStatus( |
| 416 | security_info.malicious_content_status, &site_identity_status_, |
| 417 | &site_identity_details_); |
| 418 | } else if (certificate_ && |
| 419 | (!net::IsCertStatusError(security_info.cert_status) || |
| 420 | net::IsCertStatusMinorError(security_info.cert_status))) { |
| 421 | // HTTPS with no or minor errors. |
estark | a3121f6b | 2015-09-18 21:15:59 | [diff] [blame] | 422 | if (security_info.security_level == |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 423 | security_state::SECURE_WITH_POLICY_INSTALLED_CERT) { |
[email protected] | eaf3f32 | 2013-04-25 21:53:59 | [diff] [blame] | 424 | site_identity_status_ = SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT; |
[email protected] | 24a9f1c9 | 2013-11-13 12:33:37 | [diff] [blame] | 425 | site_identity_details_ = l10n_util::GetStringFUTF16( |
| 426 | IDS_CERT_POLICY_PROVIDED_CERT_MESSAGE, UTF8ToUTF16(url.host())); |
estark | a3121f6b | 2015-09-18 21:15:59 | [diff] [blame] | 427 | } else if (net::IsCertStatusMinorError(security_info.cert_status)) { |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 428 | site_identity_status_ = SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN; |
jam | 8ae7cad | 2016-09-08 23:55:21 | [diff] [blame] | 429 | base::string16 issuer_name( |
| 430 | UTF8ToUTF16(certificate_->issuer().GetDisplayName())); |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 431 | if (issuer_name.empty()) { |
| 432 | issuer_name.assign(l10n_util::GetStringUTF16( |
| 433 | IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY)); |
| 434 | } |
[email protected] | 94c74b4 | 2013-12-02 15:19:49 | [diff] [blame] | 435 | |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 436 | site_identity_details_.assign(l10n_util::GetStringFUTF16( |
estark | cf30556 | 2016-11-15 03:45:39 | [diff] [blame] | 437 | IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_VERIFIED, issuer_name)); |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 438 | |
| 439 | site_identity_details_ += ASCIIToUTF16("\n\n"); |
estark | a3121f6b | 2015-09-18 21:15:59 | [diff] [blame] | 440 | if (security_info.cert_status & |
| 441 | net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION) { |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 442 | site_identity_details_ += l10n_util::GetStringUTF16( |
| 443 | IDS_PAGE_INFO_SECURITY_TAB_UNABLE_TO_CHECK_REVOCATION); |
estark | a3121f6b | 2015-09-18 21:15:59 | [diff] [blame] | 444 | } else if (security_info.cert_status & |
| 445 | net::CERT_STATUS_NO_REVOCATION_MECHANISM) { |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 446 | site_identity_details_ += l10n_util::GetStringUTF16( |
| 447 | IDS_PAGE_INFO_SECURITY_TAB_NO_REVOCATION_MECHANISM); |
| 448 | } else { |
| 449 | NOTREACHED() << "Need to specify string for this warning"; |
| 450 | } |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 451 | } else { |
estark | cf30556 | 2016-11-15 03:45:39 | [diff] [blame] | 452 | // No major or minor errors. |
estark | a3121f6b | 2015-09-18 21:15:59 | [diff] [blame] | 453 | if (security_info.cert_status & net::CERT_STATUS_IS_EV) { |
rsleevi | 4f801272 | 2014-09-30 01:28:01 | [diff] [blame] | 454 | // EV HTTPS page. |
estark | cf30556 | 2016-11-15 03:45:39 | [diff] [blame] | 455 | site_identity_status_ = SITE_IDENTITY_STATUS_EV_CERT; |
jam | 8ae7cad | 2016-09-08 23:55:21 | [diff] [blame] | 456 | DCHECK(!certificate_->subject().organization_names.empty()); |
| 457 | organization_name_ = |
| 458 | UTF8ToUTF16(certificate_->subject().organization_names[0]); |
rsleevi | 4f801272 | 2014-09-30 01:28:01 | [diff] [blame] | 459 | // An EV Cert is required to have a city (localityName) and country but |
| 460 | // state is "if any". |
jam | 8ae7cad | 2016-09-08 23:55:21 | [diff] [blame] | 461 | DCHECK(!certificate_->subject().locality_name.empty()); |
| 462 | DCHECK(!certificate_->subject().country_name.empty()); |
rsleevi | 4f801272 | 2014-09-30 01:28:01 | [diff] [blame] | 463 | base::string16 locality; |
jam | 8ae7cad | 2016-09-08 23:55:21 | [diff] [blame] | 464 | if (!certificate_->subject().state_or_province_name.empty()) { |
rsleevi | 4f801272 | 2014-09-30 01:28:01 | [diff] [blame] | 465 | locality = l10n_util::GetStringFUTF16( |
| 466 | IDS_PAGEINFO_ADDRESS, |
jam | 8ae7cad | 2016-09-08 23:55:21 | [diff] [blame] | 467 | UTF8ToUTF16(certificate_->subject().locality_name), |
| 468 | UTF8ToUTF16(certificate_->subject().state_or_province_name), |
| 469 | UTF8ToUTF16(certificate_->subject().country_name)); |
rsleevi | 4f801272 | 2014-09-30 01:28:01 | [diff] [blame] | 470 | } else { |
| 471 | locality = l10n_util::GetStringFUTF16( |
| 472 | IDS_PAGEINFO_PARTIAL_ADDRESS, |
jam | 8ae7cad | 2016-09-08 23:55:21 | [diff] [blame] | 473 | UTF8ToUTF16(certificate_->subject().locality_name), |
| 474 | UTF8ToUTF16(certificate_->subject().country_name)); |
rsleevi | 4f801272 | 2014-09-30 01:28:01 | [diff] [blame] | 475 | } |
jam | 8ae7cad | 2016-09-08 23:55:21 | [diff] [blame] | 476 | DCHECK(!certificate_->subject().organization_names.empty()); |
rsleevi | 4f801272 | 2014-09-30 01:28:01 | [diff] [blame] | 477 | site_identity_details_.assign(l10n_util::GetStringFUTF16( |
estark | cf30556 | 2016-11-15 03:45:39 | [diff] [blame] | 478 | IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_EV_VERIFIED, |
jam | 8ae7cad | 2016-09-08 23:55:21 | [diff] [blame] | 479 | UTF8ToUTF16(certificate_->subject().organization_names[0]), |
estark | cf30556 | 2016-11-15 03:45:39 | [diff] [blame] | 480 | locality, UTF8ToUTF16(certificate_->issuer().GetDisplayName()))); |
rsleevi | 4f801272 | 2014-09-30 01:28:01 | [diff] [blame] | 481 | } else { |
| 482 | // Non-EV OK HTTPS page. |
estark | cf30556 | 2016-11-15 03:45:39 | [diff] [blame] | 483 | site_identity_status_ = SITE_IDENTITY_STATUS_CERT; |
rsleevi | 4f801272 | 2014-09-30 01:28:01 | [diff] [blame] | 484 | base::string16 issuer_name( |
jam | 8ae7cad | 2016-09-08 23:55:21 | [diff] [blame] | 485 | UTF8ToUTF16(certificate_->issuer().GetDisplayName())); |
rsleevi | 4f801272 | 2014-09-30 01:28:01 | [diff] [blame] | 486 | if (issuer_name.empty()) { |
| 487 | issuer_name.assign(l10n_util::GetStringUTF16( |
| 488 | IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY)); |
| 489 | } |
[email protected] | 94c74b4 | 2013-12-02 15:19:49 | [diff] [blame] | 490 | |
rsleevi | 4f801272 | 2014-09-30 01:28:01 | [diff] [blame] | 491 | site_identity_details_.assign(l10n_util::GetStringFUTF16( |
estark | cf30556 | 2016-11-15 03:45:39 | [diff] [blame] | 492 | IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_VERIFIED, issuer_name)); |
rsleevi | 4f801272 | 2014-09-30 01:28:01 | [diff] [blame] | 493 | } |
elawrence | be87bd6 | 2017-01-10 16:08:59 | [diff] [blame] | 494 | if (security_info.sha1_in_chain) { |
| 495 | site_identity_status_ = |
| 496 | SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM; |
| 497 | site_identity_details_ += |
| 498 | UTF8ToUTF16("\n\n") + |
| 499 | l10n_util::GetStringUTF16( |
| 500 | IDS_PAGE_INFO_SECURITY_TAB_DEPRECATED_SIGNATURE_ALGORITHM); |
rsleevi | 4f801272 | 2014-09-30 01:28:01 | [diff] [blame] | 501 | } |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 502 | } |
| 503 | } else { |
| 504 | // HTTP or HTTPS with errors (not warnings). |
| 505 | site_identity_details_.assign(l10n_util::GetStringUTF16( |
| 506 | IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY)); |
jam | 8ae7cad | 2016-09-08 23:55:21 | [diff] [blame] | 507 | if (!security_info.scheme_is_cryptographic || !security_info.certificate) |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 508 | site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; |
| 509 | else |
| 510 | site_identity_status_ = SITE_IDENTITY_STATUS_ERROR; |
| 511 | |
[email protected] | a04db82 | 2013-12-11 19:14:40 | [diff] [blame] | 512 | const base::string16 bullet = UTF8ToUTF16("\n • "); |
felt | 2493b445 | 2015-09-17 20:33:59 | [diff] [blame] | 513 | std::vector<ssl_errors::ErrorInfo> errors; |
estark | a3121f6b | 2015-09-18 21:15:59 | [diff] [blame] | 514 | ssl_errors::ErrorInfo::GetErrorsForCertStatus( |
jam | 8ae7cad | 2016-09-08 23:55:21 | [diff] [blame] | 515 | certificate_, security_info.cert_status, url, &errors); |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 516 | for (size_t i = 0; i < errors.size(); ++i) { |
| 517 | site_identity_details_ += bullet; |
| 518 | site_identity_details_ += errors[i].short_description(); |
| 519 | } |
| 520 | |
estark | a3121f6b | 2015-09-18 21:15:59 | [diff] [blame] | 521 | if (security_info.cert_status & net::CERT_STATUS_NON_UNIQUE_NAME) { |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 522 | site_identity_details_ += ASCIIToUTF16("\n\n"); |
| 523 | site_identity_details_ += l10n_util::GetStringUTF16( |
| 524 | IDS_PAGE_INFO_SECURITY_TAB_NON_UNIQUE_NAME); |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | // Site Connection |
| 529 | // We consider anything less than 80 bits encryption to be weak encryption. |
| 530 | // TODO(wtc): Bug 1198735: report mixed/unsafe content for unencrypted and |
| 531 | // weakly encrypted connections. |
| 532 | site_connection_status_ = SITE_CONNECTION_STATUS_UNKNOWN; |
| 533 | |
jshin | 1fb7646 | 2016-04-05 22:13:03 | [diff] [blame] | 534 | base::string16 subject_name(GetSimpleSiteName(url)); |
palmer | 153af98 | 2015-09-15 02:04:19 | [diff] [blame] | 535 | if (subject_name.empty()) { |
| 536 | subject_name.assign( |
| 537 | l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY)); |
| 538 | } |
| 539 | |
jam | 8ae7cad | 2016-09-08 23:55:21 | [diff] [blame] | 540 | if (!security_info.certificate || !security_info.scheme_is_cryptographic) { |
estark | a3121f6b | 2015-09-18 21:15:59 | [diff] [blame] | 541 | // Page is still loading (so SSL status is not yet available) or |
| 542 | // loaded over HTTP or loaded over HTTPS with no cert. |
[email protected] | 1c1051d | 2014-05-10 11:39:58 | [diff] [blame] | 543 | site_connection_status_ = SITE_CONNECTION_STATUS_UNENCRYPTED; |
| 544 | |
| 545 | site_connection_details_.assign(l10n_util::GetStringFUTF16( |
| 546 | IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, |
| 547 | subject_name)); |
estark | a3121f6b | 2015-09-18 21:15:59 | [diff] [blame] | 548 | } else if (security_info.security_bits < 0) { |
| 549 | // Security strength is unknown. Say nothing. |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 550 | site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED_ERROR; |
estark | a3121f6b | 2015-09-18 21:15:59 | [diff] [blame] | 551 | } else if (security_info.security_bits == 0) { |
eseckler | cac56b6 | 2016-11-16 13:49:44 | [diff] [blame] | 552 | DCHECK_NE(security_info.security_level, security_state::NONE); |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 553 | site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED_ERROR; |
| 554 | site_connection_details_.assign(l10n_util::GetStringFUTF16( |
| 555 | IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, |
| 556 | subject_name)); |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 557 | } else { |
| 558 | site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED; |
Adam Langley | 71c2b59b | 2014-11-13 00:34:22 | [diff] [blame] | 559 | |
lgarron | 3e2c33e | 2016-08-25 06:33:43 | [diff] [blame] | 560 | if (security_info.obsolete_ssl_status == net::OBSOLETE_SSL_NONE) { |
Adam Langley | 71c2b59b | 2014-11-13 00:34:22 | [diff] [blame] | 561 | site_connection_details_.assign(l10n_util::GetStringFUTF16( |
| 562 | IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_CONNECTION_TEXT, |
| 563 | subject_name)); |
| 564 | } else { |
| 565 | site_connection_details_.assign(l10n_util::GetStringFUTF16( |
| 566 | IDS_PAGE_INFO_SECURITY_TAB_WEAK_ENCRYPTION_CONNECTION_TEXT, |
| 567 | subject_name)); |
| 568 | } |
| 569 | |
estark | 00e83f1 | 2016-08-19 18:24:04 | [diff] [blame] | 570 | bool ran_insecure_content = false; |
| 571 | bool displayed_insecure_content = false; |
| 572 | CheckForInsecureContent(security_info, &displayed_insecure_content, |
| 573 | &ran_insecure_content); |
| 574 | if (ran_insecure_content || displayed_insecure_content) { |
| 575 | site_connection_status_ = |
| 576 | ran_insecure_content |
| 577 | ? SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE |
| 578 | : SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE; |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 579 | site_connection_details_.assign(l10n_util::GetStringFUTF16( |
| 580 | IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_SENTENCE_LINK, |
| 581 | site_connection_details_, |
estark | 00e83f1 | 2016-08-19 18:24:04 | [diff] [blame] | 582 | l10n_util::GetStringUTF16( |
| 583 | ran_insecure_content |
| 584 | ? IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_ERROR |
| 585 | : IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_WARNING))); |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 586 | } |
| 587 | } |
| 588 | |
avi | 655876a | 2015-12-25 07:18:15 | [diff] [blame] | 589 | uint16_t cipher_suite = |
estark | a3121f6b | 2015-09-18 21:15:59 | [diff] [blame] | 590 | net::SSLConnectionStatusToCipherSuite(security_info.connection_status); |
| 591 | if (security_info.security_bits > 0 && cipher_suite) { |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 592 | int ssl_version = |
estark | a3121f6b | 2015-09-18 21:15:59 | [diff] [blame] | 593 | net::SSLConnectionStatusToVersion(security_info.connection_status); |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 594 | const char* ssl_version_str; |
| 595 | net::SSLVersionToString(&ssl_version_str, ssl_version); |
| 596 | site_connection_details_ += ASCIIToUTF16("\n\n"); |
| 597 | site_connection_details_ += l10n_util::GetStringFUTF16( |
| 598 | IDS_PAGE_INFO_SECURITY_TAB_SSL_VERSION, |
| 599 | ASCIIToUTF16(ssl_version_str)); |
| 600 | |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 601 | bool no_renegotiation = |
estark | a3121f6b | 2015-09-18 21:15:59 | [diff] [blame] | 602 | (security_info.connection_status & |
| 603 | net::SSL_CONNECTION_NO_RENEGOTIATION_EXTENSION) != 0; |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 604 | const char *key_exchange, *cipher, *mac; |
davidben | 56a8aece | 2016-10-14 18:20:56 | [diff] [blame] | 605 | bool is_aead, is_tls13; |
| 606 | net::SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, |
| 607 | &is_tls13, cipher_suite); |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 608 | |
| 609 | site_connection_details_ += ASCIIToUTF16("\n\n"); |
[email protected] | b6c1d9e8 | 2013-06-12 17:26:57 | [diff] [blame] | 610 | if (is_aead) { |
davidben | 56a8aece | 2016-10-14 18:20:56 | [diff] [blame] | 611 | if (is_tls13) { |
| 612 | // For TLS 1.3 ciphers, report the group (historically, curve) as the |
| 613 | // key exchange. |
| 614 | key_exchange = SSL_get_curve_name(security_info.key_exchange_group); |
| 615 | if (!key_exchange) { |
| 616 | NOTREACHED(); |
| 617 | key_exchange = ""; |
| 618 | } |
| 619 | } |
[email protected] | b6c1d9e8 | 2013-06-12 17:26:57 | [diff] [blame] | 620 | site_connection_details_ += l10n_util::GetStringFUTF16( |
| 621 | IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS_AEAD, |
| 622 | ASCIIToUTF16(cipher), ASCIIToUTF16(key_exchange)); |
| 623 | } else { |
| 624 | site_connection_details_ += l10n_util::GetStringFUTF16( |
| 625 | IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS, |
| 626 | ASCIIToUTF16(cipher), ASCIIToUTF16(mac), ASCIIToUTF16(key_exchange)); |
| 627 | } |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 628 | |
agl | 078d210 | 2014-10-20 22:03:22 | [diff] [blame] | 629 | if (ssl_version == net::SSL_CONNECTION_VERSION_SSL3 && |
estark | 00e83f1 | 2016-08-19 18:24:04 | [diff] [blame] | 630 | site_connection_status_ < |
| 631 | SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE) { |
agl | 078d210 | 2014-10-20 22:03:22 | [diff] [blame] | 632 | site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED_ERROR; |
| 633 | } |
| 634 | |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 635 | if (no_renegotiation) { |
| 636 | site_connection_details_ += ASCIIToUTF16("\n\n"); |
| 637 | site_connection_details_ += l10n_util::GetStringUTF16( |
| 638 | IDS_PAGE_INFO_SECURITY_TAB_RENEGOTIATION_MESSAGE); |
| 639 | } |
| 640 | } |
[email protected] | e583f75 | 2012-08-30 13:26:21 | [diff] [blame] | 641 | |
[email protected] | 71cd5ef | 2014-08-13 21:22:04 | [diff] [blame] | 642 | // Check if a user decision has been made to allow or deny certificates with |
| 643 | // errors on this site. |
| 644 | ChromeSSLHostStateDelegate* delegate = |
estark | 7c6bfbf | 2015-09-16 22:20:50 | [diff] [blame] | 645 | ChromeSSLHostStateDelegateFactory::GetForProfile(profile_); |
[email protected] | 71cd5ef | 2014-08-13 21:22:04 | [diff] [blame] | 646 | DCHECK(delegate); |
jww | f806c36 | 2015-06-02 02:00:40 | [diff] [blame] | 647 | // Only show an SSL decision revoke button if the user has chosen to bypass |
| 648 | // SSL host errors for this host in the past. |
| 649 | show_ssl_decision_revoke_button_ = delegate->HasAllowException(url.host()); |
[email protected] | 03ef4b2a | 2012-03-06 15:04:20 | [diff] [blame] | 650 | } |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 651 | |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 652 | void WebsiteSettings::PresentSitePermissions() { |
| 653 | PermissionInfoList permission_info_list; |
reillyg | 85f57db | 2016-01-12 23:14:38 | [diff] [blame] | 654 | ChosenObjectInfoList chosen_object_info_list; |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 655 | |
| 656 | WebsiteSettingsUI::PermissionInfo permission_info; |
| 657 | for (size_t i = 0; i < arraysize(kPermissionType); ++i) { |
| 658 | permission_info.type = kPermissionType[i]; |
| 659 | |
mgiuca | a319f21 | 2016-01-14 03:30:11 | [diff] [blame] | 660 | if (!ShouldShowPermission(permission_info.type)) |
| 661 | continue; |
| 662 | |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 663 | content_settings::SettingInfo info; |
dcheng | 9603ab9 | 2016-04-08 04:17:32 | [diff] [blame] | 664 | std::unique_ptr<base::Value> value = content_settings_->GetWebsiteSetting( |
| 665 | site_url_, site_url_, permission_info.type, std::string(), &info); |
sashab | 2b2a314f | 2015-01-17 06:42:21 | [diff] [blame] | 666 | DCHECK(value.get()); |
jdoerrie | dc72ee94 | 2016-12-07 15:43:28 | [diff] [blame] | 667 | if (value->GetType() == base::Value::Type::INTEGER) { |
sashab | 2b2a314f | 2015-01-17 06:42:21 | [diff] [blame] | 668 | permission_info.setting = |
| 669 | content_settings::ValueToContentSetting(value.get()); |
[email protected] | fe4686a | 2012-10-19 15:38:26 | [diff] [blame] | 670 | } else { |
sashab | 2b2a314f | 2015-01-17 06:42:21 | [diff] [blame] | 671 | NOTREACHED(); |
[email protected] | fe4686a | 2012-10-19 15:38:26 | [diff] [blame] | 672 | } |
| 673 | |
[email protected] | 8bdf45c3 | 2012-08-04 00:12:55 | [diff] [blame] | 674 | permission_info.source = info.source; |
johnme | 9ed9388 | 2016-01-15 01:13:28 | [diff] [blame] | 675 | permission_info.is_incognito = profile_->IsOffTheRecord(); |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 676 | |
[email protected] | b1d113d | 2012-06-27 21:27:34 | [diff] [blame] | 677 | if (info.primary_pattern == ContentSettingsPattern::Wildcard() && |
sashab | 2b2a314f | 2015-01-17 06:42:21 | [diff] [blame] | 678 | info.secondary_pattern == ContentSettingsPattern::Wildcard()) { |
[email protected] | b1d113d | 2012-06-27 21:27:34 | [diff] [blame] | 679 | permission_info.default_setting = permission_info.setting; |
| 680 | permission_info.setting = CONTENT_SETTING_DEFAULT; |
| 681 | } else { |
| 682 | permission_info.default_setting = |
| 683 | content_settings_->GetDefaultContentSetting(permission_info.type, |
| 684 | NULL); |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 685 | } |
palmer | 0da10b3 | 2015-02-11 00:42:19 | [diff] [blame] | 686 | |
palmer | 64a09998 | 2016-03-09 21:26:11 | [diff] [blame] | 687 | permission_info_list.push_back(permission_info); |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 688 | } |
| 689 | |
reillyg | 85f57db | 2016-01-12 23:14:38 | [diff] [blame] | 690 | for (const ChooserUIInfo& ui_info : kChooserUIInfo) { |
| 691 | ChooserContextBase* context = ui_info.get_context(profile_); |
reillyg | 36a7fab3 | 2016-01-28 19:15:10 | [diff] [blame] | 692 | const GURL origin = site_url_.GetOrigin(); |
| 693 | auto chosen_objects = context->GetGrantedObjects(origin, origin); |
dcheng | 9603ab9 | 2016-04-08 04:17:32 | [diff] [blame] | 694 | for (std::unique_ptr<base::DictionaryValue>& object : chosen_objects) { |
reillyg | 85f57db | 2016-01-12 23:14:38 | [diff] [blame] | 695 | chosen_object_info_list.push_back( |
avi | 09dd4d0 | 2016-10-14 20:40:09 | [diff] [blame] | 696 | base::MakeUnique<WebsiteSettingsUI::ChosenObjectInfo>( |
| 697 | ui_info, std::move(object))); |
reillyg | 85f57db | 2016-01-12 23:14:38 | [diff] [blame] | 698 | } |
| 699 | } |
| 700 | |
avi | 09dd4d0 | 2016-10-14 20:40:09 | [diff] [blame] | 701 | ui_->SetPermissionInfo(permission_info_list, |
| 702 | std::move(chosen_object_info_list)); |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 703 | } |
| 704 | |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 705 | void WebsiteSettings::PresentSiteData() { |
| 706 | CookieInfoList cookie_info_list; |
vabr | bab3ffcb | 2016-10-04 10:08:10 | [diff] [blame] | 707 | const LocalSharedObjectsContainer& allowed_objects = |
[email protected] | e0ac3589 | 2012-05-15 12:53:34 | [diff] [blame] | 708 | tab_specific_content_settings()->allowed_local_shared_objects(); |
vabr | bab3ffcb | 2016-10-04 10:08:10 | [diff] [blame] | 709 | const LocalSharedObjectsContainer& blocked_objects = |
[email protected] | e0ac3589 | 2012-05-15 12:53:34 | [diff] [blame] | 710 | tab_specific_content_settings()->blocked_local_shared_objects(); |
| 711 | |
| 712 | // Add first party cookie and site data counts. |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 713 | WebsiteSettingsUI::CookieInfo cookie_info; |
[email protected] | e0ac3589 | 2012-05-15 12:53:34 | [diff] [blame] | 714 | cookie_info.allowed = allowed_objects.GetObjectCountForDomain(site_url_); |
| 715 | cookie_info.blocked = blocked_objects.GetObjectCountForDomain(site_url_); |
palmer | b14526492 | 2015-08-28 23:53:15 | [diff] [blame] | 716 | cookie_info.is_first_party = true; |
[email protected] | e0ac3589 | 2012-05-15 12:53:34 | [diff] [blame] | 717 | cookie_info_list.push_back(cookie_info); |
| 718 | |
| 719 | // Add third party cookie counts. |
[email protected] | e0ac3589 | 2012-05-15 12:53:34 | [diff] [blame] | 720 | cookie_info.allowed = allowed_objects.GetObjectCount() - cookie_info.allowed; |
| 721 | cookie_info.blocked = blocked_objects.GetObjectCount() - cookie_info.blocked; |
palmer | b14526492 | 2015-08-28 23:53:15 | [diff] [blame] | 722 | cookie_info.is_first_party = false; |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 723 | cookie_info_list.push_back(cookie_info); |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 724 | |
[email protected] | df81827 | 2012-04-20 13:10:50 | [diff] [blame] | 725 | ui_->SetCookieInfo(cookie_info_list); |
[email protected] | 0b9fdd7 | 2012-04-04 10:00:33 | [diff] [blame] | 726 | } |
[email protected] | 16de6de | 2012-04-04 12:24:14 | [diff] [blame] | 727 | |
[email protected] | 24c8818c | 2012-04-25 09:57:41 | [diff] [blame] | 728 | void WebsiteSettings::PresentSiteIdentity() { |
palmer | f9b680a | 2015-07-09 18:56:04 | [diff] [blame] | 729 | // After initialization the status about the site's connection and its |
| 730 | // identity must be available. |
[email protected] | 24c8818c | 2012-04-25 09:57:41 | [diff] [blame] | 731 | DCHECK_NE(site_identity_status_, SITE_IDENTITY_STATUS_UNKNOWN); |
| 732 | DCHECK_NE(site_connection_status_, SITE_CONNECTION_STATUS_UNKNOWN); |
| 733 | WebsiteSettingsUI::IdentityInfo info; |
| 734 | if (site_identity_status_ == SITE_IDENTITY_STATUS_EV_CERT) |
| 735 | info.site_identity = UTF16ToUTF8(organization_name()); |
| 736 | else |
jshin | 1fb7646 | 2016-04-05 22:13:03 | [diff] [blame] | 737 | info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); |
[email protected] | 24c8818c | 2012-04-25 09:57:41 | [diff] [blame] | 738 | |
| 739 | info.connection_status = site_connection_status_; |
| 740 | info.connection_status_description = |
| 741 | UTF16ToUTF8(site_connection_details_); |
| 742 | info.identity_status = site_identity_status_; |
| 743 | info.identity_status_description = |
| 744 | UTF16ToUTF8(site_identity_details_); |
jam | 8ae7cad | 2016-09-08 23:55:21 | [diff] [blame] | 745 | info.certificate = certificate_; |
[email protected] | 71cd5ef | 2014-08-13 21:22:04 | [diff] [blame] | 746 | info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; |
[email protected] | 24c8818c | 2012-04-25 09:57:41 | [diff] [blame] | 747 | ui_->SetIdentityInfo(info); |
| 748 | } |