| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/page_info/page_info.h" | 5 #include "chrome/browser/ui/page_info/page_info.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "chrome/grit/theme_resources.h" | 49 #include "chrome/grit/theme_resources.h" |
| 50 #include "components/content_settings/core/browser/content_settings_utils.h" | 50 #include "components/content_settings/core/browser/content_settings_utils.h" |
| 51 #include "components/content_settings/core/browser/host_content_settings_map.h" | 51 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 52 #include "components/content_settings/core/common/content_settings.h" | 52 #include "components/content_settings/core/common/content_settings.h" |
| 53 #include "components/content_settings/core/common/content_settings_pattern.h" | 53 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 54 #include "components/rappor/public/rappor_utils.h" | 54 #include "components/rappor/public/rappor_utils.h" |
| 55 #include "components/rappor/rappor_service_impl.h" | 55 #include "components/rappor/rappor_service_impl.h" |
| 56 #include "components/ssl_errors/error_info.h" | 56 #include "components/ssl_errors/error_info.h" |
| 57 #include "components/strings/grit/components_chromium_strings.h" | 57 #include "components/strings/grit/components_chromium_strings.h" |
| 58 #include "components/strings/grit/components_strings.h" | 58 #include "components/strings/grit/components_strings.h" |
| 59 #include "components/subresource_filter/core/browser/subresource_filter_features
.h" |
| 59 #include "components/url_formatter/elide_url.h" | 60 #include "components/url_formatter/elide_url.h" |
| 60 #include "content/public/browser/browser_thread.h" | 61 #include "content/public/browser/browser_thread.h" |
| 61 #include "content/public/common/content_switches.h" | 62 #include "content/public/common/content_switches.h" |
| 62 #include "content/public/common/url_constants.h" | 63 #include "content/public/common/url_constants.h" |
| 63 #include "net/cert/cert_status_flags.h" | 64 #include "net/cert/cert_status_flags.h" |
| 64 #include "net/cert/x509_certificate.h" | 65 #include "net/cert/x509_certificate.h" |
| 65 #include "net/ssl/ssl_cipher_suite_names.h" | 66 #include "net/ssl/ssl_cipher_suite_names.h" |
| 66 #include "net/ssl/ssl_connection_status_flags.h" | 67 #include "net/ssl/ssl_connection_status_flags.h" |
| 67 #include "third_party/boringssl/src/include/openssl/ssl.h" | 68 #include "third_party/boringssl/src/include/openssl/ssl.h" |
| 68 #include "ui/base/l10n/l10n_util.h" | 69 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 CONTENT_SETTINGS_TYPE_JAVASCRIPT, | 103 CONTENT_SETTINGS_TYPE_JAVASCRIPT, |
| 103 #if !defined(OS_ANDROID) | 104 #if !defined(OS_ANDROID) |
| 104 CONTENT_SETTINGS_TYPE_PLUGINS, | 105 CONTENT_SETTINGS_TYPE_PLUGINS, |
| 105 CONTENT_SETTINGS_TYPE_IMAGES, | 106 CONTENT_SETTINGS_TYPE_IMAGES, |
| 106 #endif | 107 #endif |
| 107 CONTENT_SETTINGS_TYPE_POPUPS, | 108 CONTENT_SETTINGS_TYPE_POPUPS, |
| 108 CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, | 109 CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, |
| 109 CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, | 110 CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, |
| 110 CONTENT_SETTINGS_TYPE_AUTOPLAY, | 111 CONTENT_SETTINGS_TYPE_AUTOPLAY, |
| 111 CONTENT_SETTINGS_TYPE_MIDI_SYSEX, | 112 CONTENT_SETTINGS_TYPE_MIDI_SYSEX, |
| 113 CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER, |
| 112 }; | 114 }; |
| 113 | 115 |
| 114 // Determines whether to show permission |type| in the Page Info UI. Only | 116 // Determines whether to show permission |type| in the Page Info UI. Only |
| 115 // applies to permissions listed in |kPermissionType|. | 117 // applies to permissions listed in |kPermissionType|. |
| 116 bool ShouldShowPermission(ContentSettingsType type) { | 118 bool ShouldShowPermission(ContentSettingsType type) { |
| 117 #if !defined(OS_ANDROID) | 119 #if !defined(OS_ANDROID) |
| 118 // Autoplay is Android-only at the moment. | 120 // Autoplay is Android-only at the moment. |
| 119 if (type == CONTENT_SETTINGS_TYPE_AUTOPLAY) | 121 if (type == CONTENT_SETTINGS_TYPE_AUTOPLAY) |
| 120 return false; | 122 return false; |
| 121 #endif | 123 #endif |
| 122 | 124 |
| 125 if (type == CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER) { |
| 126 return base::FeatureList::IsEnabled( |
| 127 subresource_filter::kSafeBrowsingSubresourceFilterExperimentalUI); |
| 128 } |
| 129 |
| 123 return true; | 130 return true; |
| 124 } | 131 } |
| 125 | 132 |
| 126 void CheckContentStatus(security_state::ContentStatus content_status, | 133 void CheckContentStatus(security_state::ContentStatus content_status, |
| 127 bool* displayed, | 134 bool* displayed, |
| 128 bool* ran) { | 135 bool* ran) { |
| 129 switch (content_status) { | 136 switch (content_status) { |
| 130 case security_state::CONTENT_STATUS_DISPLAYED: | 137 case security_state::CONTENT_STATUS_DISPLAYED: |
| 131 *displayed = true; | 138 *displayed = true; |
| 132 break; | 139 break; |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); | 763 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); |
| 757 | 764 |
| 758 info.connection_status = site_connection_status_; | 765 info.connection_status = site_connection_status_; |
| 759 info.connection_status_description = UTF16ToUTF8(site_connection_details_); | 766 info.connection_status_description = UTF16ToUTF8(site_connection_details_); |
| 760 info.identity_status = site_identity_status_; | 767 info.identity_status = site_identity_status_; |
| 761 info.identity_status_description = UTF16ToUTF8(site_identity_details_); | 768 info.identity_status_description = UTF16ToUTF8(site_identity_details_); |
| 762 info.certificate = certificate_; | 769 info.certificate = certificate_; |
| 763 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; | 770 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; |
| 764 ui_->SetIdentityInfo(info); | 771 ui_->SetIdentityInfo(info); |
| 765 } | 772 } |
| OLD | NEW |